|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.support.action.ModeTransitionManager<StateManager.Location>
bibliothek.gui.dock.facile.action.StateManager
public class StateManager
A manager that can minimize/normalize/maximize and externalize a
Dockable
.
FlapDockStation
SplitDockStation
, and
in fullscreen-modeScreenDockStation
Nested Class Summary | |
---|---|
static class |
StateManager.Location
Describes the location of a Dockable . |
static class |
StateManager.LocationConverter
A transformer to read or write StateManager.Location s. |
static class |
StateManager.StateManagerSetting<B>
A set of properties used to store the contents of a StateManager |
Field Summary | |
---|---|
static String |
EXTERNALIZED
key for the externalized mode |
static String |
ICON_MANAGER_KEY_EXTERNALIZE
the key used for the IconManager to read the Icon for the "externalize"-action |
static String |
ICON_MANAGER_KEY_MAXIMIZE
the key used for the IconManager to read the Icon for the "maximize"-action |
static String |
ICON_MANAGER_KEY_MINIMIZE
the key used for the IconManager to read the Icon for the "minimize"-action |
static String |
ICON_MANAGER_KEY_NORMALIZE
the key used for the IconManager to read the Icon for the "normalize"-action |
static String |
MAXIMIZED
key for the maximized mode |
static String |
MINIMIZED
key for the minimized mode |
static String |
NORMALIZED
key for the normalized mode |
Constructor Summary | |
---|---|
|
StateManager(DockController controller)
Creates a new manager. |
protected |
StateManager(DockController controller,
boolean init)
Creates a new manager. |
Method Summary | ||
---|---|---|
void |
add(String name,
FlapDockStation station)
Adds a station to which a Dockable can be minimized. |
|
void |
add(String name,
ScreenDockStation station)
Adds a station to which a Dockable can be externalized. |
|
void |
add(String name,
SplitDockStation station)
Adds a station to which a Dockable can be normalized
or maximized. |
|
protected String[] |
availableModes(String current,
Dockable dockable)
Makes a list of all modes dockable can be going into. |
|
protected String |
childsMode(DockStation station)
Guesses the mode a child of station would have if it is
dropped on station . |
|
protected
|
createSetting(ModeTransitionConverter<StateManager.Location,B> converter)
Creates a new, empty setting. |
|
protected StateManager.Location |
currentLocation(String mode,
Dockable dockable)
Creates the StateManager.Location describing the location of dockable . |
|
protected String |
currentMode(Dockable dockable)
Gets the mode dockable is currently into. |
|
protected String |
currentModeSharp(Dockable dockable)
Searches the current mode of dockable and returns
the mode. |
|
protected String |
getDefaultMode(Dockable dockable)
Gets the mode dockable should be go to if no other
mode is preferred. |
|
protected DockStation |
getDefaultNormal(Dockable dockable)
Gets the DockStation which should be used as default normal
parent for dockable . |
|
protected Dockable |
getMaximizingElement(Dockable dockable)
Gets the element which must be maximized when the user requests that dockable is maximized. |
|
protected Dockable |
getMaximizingElement(Dockable old,
Dockable dockable)
Gets the element which would be maximized if old is currently
maximized, and dockable is or will not be maximized. |
|
protected String |
getRootName(Dockable dockable)
Gets the name of the root of dockable . |
|
|
getSetting(ModeTransitionConverter<StateManager.Location,B> converter)
Gets the current set or properties. |
|
protected DockStation |
getStation(String name)
Gets the station that is registered under name . |
|
protected void |
init()
Initializes all the elements of this manager. |
|
boolean |
isOnTransition()
Tells whether this StateManager currently is executing a
transition. |
|
protected boolean |
isValidNormalized(Dockable dockable)
Tells whether the element dockable is on a valid normalized
area or not. |
|
protected void |
putMode(Dockable dockable)
Stores for each Dockable of the tree with the root
dockable the current mode. |
|
void |
remove(String name)
Removes the DockStation name from this manager. |
|
void |
setMaximizingStation(String name)
Sets the station which should be used for maximized Dockable s. |
|
void |
setSetting(ModeTransitionSetting<StateManager.Location,?> setting)
Sets all properties of this manager. |
|
protected void |
store(Dockable dockable)
Stores for each Dockable in the tree with the root dockable
the location associated to their current mode. |
|
protected void |
store(String mode,
Dockable dockable)
Stores the location of dockable under the key mode . |
|
protected void |
transition(String oldMode,
String newMode,
Dockable dockable)
Called when a Dockable has to change from one mode to another mode.Subclasses might use ModeTransitionManager.getProperties(String, Dockable) and
ModeTransitionManager.setProperties(String, Dockable, Object) to get or store
properties associated with the mode. |
|
protected void |
transitionDuringRead(String oldMode,
String newMode,
Dockable dockable)
Called while reading modes in ModeTransitionManager.setSetting(ModeTransitionSetting) . |
Methods inherited from class bibliothek.gui.dock.support.action.ModeTransitionManager |
---|
add, added, addEmpty, getDockables, getIngoingAction, getIngoingAction, getName, getOutgoingAction, getOutgoingAction, getProperties, getSource, goIn, goOut, history, previousMode, put, putIngoingAction, putMode, putOutgoingAction, react, read, rebuild, rebuildAll, reduceToEmpty, remove, removed, removeEmpty, setMode, setProperties, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String ICON_MANAGER_KEY_MINIMIZE
IconManager
to read the Icon
for the "minimize"-action
public static final String ICON_MANAGER_KEY_MAXIMIZE
IconManager
to read the Icon
for the "maximize"-action
public static final String ICON_MANAGER_KEY_NORMALIZE
IconManager
to read the Icon
for the "normalize"-action
public static final String ICON_MANAGER_KEY_EXTERNALIZE
IconManager
to read the Icon
for the "externalize"-action
public static final String MINIMIZED
public static final String MAXIMIZED
public static final String NORMALIZED
public static final String EXTERNALIZED
Constructor Detail |
---|
public StateManager(DockController controller)
controller
and adds this
as ActionGuard
to the controller
.
controller
- the controller which is observed by this manager.protected StateManager(DockController controller, boolean init)
controller
and adds this
as ActionGuard
to the controller
.
controller
- the controller which is observed by this manager.init
- whether to initialize all the element of this manager or not.
If false
, then init()
has to be called.Method Detail |
---|
protected void init()
DockController
, and setting text and icons of
the DockAction
s used by this ModeTransitionManager
.
public <B> ModeTransitionSetting<StateManager.Location,B> getSetting(ModeTransitionConverter<StateManager.Location,B> converter)
ModeTransitionManager
getSetting
in class ModeTransitionManager<StateManager.Location>
B
- the type of the internal representation of the propertiesconverter
- converts the properties into the internal representation
public void setSetting(ModeTransitionSetting<StateManager.Location,?> setting)
ModeTransitionManager
setting
will not be affected by this method.
setSetting
in class ModeTransitionManager<StateManager.Location>
setting
- the set of propertiesprotected <B> StateManager.StateManagerSetting<B> createSetting(ModeTransitionConverter<StateManager.Location,B> converter)
ModeTransitionManager
createSetting
in class ModeTransitionManager<StateManager.Location>
B
- the type of properties stored in the settingconverter
- used to convert properties of this manager to the properties of the setting
public void add(String name, SplitDockStation station)
Dockable
can be normalized
or maximized. If this is the first call to this method, then
station
becomes the default station for this kind or
operation.
name
- the name of the stationstation
- the new station.public void setMaximizingStation(String name)
Dockable
s.
Any currently maximized elements will be normalized.
name
- the unique identifier of the station that should become
the maximize areapublic void add(String name, FlapDockStation station)
Dockable
can be minimized.
If this is the first call to this method, then
station
becomes the default station for this kind or
operation.
name
- the name of the stationstation
- the new station.public void add(String name, ScreenDockStation station)
Dockable
can be externalized.
If this is the first call to this method, then
station
becomes the default station for this kind or
operation.
name
- the name of the stationstation
- the new station.public void remove(String name)
DockStation
name
from this manager. If
the station is a default-station, then this property is set to null
.
name
- the name of the station to removeprotected String[] availableModes(String current, Dockable dockable)
ModeTransitionManager
dockable
can be going into.
availableModes
in class ModeTransitionManager<StateManager.Location>
current
- the mode dockable
is currently indockable
- the element whose available modes are searched
protected String currentMode(Dockable dockable)
ModeTransitionManager
dockable
is currently into. This method
must also work if dockable
is not registered at this
ModeTransitionManager
.
currentMode
in class ModeTransitionManager<StateManager.Location>
dockable
- the element whose mode is searched
dockable
is, null
is not valid.protected String currentModeSharp(Dockable dockable)
dockable
and returns
the mode.
dockable
- the element whose mode is searched
null
if the mode could not be foundprotected String childsMode(DockStation station)
station
would have if it is
dropped on station
.
station
- some station
null
. The mode is one of
NORMALIZED
, MINIMIZED
or EXTERNALIZED
.
The mode MAXIMIZED
will not be considered.protected String getDefaultMode(Dockable dockable)
ModeTransitionManager
dockable
should be go to if no other
mode is preferred.
getDefaultMode
in class ModeTransitionManager<StateManager.Location>
dockable
- the element whose default mode is asked
public boolean isOnTransition()
StateManager
currently is executing a
transition.
true
if currently in a transition.transition(String, String, Dockable)
protected void transition(String oldMode, String newMode, Dockable dockable)
ModeTransitionManager
Dockable
has to change from one mode to another mode.ModeTransitionManager.getProperties(String, Dockable)
and
ModeTransitionManager.setProperties(String, Dockable, Object)
to get or store
properties associated with the mode.
transition
in class ModeTransitionManager<StateManager.Location>
oldMode
- the mode dockable
is currently innewMode
- the mode dockable
is going to bedockable
- the element that changes its modeprotected void transitionDuringRead(String oldMode, String newMode, Dockable dockable)
ModeTransitionManager
ModeTransitionManager.setSetting(ModeTransitionSetting)
.
Subclasses might change the mode according to newMode
.
transitionDuringRead
in class ModeTransitionManager<StateManager.Location>
oldMode
- the mode dockable
is currently innewMode
- the mode dockable
is going to bedockable
- the element that changes its modeprotected Dockable getMaximizingElement(Dockable dockable)
dockable
is maximized.
dockable
- some element, not null
dockable
itself, not null
protected Dockable getMaximizingElement(Dockable old, Dockable dockable)
old
is currently
maximized, and dockable
is or will not be maximized.
old
- some elementdockable
- some element, might be old
dockable
is
no longer maximized, can be null
protected boolean isValidNormalized(Dockable dockable)
dockable
is on a valid normalized
area or not.
dockable
- the element to check
true
if dockable
can remain at the
location that it currently hasprotected DockStation getDefaultNormal(Dockable dockable)
DockStation
which should be used as default normal
parent for dockable
.
dockable
- some Dockable
dockable
or null
protected void store(Dockable dockable)
Dockable
in the tree with the root dockable
the location associated to their current mode.
dockable
- a root of a treeprotected void store(String mode, Dockable dockable)
dockable
under the key mode
.
mode
- the mode dockable
is currently indockable
- the element whose location will be storedprotected void putMode(Dockable dockable)
Dockable
of the tree with the root
dockable
the current mode.
dockable
- the element whose mode should be storedprotected StateManager.Location currentLocation(String mode, Dockable dockable)
StateManager.Location
describing the location of dockable
.
mode
- the current modedockable
- the element whose StateManager.Location
is created
StateManager.Location
or null
protected String getRootName(Dockable dockable)
dockable
.
dockable
- the element whose station is searched
protected DockStation getStation(String name)
name
.
name
- the name of the station
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |