bibliothek.gui.dock.facile.mode
Interface LocationMode

All Superinterfaces:
Mode<Location>
All Known Subinterfaces:
CLocationMode
All Known Implementing Classes:
AbstractLocationMode, CExternalizedMode, CMaximizedMode, CMinimizedMode, CNormalMode, DefaultLocationMode, ExternalizedMode, MaximizedMode, MinimizedMode, NormalMode

public interface LocationMode
extends Mode<Location>

A Mode that is used by the LocationModeManager. A LocationMode represents a state Dockables are in depending on their current location in the tree of DockStations and Dockables. Since DockStations may be nested, most algorithms working with them have to be recursive. Some of the methods of LocationMode have a slightly different semantic than specified in the Mode interface.


Method Summary
 void addLocationModeListener(LocationModeListener listener)
          Adds a listener to this mode.
 void ensureNotHidden(Dockable dockable)
          Ensures that no Dockable that has this mode hides dockable.
 ExtendedMode getExtendedMode()
          Gets the unique identifier of this mode.
 LocationModeManager<?> getManager()
          Gets the manager which currently works with this mode.
 DockStation getRepresentation(String uniqueId)
          Gets the one DockStation that is known with the root-id uniqueId.
 boolean isCurrentMode(Dockable dockable)
          If this method is not able to clearly find out whether dockable has this mode, it returns false.
 boolean isRepresenting(DockStation station)
          Tells whether this mode knows station and represents the mode children of station are in.
 void removeLocationModeListener(LocationModeListener listener)
          Removes listener from this mode.
 void setController(DockController controller)
          Connects this mode with a controller.
 void setManager(LocationModeManager<?> manager)
          Sets the manager which is using this mode.
 boolean shouldAutoFocus()
          Tells the LocationModeManager whether the focus should be transfered to a Dockable that has this mode.
 
Methods inherited from interface bibliothek.gui.dock.support.mode.Mode
apply, current, getActionsFor, getSettingFactory, getUniqueIdentifier, isDefaultMode, readSetting, writeSetting
 

Method Detail

setManager

void setManager(LocationModeManager<?> manager)
Sets the manager which is using this mode.

Parameters:
manager - the manager or null
Throws:
IllegalStateException - if manager is not null and another manager is already set

setController

void setController(DockController controller)
Connects this mode with a controller. It is up to the mode to add or remove listeners if necessary. This mode should also forward the controller to its ModeAreas.

Parameters:
controller - the new controller or null

getManager

LocationModeManager<?> getManager()
Gets the manager which currently works with this mode.

Returns:
the owner or null

isCurrentMode

boolean isCurrentMode(Dockable dockable)
If this method is not able to clearly find out whether dockable has this mode, it returns false. The LocationModeManager will ask again with the parent station of dockable.

Specified by:
isCurrentMode in interface Mode<Location>
Parameters:
dockable - some dockable, not null
Returns:
whether dockable is in this mode

isRepresenting

boolean isRepresenting(DockStation station)
Tells whether this mode knows station and represents the mode children of station are in.

Parameters:
station - the station which is to be tested
Returns:
whether this mode is represented by station

getRepresentation

DockStation getRepresentation(String uniqueId)
Gets the one DockStation that is known with the root-id uniqueId. The uniqueId is the same id as used returned by Location.getRoot() of Locations issued by this mode.

Parameters:
uniqueId - the id of some station
Returns:
the station or null

addLocationModeListener

void addLocationModeListener(LocationModeListener listener)
Adds a listener to this mode. The listener is to be called if apply starts or finishes.

Parameters:
listener - the new listener

removeLocationModeListener

void removeLocationModeListener(LocationModeListener listener)
Removes listener from this mode.

Parameters:
listener - the listener to remove

getExtendedMode

ExtendedMode getExtendedMode()
Gets the unique identifier of this mode.

Returns:
the unique identifier

ensureNotHidden

void ensureNotHidden(Dockable dockable)
Ensures that no Dockable that has this mode hides dockable. Note that dockable may or may not be in this mode.

Parameters:
dockable - the element which must not be hidden

shouldAutoFocus

boolean shouldAutoFocus()
Tells the LocationModeManager whether the focus should be transfered to a Dockable that has this mode.

Returns:
whether auto-focus should be enabled or not