SplitPane
Lays out items either horizontally or vertically, with movable Dividers between them. Drag the Divider to alter how much space is allocated to each item.
When the SplitPane is resized, the proportion of additional space is governed by the items' Node.growPriority. Node.shrinkPriority is ignored. It is ignored so that expanding, and then contracting the SplitPane back to its original size will guarantee that the dividers will be in their original position.
To replicate JavaFX's setResizableWithParent
, set growPriority
to 1 for nodes which should grow/shrink, and 0 for those that should remain fixed. Glok's default growPriority
is 0, so you have to change all the resizable nodes in Glok, whereas in JavaFX, you have to change all the fixed-size nodes.
Common uses for SplitPanes :
Two see two documents side by side (or two views of the same document)
Tool panels to the left / right, with the main content in the middle.
In the first scenario, each panel should have the same growPriority (the value doesn't matter). In the second scenario, set the center's growPriority to 1, and the tool panels to 0.
Note, SplitPane respects Node.visible for its items. So, if an item becomes invisible, there will be one less divider visible too. The item to the right/south will take up the additional available space (except when it is the rightmost/bottom item which is made invisible, in which case, the item to the left/north which will take up the additional space).
Theme DSL
"split_pane" {
orientation( Orientation.HORIZONTAL )
orientation( Orientation.VERTICAL )
child( "divider" ) {
// a Region.
}
}
The divider
children are Regions.
SplitPane inherits all the features of Region
Properties
The base class Node has no children, so this is an empty list.
Functions
Adjusts a single divider, and alters other dividers using a heuristic. You may set a divider positions directly, if you prefer full control over the positions.
Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.
Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.