Package bibliothek.gui.dock.facile.mode
Interface LocationMode
- All Known Subinterfaces:
CLocationMode
- All Known Implementing Classes:
AbstractLocationMode,CExternalizedMode,CMaximizedMode,CMinimizedMode,CNormalMode,DefaultLocationMode,ExternalizedMode,MaximizedMode,MinimizedMode,NormalMode
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
Modifier and TypeMethodDescriptionvoidaddLocationModeListener(LocationModeListener listener) Adds a listener to this mode.aside(AsideRequest request, Location location) CallsDockStation.aside(AsideRequest)on a station that matcheslocation.voidensureNotHidden(Dockable dockable) Ensures that noDockablethat has this mode hidesdockable.Gets the unique identifier of this mode.Gets the manager which currently works with this mode.getRepresentation(String uniqueId) Gets the oneDockStationthat is known with the root-iduniqueId.Gets all the unique identifiers that will yield a non-nullresult when callinggetRepresentation(String).booleanisCurrentMode(Dockable dockable) If this method is not able to clearly find out whetherdockablehas this mode, it returnsfalse.booleanisRepresenting(DockStation station) Tells whether this mode knowsstationand represents the mode children ofstationare in.voidRemoveslistenerfrom this mode.voidsetController(DockController controller) Connects this mode with a controller.voidsetManager(LocationModeManager<?> manager) Sets the manager which is using this mode.booleanTells theLocationModeManagerwhether the focus should be transferred to aDockablethat has this mode.Methods inherited from interface bibliothek.gui.dock.support.mode.Mode
apply, current, getActionsFor, getSettingFactory, getUniqueIdentifier, isDefaultMode, readSetting, writeSetting
-
Method Details
-
setManager
Sets the manager which is using this mode.- Parameters:
manager- the manager ornull- Throws:
IllegalStateException- ifmanageris notnulland another manager is already set
-
setController
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 itsModeAreas.- Parameters:
controller- the new controller ornull
-
aside
CallsDockStation.aside(AsideRequest)on a station that matcheslocation.- Parameters:
request- the request to forward to aDockStationor to processlocation- the source of the location whose neighbor is searched- Returns:
- the neighbor or a value of
nullif the request could not be processed
-
getManager
LocationModeManager<?> getManager()Gets the manager which currently works with this mode.- Returns:
- the owner or
null
-
isCurrentMode
If this method is not able to clearly find out whetherdockablehas this mode, it returnsfalse. TheLocationModeManagerwill ask again with the parent station ofdockable.- Specified by:
isCurrentModein interfaceMode<Location>- Parameters:
dockable- some dockable, notnull- Returns:
- whether
dockableis inthismode
-
isRepresenting
Tells whether this mode knowsstationand represents the mode children ofstationare in.- Parameters:
station- the station which is to be tested- Returns:
- whether this mode is represented by
station
-
getRepresentation
Gets the oneDockStationthat is known with the root-iduniqueId. TheuniqueIdis the same id as used returned byLocation.getRoot()ofLocations issued by this mode.- Parameters:
uniqueId- the id of some station- Returns:
- the station or
null
-
getRepresentationIds
Gets all the unique identifiers that will yield a non-nullresult when callinggetRepresentation(String).- Returns:
- the ids of all the available
DockStations, the result may not be modifiable
-
addLocationModeListener
Adds a listener to this mode. The listener is to be called ifapplystarts or finishes.- Parameters:
listener- the new listener
-
removeLocationModeListener
Removeslistenerfrom this mode.- Parameters:
listener- the listener to remove
-
getExtendedMode
ExtendedMode getExtendedMode()Gets the unique identifier of this mode.- Returns:
- the unique identifier
-
ensureNotHidden
Ensures that noDockablethat has this mode hidesdockable. Note thatdockablemay or may not be in this mode.- Parameters:
dockable- the element which must not be hidden
-
shouldAutoFocus
boolean shouldAutoFocus()Tells theLocationModeManagerwhether the focus should be transferred to aDockablethat has this mode.- Returns:
- whether auto-focus should be enabled or not
-