Elements
During measurement the block gets broken up into rows
containing non-overlapping elements and element spacers.
Elements
Elements represent visual things on a block. Examples include elements
representing:
- Fields
- Icons
- Connections
- Corners
Each element is a rectangle defining the bounds of the visual thing, plus some
extra data specific to each kind of element.
The bounds of the element are usually determined by some external class
(that is, the thing they represent). For example,
field elements represent fields, and their size is determined
by the field's getSize
method.
Element spacer
An element spacer is an empty space that goes between elements in a row.
The bounds of spacers are determined by the render info during
measurement. After measuring all of the elements of the block, the
render info inserts spaces of its chosen size between
the elements. The sizes don't have to be consistent; they are often different
depending on the elements to either side of the spacer.
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."],[[["During the measurement phase, a block is deconstructed into rows comprising elements and element spacers for rendering purposes."],["Elements represent the visual components of a block, including fields, icons, connections, and corners, with their size usually determined by the element they represent."],["Element spacers are empty spaces inserted between elements to control the spacing and visual layout of the block."]]],["During the measurement phase, blocks are divided into rows with elements and spacers. Elements, such as fields, icons, connections, and corners, are represented by rectangles with specific data. Their sizes are dictated by external classes, like a field's `getSize` method. Element spacers are empty spaces inserted between elements by the render info, with varying sizes based on the adjacent elements. The render info determines spacer sizes after measuring all block elements.\n"]]