จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
blockly > 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("สวัสดี") เข้ากันไม่ได้ |
getErrorMessage(errorCode, a, b) |
|
เมธอดของ Helper ที่แปลงรหัสข้อผิดพลาดในการเชื่อมต่อเป็นสตริง |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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"]]