bibliothek.gui.dock.station.split
Class SplitPlaceholderConverter

java.lang.Object
  extended by bibliothek.gui.dock.station.split.AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
      extended by bibliothek.gui.dock.station.split.SplitPlaceholderConverter

public class SplitPlaceholderConverter
extends AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>

Supporting class for SplitDockStation, provides the implementation of SplitDockStation.getPlaceholders() and SplitDockStation.setPlaceholders(PlaceholderMap)

Author:
Benjamin Sigg

Constructor Summary
SplitPlaceholderConverter(SplitDockStation station)
          Creates a new converter
 
Method Summary
protected  SplitDockTree<Dockable> createTree()
          Creates a new SplitDockTree which will be used for AbstractSplitPlaceholderConverter.dropTree(Object, SplitDockTree).
protected  void dropTree(SplitDockStation station, SplitDockTree<Dockable> tree)
          Updates station such that its layout looks as described by tree.
protected  double getDivider(SplitNode node)
          Gets the divider location of the intermediate node node.
protected  Dockable getDockable(SplitNode leaf)
          Gets the dockable of the leaf node leaf.
protected  long getId(SplitNode node)
          Gets the unique identifier that was assigned to node.
protected  SplitNode getLeftChild(SplitNode node)
          Gets the left child of the intermediate node node.
protected  SplitDockStation.Orientation getOrientation(SplitNode node)
          Gets the orientation of the intermediate node node.
protected  Path getPlaceholderFor(Dockable dockable)
          Gets a placeholder that is to be used for dockable.
protected  PlaceholderMap getPlaceholderMap(SplitNode node)
          Gets the PlaceholderMap which is associated with node.
protected  Path[] getPlaceholders(SplitNode node)
          Gets all placeholders that are associated with node.
protected  PlaceholderStrategy getPlaceholderStrategy(SplitDockStation station)
          Gets the PlaceholderStrategy that is used by station to filter its children.
protected  SplitNode getRightChild(SplitNode node)
          Gets the right child of the intermediate node node.
protected  SplitNode getRoot(SplitDockStation station)
          Gets the root node of the tree that describes the layout of station.
protected  SplitNode getRootChild(SplitNode root)
          Gets the child of the root node root.
protected  boolean isLeaf(SplitNode node)
          Tells whether node is a leaf node.
protected  boolean isNode(SplitNode node)
          Tells whether node is an intermediate node.
protected  boolean isPlaceholder(SplitNode node)
          Tells whether node is a placeholder node.
protected  boolean isRoot(SplitNode node)
          Tells whether node is a root node.
 
Methods inherited from class bibliothek.gui.dock.station.split.AbstractSplitPlaceholderConverter
getPlaceholders, getStation, setPlaceholders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitPlaceholderConverter

public SplitPlaceholderConverter(SplitDockStation station)
Creates a new converter

Parameters:
station - the station for which the converter will be used
Method Detail

getRoot

protected SplitNode getRoot(SplitDockStation station)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the root node of the tree that describes the layout of station.

Specified by:
getRoot in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
station - the station whose root node is searched
Returns:
the root node

getPlaceholderStrategy

protected PlaceholderStrategy getPlaceholderStrategy(SplitDockStation station)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the PlaceholderStrategy that is used by station to filter its children.

Specified by:
getPlaceholderStrategy in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
station - the station whose PlaceholderStrategy is searched
Returns:
the strategy

createTree

protected SplitDockTree<Dockable> createTree()
Description copied from class: AbstractSplitPlaceholderConverter
Creates a new SplitDockTree which will be used for AbstractSplitPlaceholderConverter.dropTree(Object, SplitDockTree).

Specified by:
createTree in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Returns:
the new tree, not null

dropTree

protected void dropTree(SplitDockStation station,
                        SplitDockTree<Dockable> tree)
Description copied from class: AbstractSplitPlaceholderConverter
Updates station such that its layout looks as described by tree.

Specified by:
dropTree in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
station - the station whose layout gets updated
tree - the new layout

isLeaf

protected boolean isLeaf(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Tells whether node is a leaf node.

Specified by:
isLeaf in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node to check
Returns:
true if node is a leaf node

isNode

protected boolean isNode(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Tells whether node is an intermediate node.

Specified by:
isNode in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node to check
Returns:
true if node is an intermediate node

isPlaceholder

protected boolean isPlaceholder(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Tells whether node is a placeholder node.

Specified by:
isPlaceholder in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node to check
Returns:
true if node is a placeholder node

isRoot

protected boolean isRoot(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Tells whether node is a root node.

Specified by:
isRoot in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node to check
Returns:
true if node is a root node

getPlaceholders

protected Path[] getPlaceholders(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets all placeholders that are associated with node.

Specified by:
getPlaceholders in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node whose placeholders are searched
Returns:
the placeholders

getPlaceholderMap

protected PlaceholderMap getPlaceholderMap(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the PlaceholderMap which is associated with node.

Specified by:
getPlaceholderMap in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - the node whose PlaceholderMap is searched
Returns:
the map or null

getId

protected long getId(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the unique identifier that was assigned to node.

Specified by:
getId in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - some node whose id is searched
Returns:
the unique identifier

getDivider

protected double getDivider(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the divider location of the intermediate node node.

Specified by:
getDivider in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - an intermediate node
Returns:
the divider location of node

getOrientation

protected SplitDockStation.Orientation getOrientation(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the orientation of the intermediate node node.

Specified by:
getOrientation in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - an intermediate node
Returns:
the orientation of node

getDockable

protected Dockable getDockable(SplitNode leaf)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the dockable of the leaf node leaf.

Specified by:
getDockable in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
leaf - a leaf node
Returns:
the dockable of leaf

getLeftChild

protected SplitNode getLeftChild(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the left child of the intermediate node node.

Specified by:
getLeftChild in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - an intermediate node
Returns:
the left child of node

getRightChild

protected SplitNode getRightChild(SplitNode node)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the right child of the intermediate node node.

Specified by:
getRightChild in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
node - an intermediate node
Returns:
the right child of node

getRootChild

protected SplitNode getRootChild(SplitNode root)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the child of the root node root.

Specified by:
getRootChild in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
root - a root node
Returns:
the only child of root

getPlaceholderFor

protected Path getPlaceholderFor(Dockable dockable)
Description copied from class: AbstractSplitPlaceholderConverter
Gets a placeholder that is to be used for dockable.

Specified by:
getPlaceholderFor in class AbstractSplitPlaceholderConverter<SplitDockStation,SplitNode,Dockable>
Parameters:
dockable - some item whose placeholder is searched
Returns:
the placeholder, can be null