bibliothek.gui.dock.station.split
Interface SplitTreeFactory<N>

Type Parameters:
N - the type of elements representing leafs and nodes
All Known Implementing Classes:
SplitDockTreeFactory

public interface SplitTreeFactory<N>

A factory used to create trees that somehow represent the layout of a SplitDockStation.

Author:
Benjamin Sigg
See Also:
SplitDockStation.visit(SplitTreeFactory)

Method Summary
 N horizontal(N left, N right, double divider, long id, Path[] placeholders, PlaceholderMap placeholderMap, boolean visible)
          Informs about a node that is divided vertically.
 N leaf(Dockable dockable, long id, Path[] placeholders, PlaceholderMap placeholderMap)
          Informs about a leaf of the tree.
 N placeholder(long id, Path[] placeholders, PlaceholderMap placeholderMap)
          Informs about a set of placeholder in the tree.
 N root(N root, long id)
          Informs about the node that is the root.
 N vertical(N top, N bottom, double divider, long id, Path[] placeholders, PlaceholderMap placeholderMap, boolean visible)
          Informs about a node that is divided vertically.
 

Method Detail

leaf

N leaf(Dockable dockable,
       long id,
       Path[] placeholders,
       PlaceholderMap placeholderMap)
Informs about a leaf of the tree.

Parameters:
dockable - the element in the leaf
id - the unique identifier of this node or -1
placeholders - the placeholders associated with this node, can be empty
placeholderMap - placeholder information of a child DockStation
Returns:
the representation of the leaf or null

placeholder

N placeholder(long id,
              Path[] placeholders,
              PlaceholderMap placeholderMap)
Informs about a set of placeholder in the tree.

Parameters:
id - the unique id of this placeholder
placeholders - the placeholders
placeholderMap - placeholder information of a child DockStation
Returns:
the representation of the placeholder or null

horizontal

N horizontal(N left,
             N right,
             double divider,
             long id,
             Path[] placeholders,
             PlaceholderMap placeholderMap,
             boolean visible)
Informs about a node that is divided vertically.

Parameters:
left - the left child of the node, might be null
right - the right child of the node, might be null
divider - the size of the left node, a value between 0 and 1.
id - the unique identifier of this node or -1
placeholders - the placeholders associated with this node, can be empty
placeholderMap - placeholder information of a child DockStation
visible - whether this node is visible to the user or not. A node is only visible to the user if both its children are visible
Returns:
the representation of this node, might be null

vertical

N vertical(N top,
           N bottom,
           double divider,
           long id,
           Path[] placeholders,
           PlaceholderMap placeholderMap,
           boolean visible)
Informs about a node that is divided vertically.

Parameters:
top - the top child of the node, might be null
bottom - the bottom child of the node, might be null
divider - the size of the top node, a value between 0 and 1.
id - the unique identifier of this node or -1
placeholders - the placeholders associated with this node, can be empty
placeholderMap - placeholder information of a child DockStation
visible - whether this node is visible to the user or not. A node is only visible to the user if both its children are visible
Returns:
the representation of this node, might be null

root

N root(N root,
       long id)
Informs about the node that is the root.

Parameters:
root - the root of the tree, might be null
id - the unique identifier of this node or -1
Returns:
the tree itself, or null