Package org.jdesktop.swingx
Class MultiSplitLayout.Split
java.lang.Object
org.jdesktop.swingx.MultiSplitLayout.Node
org.jdesktop.swingx.MultiSplitLayout.Split
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DefaultSplitPaneModel
,MultiSplitLayout.ColSplit
,MultiSplitLayout.RowSplit
- Enclosing class:
- MultiSplitLayout
Defines a vertical or horizontal subdivision into two or more tiles.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSplit()
Default constructor to support xml (de)serialization and other bean spec dependent ops.Split
(MultiSplitLayout.Node... children) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check the dividers to ensure that redundant dividers are hidden and do not interfere in the layout, for example when all the children of a split are hidden (the split is then invisible), so two dividers may otherwise appear next to one another.Returns this Split node's children.getName()
Return the Leaf's name.void
hide
(MultiSplitLayout.Node target) Change a node to being hidden.boolean
Returns true if the this Split's children are to be laid out in a row: all the same height, left edge equal to the previous Node's right edge.boolean
Determines whether this node should be visible when its parent is visible.final MultiSplitLayout.Node
Convenience method that returns the last child whose weight is > 0.0.void
Remove a node from the layout.void
replace
(MultiSplitLayout.Node target, MultiSplitLayout.Node replacement) Replace one node with another.void
Restore any of the hidden dividers that are required to separate visible nodesvoid
setChildren
(List<MultiSplitLayout.Node> children) Set's the children property of this Split node.void
setChildren
(MultiSplitLayout.Node... children) Convenience method for setting the children of this Split node.void
Set the value of the name property.void
setRowLayout
(boolean rowLayout) Set the rowLayout property.toString()
Methods inherited from class org.jdesktop.swingx.MultiSplitLayout.Node
getBounds, getParent, getWeight, nextSibling, previousSibling, setBounds, setParent, setVisible, setWeight
-
Constructor Details
-
Split
-
Split
public Split()Default constructor to support xml (de)serialization and other bean spec dependent ops. Resulting instance of Split is invalid until setChildren() is called.
-
-
Method Details
-
isVisible
public boolean isVisible()Determines whether this node should be visible when its parent is visible. Nodes are initially visible- Overrides:
isVisible
in classMultiSplitLayout.Node
- Returns:
true
if the node is visible,false
otherwise
-
isRowLayout
public boolean isRowLayout()Returns true if the this Split's children are to be laid out in a row: all the same height, left edge equal to the previous Node's right edge. If false, children are laid on in a column.- Returns:
- the value of the rowLayout property.
- See Also:
-
setRowLayout
public void setRowLayout(boolean rowLayout) Set the rowLayout property. If true, all of this Split's children are to be laid out in a row: all the same height, each node's left edge equal to the previous Node's right edge. If false, children are laid on in a column. Default value is true.- Parameters:
rowLayout
- true for horizontal row layout, false for column- See Also:
-
getChildren
Returns this Split node's children. The returned value is not a reference to the Split's internal list of children- Returns:
- the value of the children property.
- See Also:
-
remove
Remove a node from the layout. Any sibling dividers will also be removed- Parameters:
n
- the node to be removed
-
replace
Replace one node with another. This method is used when a child is removed from a split and the split is no longer required, in which case the remaining node in the child split can replace the split in the parent node- Parameters:
target
- the node being replacedreplacement
- the replacement node
-
hide
Change a node to being hidden. Any associated divider nodes are also hidden- Parameters:
target
- the node to hide
-
checkDividers
Check the dividers to ensure that redundant dividers are hidden and do not interfere in the layout, for example when all the children of a split are hidden (the split is then invisible), so two dividers may otherwise appear next to one another.- Parameters:
split
- the split to check
-
restoreDividers
Restore any of the hidden dividers that are required to separate visible nodes- Parameters:
split
- the node to check
-
setChildren
Set's the children property of this Split node. The parent of each new child is set to this Split node, and the parent of each old child (if any) is set to null. This method defensively copies the incoming List. Default value is an empty List.- Parameters:
children
- List of children- Throws:
IllegalArgumentException
- if children is null- See Also:
-
setChildren
Convenience method for setting the children of this Split node. The parent of each new child is set to this Split node, and the parent of each old child (if any) is set to null. This method defensively copies the incoming array.- Parameters:
children
- array of children- Throws:
IllegalArgumentException
- if children is null- See Also:
-
lastWeightedChild
Convenience method that returns the last child whose weight is > 0.0.- Returns:
- the last child whose weight is > 0.0.
- See Also:
-
getName
Return the Leaf's name.- Returns:
- the value of the name property.
- See Also:
-
setName
Set the value of the name property. Name may not be null.- Parameters:
name
- value of the name property- Throws:
IllegalArgumentException
- if name is null
-
toString
-