Constant provider
The ConstantProvider
is a collection of magic numbers,
shapes and strings used by all of the other renderer components, as well as
other parts of Blockly like the built-in fields.
All constant values are assumed to be constant! Changing values at
runtime causes rendering bugs.
Connection shapes
The constant provider contains definitions for the standard shapes of different
connections. Notch
es define the shapes of next and previous
connections. And the PuzzleTab
s define the shapes of input
and output connections. (These names are based on the shapes provided by
the default renderer.)
Connection shapes based on checks
The constant provider can also define the shapes of connections dynamically
based on their connection check. This is done using the
shapeFor
method.
Other various paths
The constant provider also defines paths for other various parts of the
block, like jagged edges for collapsed blocks.
Other various values
And finally, the constant provider also defines various values for things like
the padding between different elements, or the minimum heights of rows.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 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"]]