bibliothek.gui.dock.common.perspective.mode
Class AbstractModePerspective<A extends CModeAreaPerspective>

java.lang.Object
  extended by bibliothek.gui.dock.common.perspective.mode.AbstractModePerspective<A>
Type Parameters:
A - the kind of CModeAreaPerspective that can be registered
All Implemented Interfaces:
LocationModePerspective
Direct Known Subclasses:
CExternalizedModePerspective, CMaximizedModePerspective, CMinimizedModePerspective, CNormalModePerspective

public abstract class AbstractModePerspective<A extends CModeAreaPerspective>
extends Object
implements LocationModePerspective

This abstract implementation of a LocationModeManagerPerspective just uses a collection of LocationModePerspectives to find out whether the mode of a CDockablePerspective matches this mode or not.

Author:
Benjamin Sigg

Constructor Summary
AbstractModePerspective()
           
 
Method Summary
 void add(A location)
          Adds location to the list of possible parents.
 A getArea(int index)
          Gets the index'th area of this AbstractModePerspective
 int getAreaCount()
          Gets the number of CModeAreaPerspectives stored in this object.
 CPerspective getPerspective()
          Gets the perspective that uses this mode.
 boolean isCurrentMode(PerspectiveDockable dockable)
          Checks whether dockable currently is in this mode.
 boolean isCurrentMode(String root, DockableProperty location)
          Checks whether the dockable at location root/location should be in the mode represented by this.
 void readSetting(ModeSetting<Location> setting)
          Reads settings belonging to this mode from setting.
 void remove(A location)
          Removes location from this perspective.
 void setPerspective(CPerspective perspective)
          Informs this mode of what perspective is going to use it.
 void writeSetting(ModeSetting<Location> setting)
          Writes settings that belong to this mode to setting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.common.perspective.mode.LocationModePerspective
getIdentifier
 

Constructor Detail

AbstractModePerspective

public AbstractModePerspective()
Method Detail

setPerspective

public void setPerspective(CPerspective perspective)
Description copied from interface: LocationModePerspective
Informs this mode of what perspective is going to use it.

Specified by:
setPerspective in interface LocationModePerspective
Parameters:
perspective - the perspective that uses this mode

getPerspective

public CPerspective getPerspective()
Gets the perspective that uses this mode.

Returns:
the perspective

add

public void add(A location)
Adds location to the list of possible parents.

Parameters:
location - the new location, not null

remove

public void remove(A location)
Removes location from this perspective.

Parameters:
location - the station to remove

getAreaCount

public int getAreaCount()
Gets the number of CModeAreaPerspectives stored in this object.

Returns:
the number of areas

getArea

public A getArea(int index)
Gets the index'th area of this AbstractModePerspective

Parameters:
index - the index of some area
Returns:
the area

isCurrentMode

public boolean isCurrentMode(PerspectiveDockable dockable)
Description copied from interface: LocationModePerspective
Checks whether dockable currently is in this mode.

Specified by:
isCurrentMode in interface LocationModePerspective
Parameters:
dockable - the element whose mode is searched
Returns:
true if this mode describes the situation of dockable

isCurrentMode

public boolean isCurrentMode(String root,
                             DockableProperty location)
Description copied from interface: LocationModePerspective
Checks whether the dockable at location root/location should be in the mode represented by this.

Specified by:
isCurrentMode in interface LocationModePerspective
Parameters:
root - the unique identifer of the root DockStation
location - the location on the root station
Returns:
whether a dockable in this mode can have the described location

readSetting

public void readSetting(ModeSetting<Location> setting)
Description copied from interface: LocationModePerspective
Reads settings belonging to this mode from setting.

Specified by:
readSetting in interface LocationModePerspective
Parameters:
setting - some settings

writeSetting

public void writeSetting(ModeSetting<Location> setting)
Description copied from interface: LocationModePerspective
Writes settings that belong to this mode to setting.

Specified by:
writeSetting in interface LocationModePerspective
Parameters:
setting - the settings to write