bibliothek.gui.dock.common.location
Class AbstractTreeLocation

java.lang.Object
  extended by bibliothek.gui.dock.common.CLocation
      extended by bibliothek.gui.dock.common.location.AbstractStackholdingLocation
          extended by bibliothek.gui.dock.common.location.AbstractTreeLocation
Direct Known Subclasses:
TreeLocationNode, TreeLocationRoot

public abstract class AbstractTreeLocation
extends AbstractStackholdingLocation

A location that is child of the "normalized"-area, and describing a turn in a path leading to the final element. A turn divides the basic rectangle along a vertical or horizontal line, and continues the search in one of the newly created, smaller rectangles.

Author:
Benjamin Sigg

Constructor Summary
AbstractTreeLocation(double size, Side side, long nodeId)
          Creates a new location.
 
Method Summary
 CLocation aside()
          Returns a CLocation that describes the location of an element that should be inserted next to this location.
 TreeLocationNode east(double size)
          Creates a new location which is based at the east side of this location.
 TreeLocationNode east(double size, long nodeId)
          Creates a new location which is based at the east side of this location.
 ExtendedMode findMode()
          Gets the mode this location represents.
protected abstract  SplitDockPathProperty findParentProperty()
          Asks the parent, or in the case of the root creates, the DockableProperty describing the this location.
 SplitDockPathProperty findProperty(DockableProperty successor)
          Gets a path describing this location in terms of the DockingFrames.
 long getNodeId()
          Gets the identifier of the node represented by this location.
 Side getSide()
          Given the rectangle yield by the parent-location, this property tells which part the rectangle yield by this location occupies.
 double getSize()
          Gets the size of this location.
 TreeLocationLeaf leaf(long leafId)
          Creates a new leaf of this path.
 TreeLocationNode north(double size)
          Creates a new location which is based at the north side of this location.
 TreeLocationNode north(double size, long nodeId)
          Creates a new location which is based at the north side of this location.
 TreeLocationNode south(double size)
          Creates a new location which is based at the south side of this location.
 TreeLocationNode south(double size, long nodeId)
          Creates a new location which is based at the south side of this location.
 java.lang.String toString()
           
 TreeLocationNode west(double size)
          Creates a new location which is based at the west side of this location.
 TreeLocationNode west(double size, long nodeId)
          Creates a new location which is based at the west side of this location.
 
Methods inherited from class bibliothek.gui.dock.common.location.AbstractStackholdingLocation
stack, stack
 
Methods inherited from class bibliothek.gui.dock.common.CLocation
base, base, equals, expandProperty, expandProperty, external, findProperty, findRoot, getParent, hashCode, maximized, maximized, maximized, maximized, minimized, minimized, normalized, working
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractTreeLocation

public AbstractTreeLocation(double size,
                            Side side,
                            long nodeId)
Creates a new location.

Parameters:
size - the size of this location, the parent-location is taken and the area of the rectangle that location yields multiplied by size gives the area of the rectangle yield by this location.
side - given the rectangle yield by the parent-location, this parameters tells which part the rectangle yield by this location occupies.
nodeId - a unique identifier for the node represented by this location, can be -1
Method Detail

getSide

public Side getSide()
Given the rectangle yield by the parent-location, this property tells which part the rectangle yield by this location occupies.

Returns:
the side

getSize

public double getSize()
Gets the size of this location. The parent-location is taken and the area of the rectangle that location yields multiplied by size gives the area of the rectangle yield by this location.

Returns:
the relative size

getNodeId

public long getNodeId()
Gets the identifier of the node represented by this location.

Returns:
the identifier or -1 is not set

north

public TreeLocationNode north(double size)
Creates a new location which is based at the north side of this location.

Parameters:
size - the relative size, a number between 0 and 1
Returns:
the new location

north

public TreeLocationNode north(double size,
                              long nodeId)
Creates a new location which is based at the north side of this location.

Parameters:
size - the relative size, a number between 0 and 1
nodeId - the unique identifier of the new node, can be -1
Returns:
the new location

south

public TreeLocationNode south(double size)
Creates a new location which is based at the south side of this location.

Parameters:
size - the relative size, a number between 0 and 1
Returns:
the new location

south

public TreeLocationNode south(double size,
                              long nodeId)
Creates a new location which is based at the south side of this location.

Parameters:
size - the relative size, a number between 0 and 1
nodeId - the unique identifier of the new node, can be -1
Returns:
the new location

east

public TreeLocationNode east(double size)
Creates a new location which is based at the east side of this location.

Parameters:
size - the relative size, a number between 0 and 1
Returns:
the new location

east

public TreeLocationNode east(double size,
                             long nodeId)
Creates a new location which is based at the east side of this location.

Parameters:
size - the relative size, a number between 0 and 1
nodeId - the unique identifier of the new node, can be -1
Returns:
the new location

west

public TreeLocationNode west(double size)
Creates a new location which is based at the west side of this location.

Parameters:
size - the relative size, a number between 0 and 1
Returns:
the new location

west

public TreeLocationNode west(double size,
                             long nodeId)
Creates a new location which is based at the west side of this location.

Parameters:
size - the relative size, a number between 0 and 1
nodeId - the unique identifier of the new node, can be -1
Returns:
the new location

leaf

public TreeLocationLeaf leaf(long leafId)
Creates a new leaf of this path.

Parameters:
leafId - the unique identifier of the leaf, can be -1
Returns:
the new leaf

findMode

public ExtendedMode findMode()
Description copied from class: CLocation
Gets the mode this location represents.

Specified by:
findMode in class CLocation
Returns:
the mode or null

findParentProperty

protected abstract SplitDockPathProperty findParentProperty()
Asks the parent, or in the case of the root creates, the DockableProperty describing the this location.

Returns:
the property

findProperty

public SplitDockPathProperty findProperty(DockableProperty successor)
Description copied from class: CLocation
Gets a path describing this location in terms of the DockingFrames.

Specified by:
findProperty in class CLocation
Parameters:
successor - the path of the elements above this location or null
Returns:
the path to this location or null, can also be successor

aside

public CLocation aside()
Description copied from class: CLocation
Returns a CLocation that describes the location of an element that should be inserted next to this location.

Specified by:
aside in class CLocation
Returns:
the new location

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object