コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
blockly > ConnectionChecker > canConnect
ConnectionChecker.canConnect() メソッド
現在の接続が対象の接続に接続できるかどうかを確認します。
署名:
canConnect(a: Connection | null, b: Connection | null, isDragging: boolean, opt_distance?: number): boolean;
パラメータ
パラメータ |
型 |
説明 |
a |
接続 | null |
互換性を確認する接続。 |
b |
接続 | null |
互換性をチェックする接続。 |
isDragging |
ブール値 |
ブロックをドラッグして接続している場合は true。 |
opt_distance |
数値 |
(省略可)ドラッグ チェックで接続間に許容される最大距離。 |
戻り値:
ブール値
接続が合法かどうか。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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 `canConnect` method in `ConnectionChecker` verifies if two connections (`a` and `b`) are compatible. It takes two connection objects, a boolean (`isDragging`) indicating if a block is being dragged, and an optional `opt_distance` parameter for drag distance checks. It returns a boolean value indicating whether the connection between the provided connections is permitted. The method determines if it's valid for connections 'a' and 'b' to be linked.\n"]]