bibliothek.gui.dock.station.split
Class SplitDockPerspective.Entry

java.lang.Object
  extended by bibliothek.gui.dock.station.split.SplitDockPerspective.Entry
Direct Known Subclasses:
SplitDockPerspective.Leaf, SplitDockPerspective.Node, SplitDockPerspective.Root
Enclosing class:
SplitDockPerspective

public abstract static class SplitDockPerspective.Entry
extends Object

An entry in a tree, either a node or a leaf.

Author:
Benjamin Sigg

Constructor Summary
SplitDockPerspective.Entry(Set<Path> placeholders, PlaceholderMap placeholderMap, long id)
          Create a new entry
 
Method Summary
 SplitDockPerspective.Leaf asLeaf()
          Returns this as leaf or null.
 SplitDockPerspective.Node asNode()
          Returns this as node or null.
 void delete()
          Removes this and all children from this SplitDockPerspective and collapses the tree.
 long getNodeId()
          Gets the unique id of this node.
 SplitDockPerspective.Entry getParent()
          Gets the parent of this entry, is null for the root entry.
 SplitDockPerspective getPerspective()
          Gets the owner of this node or leaf.
 PlaceholderMap getPlaceholderMap()
          Gets the placeholder information of a potential child DockStation.
 Set<Path> getPlaceholders()
          Gets all the placeholders that are associated with this entry.
 boolean isAnchestor(SplitDockPerspective.Entry anchestor)
          Tells whether anchestor is an anchestor of this entry.
 void replace(SplitDockPerspective.Entry next)
          Replaces this with next.
protected  void setParent(SplitDockPerspective.Entry parent)
          Sets the parent of this entry.
 void setPlaceholderMap(PlaceholderMap placeholderMap)
          Sets all the placeholders that are associated with this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitDockPerspective.Entry

public SplitDockPerspective.Entry(Set<Path> placeholders,
                                  PlaceholderMap placeholderMap,
                                  long id)
Create a new entry

Parameters:
placeholders - the placeholders associated with this node or leaf
placeholderMap - placeholder information of a child DockStation
id - the unique id of this node or -1
Method Detail

isAnchestor

public boolean isAnchestor(SplitDockPerspective.Entry anchestor)
Tells whether anchestor is an anchestor of this entry.

Parameters:
anchestor - the item to search
Returns:
true if anchestor is this or a parent of this

getPerspective

public SplitDockPerspective getPerspective()
Gets the owner of this node or leaf.

Returns:
the owner, can be null

delete

public void delete()
Removes this and all children from this SplitDockPerspective and collapses the tree.


replace

public void replace(SplitDockPerspective.Entry next)
Replaces this with next.

Parameters:
next - the element which replaces this

setParent

protected void setParent(SplitDockPerspective.Entry parent)
Sets the parent of this entry.

Parameters:
parent - the parent

getParent

public SplitDockPerspective.Entry getParent()
Gets the parent of this entry, is null for the root entry.

Returns:
the parent.

getNodeId

public long getNodeId()
Gets the unique id of this node.

Returns:
the unique id or -1

asLeaf

public SplitDockPerspective.Leaf asLeaf()
Returns this as leaf or null.

Returns:
this or null

asNode

public SplitDockPerspective.Node asNode()
Returns this as node or null.

Returns:
this or null

getPlaceholders

public Set<Path> getPlaceholders()
Gets all the placeholders that are associated with this entry.

Returns:
the placeholders

getPlaceholderMap

public PlaceholderMap getPlaceholderMap()
Gets the placeholder information of a potential child DockStation.

Returns:
the placeholder map, can be null

setPlaceholderMap

public void setPlaceholderMap(PlaceholderMap placeholderMap)
Sets all the placeholders that are associated with this entry.

Parameters:
placeholderMap - all the placeholders, can be null