bibliothek.gui.dock.common.perspective.mode
Class LocationModeManagerPerspective

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.mode.LocationModeManagerPerspective

public class LocationModeManagerPerspective
extends Object

Represents a CLocationModeManager and offers methods to find the current location and ExtendedMode of a CDockablePerspective.

Author:
Benjamin Sigg

Constructor Summary
LocationModeManagerPerspective(CPerspective perspective, CControlAccess control)
          Creates a new manager
 
Method Summary
 void addMode(LocationModePerspective mode)
          Adds mode to this manager.
 Location getLocation(CDockablePerspective dockable)
          Gets the current location of dockable.
 Location getLocation(PerspectiveDockable dockable)
          Gets the current location of dockable.
 LocationModePerspective getMode(ExtendedMode mode)
          Gets the location-mode with the identifier mode.
 ExtendedMode getMode(Path identifier)
          Gets the ExtendedMode whose identifier is equal to identifier.
 ExtendedMode getMode(PerspectiveDockable dockable)
          Gets the current mode of dockable.
 ExtendedMode getMode(String root, DockableProperty location)
          Gets the mode which could have a child in the given location.
 ExtendedMode[] getModes()
          Gets an array containing all the modes known to this manager.
 CStationPerspective getRoot(PerspectiveDockable dockable)
          Gets the first CStationPerspective that is a root station and that is a parent of dockable.
 void readModes(ModeSettings<Location,?> modes, CPerspective cperspective, CControlAccess control)
          Reads the contents of modes and applies it to the dockables of cperspective.
 ModeSettings<Location,Location> writeModes(CControlAccess control)
          Writes the contents of this LocationModeManagerPerspective into a new ModeSettings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationModeManagerPerspective

public LocationModeManagerPerspective(CPerspective perspective,
                                      CControlAccess control)
Creates a new manager

Parameters:
perspective - the owner of this manager, not null
control - the control which is wrapped by perspective
Method Detail

getMode

public ExtendedMode getMode(Path identifier)
Gets the ExtendedMode whose identifier is equal to identifier.

Parameters:
identifier - some identifier of a mode
Returns:
the mode or null if not found

addMode

public void addMode(LocationModePerspective mode)
Adds mode to this manager.

Parameters:
mode - the additional mode

getMode

public LocationModePerspective getMode(ExtendedMode mode)
Gets the location-mode with the identifier mode.

Parameters:
mode - the identifier
Returns:
the mode or null if not found

getModes

public ExtendedMode[] getModes()
Gets an array containing all the modes known to this manager.

Returns:
all the modes

getMode

public ExtendedMode getMode(PerspectiveDockable dockable)
Gets the current mode of dockable.

Parameters:
dockable - the element whose location is searched
Returns:
the mode of dockable or null if not found

getMode

public ExtendedMode getMode(String root,
                            DockableProperty location)
Gets the mode which could have a child in the given location.

Parameters:
root - the identifier of the root DockStation
location - the location of some dockable
Returns:
the matching mode or null if not found

getRoot

public CStationPerspective getRoot(PerspectiveDockable dockable)
Gets the first CStationPerspective that is a root station and that is a parent of dockable.

Parameters:
dockable - some element whose root-station is searched
Returns:
the root-station or null if not found

getLocation

public Location getLocation(CDockablePerspective dockable)
Gets the current location of dockable.

Parameters:
dockable - the element whose location is searched
Returns:
the location or null if not found

getLocation

public Location getLocation(PerspectiveDockable dockable)
Gets the current location of dockable.

Parameters:
dockable - the element whose location is searched
Returns:
the location or null if not found

writeModes

public ModeSettings<Location,Location> writeModes(CControlAccess control)
Writes the contents of this LocationModeManagerPerspective into a new ModeSettings.

Parameters:
control - access to factories that may be used for writing the contents
Returns:
the contents of this object

readModes

public void readModes(ModeSettings<Location,?> modes,
                      CPerspective cperspective,
                      CControlAccess control)
Reads the contents of modes and applies it to the dockables of cperspective.

Parameters:
modes - the settings to read
cperspective - the perspective for which to read the setting
control - the control associated with cperspective