bibliothek.gui.dock.common.location
Class CBaseLocation

java.lang.Object
  extended by bibliothek.gui.dock.common.CLocation
      extended by bibliothek.gui.dock.common.location.CBaseLocation

public class CBaseLocation
extends CLocation

A location based on a CContentArea.

Author:
Benjamin Sigg

Constructor Summary
CBaseLocation()
           
CBaseLocation(CContentArea center)
           
 
Method Summary
 CLocation aside()
          Returns a CLocation that describes the location of an element that should be inserted next to this location.
 CLocation expandProperty(DockableProperty property, CLocationExpandStrategy strategy)
          Tries to create a location that resembles property.
 ExtendedMode findMode()
          Gets the mode this location represents.
 DockableProperty findProperty(DockableProperty successor)
          Gets a path describing this location in terms of the DockingFrames.
 String findRoot()
          Gets the name of the station this location belongs to.
 CContentArea getContentArea()
          Gets the contentarea to which this location relates.
 CLocation getParent()
          Gets the parent location of this location.
 CFlapIndexLocation minimalEast()
          Creates a location describing a minimized element at the right.
 CFlapIndexLocation minimalEast(int index)
          Creates a location describing a minimized element at the right.
 CFlapIndexLocation minimalNorth()
          Creates a location describing a minimized element at the top.
 CFlapIndexLocation minimalNorth(int index)
          Creates a location describing a minimized element at the top.
 CFlapIndexLocation minimalSouth()
          Creates a location describing a minimized element at the bottom.
 CFlapIndexLocation minimalSouth(int index)
          Creates a location describing a minimized element at the bottom.
 CFlapIndexLocation minimalWest()
          Creates a location describing a minimized element at the left.
 CFlapIndexLocation minimalWest(int index)
          Creates a location describing a minimized element at the left.
 CContentAreaCenterLocation normal()
          Gets a location that points to the center of the CContentArea.
 TreeLocationRoot normalEast(double size)
          Creates a location describing a normalized element at the east of the normalized-area.
 TreeLocationRoot normalNorth(double size)
          Creates a location describing a normalized element at the north of the normalized-area.
 CRectangleLocation normalRectangle(double x, double y, double width, double height)
          Creates a location describing a normalized element at a given location.
 TreeLocationRoot normalSouth(double size)
          Creates a location describing a normalized element at the south of the normalized-area.
 TreeLocationRoot normalWest(double size)
          Creates a location describing a normalized element at the west of the normalized-area.
 String toString()
           
 
Methods inherited from class bibliothek.gui.dock.common.CLocation
base, base, equals, expandProperty, external, findProperty, 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

CBaseLocation

public CBaseLocation(CContentArea center)

CBaseLocation

public CBaseLocation()
Method Detail

getContentArea

public CContentArea getContentArea()
Gets the contentarea to which this location relates.

Returns:
the center or null if the default center is meant.

getParent

public CLocation getParent()
Description copied from class: CLocation
Gets the parent location of this location. Some root-locations may never have a parent.

Specified by:
getParent in class CLocation
Returns:
the parent location, can be null

normal

public CContentAreaCenterLocation normal()
Gets a location that points to the center of the CContentArea.

Returns:
the location pointing to the center where normalized dockables are shown

normalRectangle

public CRectangleLocation normalRectangle(double x,
                                          double y,
                                          double width,
                                          double height)
Creates a location describing a normalized element at a given location. Note that the normalized area is seen as a rectangle of size 1/1.

Parameters:
x - the x-coordinate, a value between 0 and 1
y - the y-coordinate, a value between 0 and 1
width - the width, x + width should be less or equal to 1
height - the height, y + height should be less or equal to 1
Returns:
the new location

normalNorth

public TreeLocationRoot normalNorth(double size)
Creates a location describing a normalized element at the north of the normalized-area.

Parameters:
size - the relative size of the element, a value between 0 (no space) and 1 (all space).
Returns:
the new location

normalSouth

public TreeLocationRoot normalSouth(double size)
Creates a location describing a normalized element at the south of the normalized-area.

Parameters:
size - the relative size of the element, a value between 0 (no space) and 1 (all space).
Returns:
the new location

normalEast

public TreeLocationRoot normalEast(double size)
Creates a location describing a normalized element at the east of the normalized-area.

Parameters:
size - the relative size of the element, a value between 0 (no space) and 1 (all space).
Returns:
the new location

normalWest

public TreeLocationRoot normalWest(double size)
Creates a location describing a normalized element at the west of the normalized-area.

Parameters:
size - the relative size of the element, a value between 0 (no space) and 1 (all space).
Returns:
the new location

minimalNorth

public CFlapIndexLocation minimalNorth()
Creates a location describing a minimized element at the top.

Returns:
the new location

minimalNorth

public CFlapIndexLocation minimalNorth(int index)
Creates a location describing a minimized element at the top.

Parameters:
index - the location in the list of minimized elements
Returns:
the new location

minimalSouth

public CFlapIndexLocation minimalSouth()
Creates a location describing a minimized element at the bottom.

Returns:
the new location

minimalSouth

public CFlapIndexLocation minimalSouth(int index)
Creates a location describing a minimized element at the bottom.

Parameters:
index - the location in the list of minimized elements
Returns:
the new location

minimalEast

public CFlapIndexLocation minimalEast()
Creates a location describing a minimized element at the right.

Returns:
the new location

minimalEast

public CFlapIndexLocation minimalEast(int index)
Creates a location describing a minimized element at the right.

Parameters:
index - the location in the list of minimized elements
Returns:
the new location

minimalWest

public CFlapIndexLocation minimalWest()
Creates a location describing a minimized element at the left.

Returns:
the new location

minimalWest

public CFlapIndexLocation minimalWest(int index)
Creates a location describing a minimized element at the left.

Parameters:
index - the location in the list of minimized elements
Returns:
the new location

findProperty

public DockableProperty 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

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

expandProperty

public CLocation expandProperty(DockableProperty property,
                                CLocationExpandStrategy strategy)
Description copied from class: CLocation
Tries to create a location that resembles property.

Overrides:
expandProperty in class CLocation
Parameters:
property - some location
strategy - a strategy helping to convert the properties
Returns:
a location whose CLocation.findProperty() would create property again, or null in case that property can't be used

findRoot

public String findRoot()
Description copied from class: CLocation
Gets the name of the station this location belongs to. This can be the id of any CStation.

Specified by:
findRoot in class CLocation
Returns:
the name of the station or null if this location does not have enough information to find the root

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 String toString()
Overrides:
toString in class Object