bibliothek.gui.dock.common.mode.station
Class CSplitDockStationHandle.Maximal

java.lang.Object
  extended by bibliothek.gui.dock.common.mode.station.CSplitDockStationHandle.Maximal
All Implemented Interfaces:
CMaximizedModeArea, CModeArea, MaximizedModeArea, ModeArea
Enclosing class:
CSplitDockStationHandle

protected class CSplitDockStationHandle.Maximal
extends Object
implements CMaximizedModeArea


Constructor Summary
protected CSplitDockStationHandle.Maximal()
           
 
Method Summary
 void addModeAreaListener(ModeAreaListener listener)
          Adds a listener to this area.
 boolean autoDefaultArea()
          Tells whether this ModeArea can automatically become the default area of some mode.
 CLocation getCLocation(Dockable dockable)
          Assuming dockable is a child of this area, returns the location of dockable.
 CLocation getCLocation(Dockable dockable, Location location)
          Assuming dockable would be at location location if it would be a child of this station, returns the CLocation that matches location.
 Dockable[] getMaximized()
          Gets the currently maximized elements.
 SplitDockStation getStation()
          Gets the station which is represented by this area.
 String getUniqueId()
          Gets a unique identifier for this area.
 LocationMode getUnmaximizedMode()
          Tells which mode would be the preferred mode for unmaximization.
 boolean isChild(Dockable dockable)
          Tells whether dockable is a direct child of this station.
 boolean isRepresenting(DockStation station)
          Tells whether this area is representing station.
 Runnable onApply(LocationModeEvent event)
          This method is called before the method apply is executed of a LocationMode that is not the owner of this area.
 Runnable onApply(LocationModeEvent event, Dockable replacement)
          This method is called before the method apply is executed of a LocationMode that is not the owner of this area.
 void prepareApply(Dockable dockable, AffectedSet affected)
           
 void prepareApply(Dockable dockable, Location history, AffectedSet set)
          This method is called by MaximizedMode just before the mode is applied to dockable.
 void removeModeAreaListener(ModeAreaListener listener)
          Removes a listener from this area.
 boolean respectWorkingAreas()
          Tells whether children of this area have to respect the settings for CWorkingAreas.
 void setController(DockController controller)
          Connects this area with a controller.
 void setMaximized(Dockable dockable, boolean maximized, Location location, AffectedSet set)
          Tells this parent to change the maximization state of dockable.
 void setMode(LocationMode mode)
          Informs this area about the mode that uses it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSplitDockStationHandle.Maximal

protected CSplitDockStationHandle.Maximal()
Method Detail

addModeAreaListener

public void addModeAreaListener(ModeAreaListener listener)
Description copied from interface: ModeArea
Adds a listener to this area.

Specified by:
addModeAreaListener in interface ModeArea
Parameters:
listener - the new listener

removeModeAreaListener

public void removeModeAreaListener(ModeAreaListener listener)
Description copied from interface: ModeArea
Removes a listener from this area.

Specified by:
removeModeAreaListener in interface ModeArea
Parameters:
listener - the listener to remove

setMode

public void setMode(LocationMode mode)
Description copied from interface: ModeArea
Informs this area about the mode that uses it.

Specified by:
setMode in interface ModeArea
Parameters:
mode - the owner of this area, can be null

setController

public void setController(DockController controller)
Description copied from interface: ModeArea
Connects this area with a controller. It's up to the area to add or remove listeners if necessary.

Specified by:
setController in interface ModeArea
Parameters:
controller - the controller or null

autoDefaultArea

public boolean autoDefaultArea()
Description copied from interface: ModeArea
Tells whether this ModeArea can automatically become the default area of some mode.

Specified by:
autoDefaultArea in interface ModeArea
Returns:
true if this can be a default area, false if not

getUnmaximizedMode

public LocationMode getUnmaximizedMode()
Description copied from interface: MaximizedModeArea
Tells which mode would be the preferred mode for unmaximization.

Specified by:
getUnmaximizedMode in interface MaximizedModeArea
Returns:
the preferred unmaximized mode, can be null

prepareApply

public void prepareApply(Dockable dockable,
                         AffectedSet affected)

prepareApply

public void prepareApply(Dockable dockable,
                         Location history,
                         AffectedSet set)
Description copied from interface: MaximizedModeArea
This method is called by MaximizedMode just before the mode is applied to dockable.

Specified by:
prepareApply in interface MaximizedModeArea
Parameters:
dockable - the new child of this area
history - future location of dockable
set - this method has to store all Dockables which might have changed their mode in the set.

onApply

public Runnable onApply(LocationModeEvent event)
Description copied from interface: MaximizedModeArea
This method is called before the method apply is executed of a LocationMode that is not the owner of this area. The element event.getDockable() may or may not be a child of this station. This method is called before MaximizedModeArea.onApply(LocationModeEvent, Dockable) is called.

Specified by:
onApply in interface MaximizedModeArea
Parameters:
event - detailed informaion about the event
Returns:
a piece of code executed once apply has finished its job

onApply

public Runnable onApply(LocationModeEvent event,
                        Dockable replacement)
Description copied from interface: MaximizedModeArea
This method is called before the method apply is executed of a LocationMode that is not the owner of this area. The element event.getDockable() is a direct or indirect child of this area and maximized. The MaximizedMode suggests to use replacement as direct child once the old element has been removed. This method must decide how this area reacts on the pending change, e.g. set its maximized dockable to null and later re-maximize. The result of this method is a Runnable which will be executed once the apply method is finished.
This method is called after MaximizedModeArea.onApply(LocationModeEvent) is called.

Specified by:
onApply in interface MaximizedModeArea
Parameters:
event - detailed information about the event
replacement - the suggested new maximized element
Returns:
a piece of code executed once apply has finished its job

getUniqueId

public String getUniqueId()
Description copied from interface: ModeArea
Gets a unique identifier for this area.

Specified by:
getUniqueId in interface ModeArea
Returns:
the unique identifier
See Also:
CStation.getUniqueId()

isChild

public boolean isChild(Dockable dockable)
Description copied from interface: ModeArea
Tells whether dockable is a direct child of this station.

Specified by:
isChild in interface ModeArea
Parameters:
dockable - some element
Returns:
true if and only if the parent of dockable is identical to this station

getStation

public SplitDockStation getStation()
Description copied from interface: ModeArea
Gets the station which is represented by this area.

Specified by:
getStation in interface ModeArea
Returns:
the station, not null

respectWorkingAreas

public boolean respectWorkingAreas()
Description copied from interface: CModeArea
Tells whether children of this area have to respect the settings for CWorkingAreas.

Specified by:
respectWorkingAreas in interface CModeArea
Returns:
whether the settings are to be respected

getMaximized

public Dockable[] getMaximized()
Description copied from interface: MaximizedModeArea
Gets the currently maximized elements.

Specified by:
getMaximized in interface MaximizedModeArea
Returns:
the currently maximized dockables, can be null or empty

setMaximized

public void setMaximized(Dockable dockable,
                         boolean maximized,
                         Location location,
                         AffectedSet set)
Description copied from interface: MaximizedModeArea
Tells this parent to change the maximization state of dockable. This area may unmaximize other Dockables if necessary.

Specified by:
setMaximized in interface MaximizedModeArea
Parameters:
dockable - the maximized element, null to indicate that no element should be maximized.
maximized - the new state of dockable
location - the expected location of dockable after this method completed, may be null
set - this method has to store all Dockables which might have changed their mode in the set.

isRepresenting

public boolean isRepresenting(DockStation station)
Description copied from interface: MaximizedModeArea
Tells whether this area is representing station. It is legitimate for an area to represent more than one or no station at all.

Specified by:
isRepresenting in interface MaximizedModeArea
Parameters:
station - some station
Returns:
true if this represents station

getCLocation

public CLocation getCLocation(Dockable dockable)
Description copied from interface: CModeArea
Assuming dockable is a child of this area, returns the location of dockable.

Specified by:
getCLocation in interface CModeArea
Parameters:
dockable - some child
Returns:
the location, null if not found

getCLocation

public CLocation getCLocation(Dockable dockable,
                              Location location)
Description copied from interface: CModeArea
Assuming dockable would be at location location if it would be a child of this station, returns the CLocation that matches location.

Specified by:
getCLocation in interface CModeArea
Parameters:
dockable - some element which may or may not be a child of this station
location - the location dockable would have if it would be a child of this station
Returns:
the location, null if not found