컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
차단 > ConnectionChecker
ConnectionChecker 클래스
연결 유형 확인 로직의 클래스입니다.
서명:
export declare class ConnectionChecker implements IConnectionChecker
구현: IConnectionChecker
메서드
메서드 |
수정자 |
설명 |
canConnect(a, b, isDragging, opt_distance) |
|
현재 연결이 대상 연결과 연결될 수 있는지 확인합니다. |
canConnectToPrevious_(a, b)를 호출합니다. |
protected |
드래그 확인 도우미 함수입니다. |
canConnectWithReason(a, b, isDragging, opt_distance) |
|
현재 연결이 대상 연결과 연결될 수 있는지 확인하고 문제가 있으면 오류 코드를 반환합니다. |
doDragChecks(a, b, distance) |
|
드래그하여 연결할 수 있는지 확인하세요. |
doSafetyChecks(a, b) |
|
지정된 연결이 안전한지 확인합니다. 즉, Blockly의 기본적인 가정을 위반하지 않는지 (예: 자체 연결 없음) 확인합니다. |
doTypeChecks(a, b) |
|
이 연결이 값 유형 시스템과 관련하여 다른 연결과 호환되는지 확인하세요. 예: Square_root("Hello")와 호환되지 않습니다. |
getErrorMessage(errorCode, a, b) |
|
연결 오류 코드를 문자열로 변환하는 도우미 메서드입니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],["The `ConnectionChecker` class, implementing `IConnectionChecker`, manages connection type checking in the Blockly system. Key actions include determining if two connections can link via the `canConnect` and `canConnectWithReason` methods, with the latter also providing error codes. It assesses drag-related connections via `doDragChecks` and verifies safety using `doSafetyChecks`. Type compatibility is handled by `doTypeChecks`. Additionally, `getErrorMessage` provides readable error messages and `canConnectToPrevious_` is used for drag checking.\n"],null,[]]