bibliothek.gui.dock.station.split
Class SplitPerspectivePlaceholderConverter

java.lang.Object
  extended by bibliothek.gui.dock.station.split.AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
      extended by bibliothek.gui.dock.station.split.SplitPerspectivePlaceholderConverter

public class SplitPerspectivePlaceholderConverter
extends AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>

A helper class to read and write PlaceholderMap that are related to SplitDockPerspectives.

Author:
Benjamin Sigg

Constructor Summary
SplitPerspectivePlaceholderConverter(SplitDockPerspective station)
          Creates a new converter
 
Method Summary
protected  SplitDockTree<PerspectiveDockable> createTree()
          Creates a new SplitDockTree which will be used for AbstractSplitPlaceholderConverter.dropTree(Object, SplitDockTree).
protected  void dropTree(SplitDockPerspective station, SplitDockTree<PerspectiveDockable> tree)
          Updates station such that its layout looks as described by tree.
protected  double getDivider(SplitDockPerspective.Entry node)
          Gets the divider location of the intermediate node node.
protected  PerspectiveDockable getDockable(SplitDockPerspective.Entry leaf)
          Gets the dockable of the leaf node leaf.
protected  long getId(SplitDockPerspective.Entry node)
          Gets the unique identifier that was assigned to node.
protected  SplitDockPerspective.Entry getLeftChild(SplitDockPerspective.Entry node)
          Gets the left child of the intermediate node node.
protected  SplitDockStation.Orientation getOrientation(SplitDockPerspective.Entry node)
          Gets the orientation of the intermediate node node.
protected  Path getPlaceholderFor(PerspectiveDockable dockable)
          Gets a placeholder that is to be used for dockable.
protected  PlaceholderMap getPlaceholderMap(SplitDockPerspective.Entry node)
          Gets the PlaceholderMap which is associated with node.
protected  Path[] getPlaceholders(SplitDockPerspective.Entry node)
          Gets all placeholders that are associated with node.
protected  PlaceholderStrategy getPlaceholderStrategy(SplitDockPerspective station)
          Gets the PlaceholderStrategy that is used by station to filter its children.
protected  SplitDockPerspective.Entry getRightChild(SplitDockPerspective.Entry node)
          Gets the right child of the intermediate node node.
protected  SplitDockPerspective.Entry getRoot(SplitDockPerspective station)
          Gets the root node of the tree that describes the layout of station.
protected  SplitDockPerspective.Entry getRootChild(SplitDockPerspective.Entry root)
          Gets the child of the root node root.
protected  boolean isLeaf(SplitDockPerspective.Entry node)
          Tells whether node is a leaf node.
protected  boolean isNode(SplitDockPerspective.Entry node)
          Tells whether node is an intermediate node.
protected  boolean isPlaceholder(SplitDockPerspective.Entry node)
          Tells whether node is a placeholder node.
protected  boolean isRoot(SplitDockPerspective.Entry 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

SplitPerspectivePlaceholderConverter

public SplitPerspectivePlaceholderConverter(SplitDockPerspective station)
Creates a new converter

Parameters:
station - the perspective for which this converter is used
Method Detail

getRoot

protected SplitDockPerspective.Entry getRoot(SplitDockPerspective 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<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
station - the station whose root node is searched
Returns:
the root node

isRoot

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

Specified by:
isRoot in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node to check
Returns:
true if node is a root node

isNode

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

Specified by:
isNode in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node to check
Returns:
true if node is an intermediate node

isLeaf

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

Specified by:
isLeaf in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node to check
Returns:
true if node is a leaf node

isPlaceholder

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

Specified by:
isPlaceholder in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node to check
Returns:
true if node is a placeholder node

getRootChild

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

Specified by:
getRootChild in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
root - a root node
Returns:
the only child of root

getLeftChild

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

Specified by:
getLeftChild in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - an intermediate node
Returns:
the left child of node

getRightChild

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

Specified by:
getRightChild in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - an intermediate node
Returns:
the right child of node

getDivider

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

Specified by:
getDivider in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - an intermediate node
Returns:
the divider location of node

getOrientation

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

Specified by:
getOrientation in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - an intermediate node
Returns:
the orientation of node

getDockable

protected PerspectiveDockable getDockable(SplitDockPerspective.Entry leaf)
Description copied from class: AbstractSplitPlaceholderConverter
Gets the dockable of the leaf node leaf.

Specified by:
getDockable in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
leaf - a leaf node
Returns:
the dockable of leaf

getId

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

Specified by:
getId in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - some node whose id is searched
Returns:
the unique identifier

createTree

protected SplitDockTree<PerspectiveDockable> 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<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Returns:
the new tree, not null

dropTree

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

Specified by:
dropTree in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
station - the station whose layout gets updated
tree - the new layout

getPlaceholders

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

Specified by:
getPlaceholders in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node whose placeholders are searched
Returns:
the placeholders

getPlaceholderMap

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

Specified by:
getPlaceholderMap in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
node - the node whose PlaceholderMap is searched
Returns:
the map or null

getPlaceholderStrategy

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

Specified by:
getPlaceholderStrategy in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
station - the station whose PlaceholderStrategy is searched
Returns:
the strategy

getPlaceholderFor

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

Specified by:
getPlaceholderFor in class AbstractSplitPlaceholderConverter<SplitDockPerspective,SplitDockPerspective.Entry,PerspectiveDockable>
Parameters:
dockable - some item whose placeholder is searched
Returns:
the placeholder, can be null