調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
定数プロバイダ
ConstantProvider
はマジック ナンバー、シェイプ、文字列のコレクションで、他のすべてのレンダラ コンポーネントや、組み込みフィールドなどの Blockly の他の部分で使用されるものです。
すべての定数値は定数とみなされます。実行時に値を変更すると、レンダリングのバグが発生します。
接続の形状
定数プロバイダには、さまざまな接続の標準的な形状の定義が含まれています。Notch
は、次と前の接続の形状を定義します。また、PuzzleTab
は、入力接続と出力接続の形状を定義します。(これらの名前は、デフォルトのレンダラによって提供されるシェイプに基づいています)。
チェックに基づく接続シェイプ
定数プロバイダは、接続チェックに基づいて接続の形状を動的に定義することもできます。そのためには、shapeFor
メソッドを使用します。
その他のさまざまなパス
また、定数プロバイダは、閉じられたブロックのジャグエッジなど、ブロックの他のさまざまな部分のパスも定義します。
その他のさまざまな値
最後に、定数プロバイダは、異なる要素間のパディングや行の最小高など、さまざまな値も定義します。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2023-12-02 UTC。
[null,null,["最終更新日 2023-12-02 UTC。"],[[["The `ConstantProvider` stores essential values like shapes, strings, and numbers used by Blockly's rendering components."],["It defines standard shapes for different connection types, including notches for previous/next connections and puzzle tabs for input/output connections."],["Connection shapes can be dynamically determined based on connection checks using the `shapeFor` method."],["The `ConstantProvider` also defines paths for elements like collapsed block edges and various values for padding and minimum heights."],["Modifying `ConstantProvider` values during runtime is discouraged as it can lead to rendering issues."]]],["The `ConstantProvider` stores essential rendering data for Blockly, including connection shapes, paths, and values. It defines standard connection shapes like `Notch` for next/previous connections and `PuzzleTab` for input/output. The `shapeFor` method allows dynamic shape definition based on connection checks. Additionally, it defines paths for block components, like jagged edges, and values for padding and minimum row heights, ensuring consistent rendering. Changing these values at runtime will cause rendering issues.\n"]]