bibliothek.gui.dock.common.perspective
Class CPerspective

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.CPerspective

public class CPerspective
extends java.lang.Object

A CPerspective is a lightweight, modifiable representation of all Dockables and DockStations handled by a CControl.
When using a CPerspective clients have to be aware of:

Author:
Benjamin Sigg

Constructor Summary
CPerspective(CControlAccess control)
          Creates a new perspective
 
Method Summary
 void addRoot(CStationPerspective station)
          Adds a new root station to this perspective.
 java.util.Iterator<PerspectiveElement> elements()
          Gets an iterator that will visit all the PerspectiveElements of this CPerspective.
 CContentPerspective getContentArea()
          Gets a representation of the default CContentArea.
 CContentPerspective getContentArea(java.lang.String id)
          Gets a representation of the CContentArea with identifier id.
 LocationModeManagerPerspective getLocationManager()
          Gets the representation of the CLocationModeManager, the representation is responsible for finding out what ExtendedMode and location a CDockablePerspective has.
 CStationPerspective getRoot(java.lang.String id)
          Gets the station which was registered with the unique identifier id.
 java.lang.String[] getRootKeys()
          Gets the names of all the stations that were registered as root station
 void shrink()
          Searches all occurances of a ShrinkablePerspectiveStation and calls shrink on them.
 Location storeLocation(CDockablePerspective dockable)
          Determines the current location of dockable and stores that location in a map using the ExtendedMode of the Location as key.
 void storeLocations()
          Stores the current location of all CDockablePerspectives currently known to this CPerspective.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CPerspective

public CPerspective(CControlAccess control)
Creates a new perspective

Parameters:
control - the owner of this perspective
Method Detail

getLocationManager

public LocationModeManagerPerspective getLocationManager()
Gets the representation of the CLocationModeManager, the representation is responsible for finding out what ExtendedMode and location a CDockablePerspective has.

Returns:
the location manager, not null

storeLocations

public void storeLocations()
Stores the current location of all CDockablePerspectives currently known to this CPerspective. The location is stored in the LocationHistory of each dockable.


storeLocation

public Location storeLocation(CDockablePerspective dockable)
Determines the current location of dockable and stores that location in a map using the ExtendedMode of the Location as key. If the user later clicks on one of the buttons like "minimize" or "externalize" this location information is read and applied.

Parameters:
dockable - the element whose location should be stored
Returns:
the location that was stored or null if the location of dockable could not be determined

addRoot

public void addRoot(CStationPerspective station)
Adds a new root station to this perspective. If a station with name id is already registered, then this station gets replaced.

Parameters:
station - the new station

getRoot

public CStationPerspective getRoot(java.lang.String id)
Gets the station which was registered with the unique identifier id.

Parameters:
id - some unique identifier
Returns:
the station associated with id, can be null

getRootKeys

public java.lang.String[] getRootKeys()
Gets the names of all the stations that were registered as root station

Returns:
the names, not null

getContentArea

public CContentPerspective getContentArea()
Gets a representation of the default CContentArea. If there are no stations for the perspective, then the missing stations are automatically added to this perspective.

Returns:
the area

getContentArea

public CContentPerspective getContentArea(java.lang.String id)
Gets a representation of the CContentArea with identifier id. If there are no stations for the perspective, then the missing stations are automatically added to this perspective.

Parameters:
id - the unique identifier of the area
Returns:
the area

shrink

public void shrink()
Searches all occurances of a ShrinkablePerspectiveStation and calls shrink on them.


elements

public java.util.Iterator<PerspectiveElement> elements()
Gets an iterator that will visit all the PerspectiveElements of this CPerspective. The iterator does not check whether this perspective is modified while it is in use.

Returns:
the iterator over all elements