API / geotoolkit / layout / LayoutHelper / LayoutHelper
layout.LayoutHelper.LayoutHelper
This utility class provides functions used by LayoutStyle implementations
Constructors
Methods
Methods
▸ Static getBottomMargin(node, totalHeight?): number
Returns bottom margin
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalHeight | number | parent height of the container or layoutable area |
number
▸ Static getDesiredHeight(node, totalHeight?, processInvisible?): number
Converts desired height of the "node" layoutable component to number if possible
Example
node.setDesiredHeight('15');
const h1 = LayoutHelper.getDesiredHeight(node); // So, h1==15.
node.setDesiredHeight('15%');
const h2 = LayoutHelper.getDesiredHeight(node, 200); // So, h2==30.| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalHeight | number | parent height of the container or layoutable area |
Optional processInvisible | boolean | ask to don't skip invisible nodes |
number
converted value; or 0 if the node is not visible; or "undefined" the conversion failed.
▸ Static getDesiredMaxHeight(node, totalHeight?): number
Gets the Maximum Height of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalHeight | number | parent height of the container or layoutable area |
number
Maximum Height
▸ Static getDesiredMaxWidth(node, totalWidth?): number
Gets the Maximum Width of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalWidth | number | parent width of the container or layoutable area |
number
Maximum Width
▸ Static getDesiredMinHeight(node, totalHeight?): number
Gets the Minimum Height of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalHeight | number | parent height of the container or layoutable area |
number
Minimum Height
▸ Static getDesiredMinWidth(node, totalWidth?): number
Gets the Minimum Width of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalWidth | number | parent width of the container or layoutable area |
number
Minimum Width
▸ Static getDesiredWidth(node, totalWidth?, processInvisible?): number
Converts desired width of the "node" layoutable component to number if possible
Example
node.setDesiredWidth('15');
const w1 = LayoutHelper.getDesiredWidth(node); // So, w1==15.
node.setDesiredWidth('15%');
const w2 = LayoutHelper.getDesiredWidth(node, 200); // So, w2==30.| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalWidth | number | parent width of the container or layoutable area |
Optional processInvisible | boolean | ask to don't skip invisible nodes |
number
converted value; or 0 if the node is not visible; or "undefined" the conversion failed.
▸ Static getFlexGrow(node): number
Gets the Flex Grow of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
number
Flex Grow
▸ Static getFlexShrink(node): number
Gets the Flex Shrink of layoutable component
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
number
Flex Shrink
▸ Static getLeftMargin(node, totalWidth?): number
Returns left margin
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalWidth | number | parent width of the container or layoutable area |
number
▸ Static getPreferredStyle(style, rect?): LayoutStyle<string | number>
Update layout style preferred size based on size constrains from calculated size
| Name | Type | Description |
|---|---|---|
style | LayoutStyle<string | number> | style to be updated |
Optional rect | Rect | Dimension | desired rect to layout |
LayoutStyle<string | number>
▸ Static getRightMargin(node, totalWidth?): number
Returns right margin
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalWidth | number | parent width of the container or layoutable area |
number
▸ Static getTopMargin(node, totalHeight?): number
Returns top margin
| Name | Type | Description |
|---|---|---|
node | ILayoutable | layoutable component |
Optional totalHeight | number | parent height of the container or layoutable area |
number
▸ Static invalidateLayout(item, propagate?): void
Notify that layout is invalidated. Send event Events.LayoutInvalidated
| Name | Type | Description |
|---|---|---|
item | CompositeNode<Node> | item |
Optional propagate | boolean | propagate invalidate layout to parent |
void
▸ Static invalidateParentLayout(item, propagate?): void
Notify that layout is invalidated. Send event Events.LayoutInvalidated
| Name | Type | Description |
|---|---|---|
item | Node | item |
Optional propagate | boolean | propagate invalidate layout to parent |
void
▸ Static setDesiredTextSize(text, groupText, location): void
Sets desired size of text group, depends on text metrics
| Name | Type | Description |
|---|---|---|
text | Text | text |
groupText | Group<Node> | group with this text |
location | AnnotationLocation | location of text |
void