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

public static class MultiSplitLayout.Split extends MultiSplitLayout.Node
Defines a vertical or horizontal subdivision into two or more tiles.
See Also:
  • Constructor Details

    • Split

      public Split(MultiSplitLayout.Node... children)
    • 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 class MultiSplitLayout.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

      public List<MultiSplitLayout.Node> 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

      public void remove(MultiSplitLayout.Node n)
      Remove a node from the layout. Any sibling dividers will also be removed
      Parameters:
      n - the node to be removed
    • replace

      public void replace(MultiSplitLayout.Node target, MultiSplitLayout.Node replacement)
      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 replaced
      replacement - the replacement node
    • hide

      public void hide(MultiSplitLayout.Node target)
      Change a node to being hidden. Any associated divider nodes are also hidden
      Parameters:
      target - the node to hide
    • checkDividers

      public void checkDividers(MultiSplitLayout.Split split)
      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

      public void restoreDividers(MultiSplitLayout.Split split)
      Restore any of the hidden dividers that are required to separate visible nodes
      Parameters:
      split - the node to check
    • setChildren

      public void setChildren(List<MultiSplitLayout.Node> children)
      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

      public void setChildren(MultiSplitLayout.Node... children)
      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

      public final MultiSplitLayout.Node 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

      public String getName()
      Return the Leaf's name.
      Returns:
      the value of the name property.
      See Also:
    • setName

      public void setName(String name)
      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

      public String toString()
      Overrides:
      toString in class Object