|
||||||||||
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.state.StateManager
bibliothek.gui.dock.common.intern.CStateManager
public class CStateManager
A manager that can change the extended-state of CDockable
s
Nested Class Summary |
---|
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.state.StateManager |
---|
StateManager.Location, StateManager.LocationConverter, StateManager.StateManagerSetting<B> |
Field Summary |
---|
Fields inherited from class bibliothek.gui.dock.facile.state.StateManager |
---|
EXTERNALIZED, ICON_MANAGER_KEY_EXTERNALIZE, ICON_MANAGER_KEY_MAXIMIZE, ICON_MANAGER_KEY_MINIMIZE, ICON_MANAGER_KEY_NORMALIZE, MAXIMIZED, MINIMIZED, NORMALIZED |
Constructor Summary | |
---|---|
CStateManager(CControlAccess control)
Creates a new manager |
Method Summary | |
---|---|
protected void |
added(Dockable dockable)
Called when a Dockable has been added to this manager. |
protected String[] |
availableModes(String current,
Dockable dockable)
Makes a list of all modes dockable can be going into. |
CDockable.ExtendedMode |
childsExtendedMode(DockStation station)
Finds out which mode a child of station would have. |
protected String |
convertMode(CDockable.ExtendedMode mode)
Converts mode into one of the strings
StateManager.EXTERNALIZED , StateManager.MAXIMIZED ,
StateManager.MINIMIZED or StateManager.NORMALIZED . |
protected CDockable.ExtendedMode |
convertMode(String mode)
Converts mode into one of the CDockable.ExtendedMode s. |
protected boolean |
createEntryDuringRead(String key)
Tells whether an entry for a missing Dockable should be created. |
void |
ensureValidLocation(CDockable dockable)
Ensures that dockable is in a valid location (a mode that
is enabled by dockable and in the correct working area,
perhaps changes the current location to ensure that. |
protected CStation |
getAreaOf(Dockable dockable)
Searches dockable and its parent for the first CStation
that is a working area. |
protected CContentArea |
getCenterOf(Dockable dockable)
Searches the CContentArea on which dockable is shown. |
protected DockStation |
getDefaultNormal(Dockable dockable)
Gets the DockStation which should be used as default normal
parent for dockable . |
DockAction |
getIngoingAction(String mode,
Dockable dockable)
Gets the action that is used to go into mode mode
and that is shown on dockable . |
CLocation |
getLocation(Dockable dockable)
Gets an element describing the location of dockable as
good as possible. |
CLocation |
getLocation(Dockable dockable,
CDockable.ExtendedMode mode)
Assuming that dockable is currently not in mode mode ,
then this method searches for the previously stored location of dockable . |
CMaximizeBehavior |
getMaximizeBehavior()
Gets the currently used maximize-behavior. |
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. |
CDockable.ExtendedMode |
getMode(Dockable dockable)
Gets the mode dockable is currently into. |
protected boolean |
isValidNormalized(Dockable dockable)
Tells whether the element dockable is on a valid normalized
area or not. |
protected void |
modeChanged(Dockable dockable,
String oldMode,
String newMode)
Called when the mode of a known dockable has been
changed. |
void |
normalizeAllWorkingAreaChildren()
Ensures that all CDockable s which have a working area as
parent, are in their preferred mode. |
protected boolean |
process(Dockable dockable,
KeyEvent event)
Invoked whenever a key is pressed, released or typed. |
void |
rebuild(Dockable dockable)
Called when the list of actions for dockable has to be
rebuild. |
protected void |
removed(Dockable dockable)
Called after a Dockable was removed from this managar. |
void |
setLocation(CommonDockable dockable,
CLocation location)
Tries to set the location of dockable . |
void |
setLocation(Dockable dockable,
CDockable.ExtendedMode mode,
CLocation location)
Sets the default location of dockable when going into
mode . |
void |
setMaximizeBehavior(CMaximizeBehavior maximizeBehavior)
Sets a new CMaximizeBehavior . |
void |
setMode(Dockable dockable,
CDockable.ExtendedMode mode)
Changes the mode of dockable . |
Methods inherited from class bibliothek.gui.dock.facile.state.StateManager |
---|
add, add, add, add, addMaximizingArea, childsMode, createSetting, currentLocation, currentMode, currentModeSharp, ensureNotHidden, ensureNothingMaximized, getDefaultMode, getMaximizeArea, getMaximizeArea, getMaximized, getMaximizingArea, getMaximizingAreas, getRootName, getSetting, getStation, init, isOnTransition, putMode, remove, removeMaximizingArea, setMaximizingArea, setMaximizingStation, setSetting, store, store, transition, transitionDuringRead |
Methods inherited from class bibliothek.gui.dock.support.action.ModeTransitionManager |
---|
add, addEmpty, getDockables, getIngoingAction, getName, getOutgoingAction, getOutgoingAction, getProperties, getSource, goIn, goOut, history, previousMode, put, putIngoingAction, putMode, putOutgoingAction, react, read, rebuildAll, reduceToEmpty, remove, removeEmpty, setMode, setProperties, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CStateManager(CControlAccess control)
control
- internal access to the CControl
that uses this managerMethod Detail |
---|
protected Dockable getMaximizingElement(Dockable dockable)
StateManager
dockable
is maximized.
getMaximizingElement
in class StateManager
dockable
- some element, not null
dockable
itself, not null
protected Dockable getMaximizingElement(Dockable old, Dockable dockable)
StateManager
old
is currently
maximized, and dockable
is or will not be maximized.
getMaximizingElement
in class StateManager
old
- some elementdockable
- some element, might be old
dockable
is
no longer maximized, can be null
protected void added(Dockable dockable)
ModeTransitionManager
Dockable
has been added to this manager.
added
in class ModeTransitionManager<StateManager.Location>
dockable
- the new dockableprotected void removed(Dockable dockable)
ModeTransitionManager
Dockable
was removed from this managar.
removed
in class ModeTransitionManager<StateManager.Location>
dockable
- the element that was removedprotected boolean createEntryDuringRead(String key)
ModeTransitionManager
Dockable
should be created.
This will result in a call to ModeTransitionManager.addEmpty(String)
during
ModeTransitionManager.setSetting(ModeTransitionSetting)
.
The default implementation returns always false
.
createEntryDuringRead
in class ModeTransitionManager<StateManager.Location>
key
- the key for which to create a new entry
true
if an entry should be createdpublic void setMaximizeBehavior(CMaximizeBehavior maximizeBehavior)
CMaximizeBehavior
. The behavior decides what happens
when the user maximizes or un-maximizes a CDockable
.
maximizeBehavior
- the new behavior
NullPointerException
- if maximizeBehavior
is null
public CMaximizeBehavior getMaximizeBehavior()
setMaximizeBehavior(CMaximizeBehavior)
public void setLocation(Dockable dockable, CDockable.ExtendedMode mode, CLocation location)
dockable
when going into
mode
. The properties set here will be overridden
as soon as the user drags dockable
to another location (within
the same mode) or dockable
is removed permanently.dockable
is already in
mode
. There is also no effect if dockable
has not been registered at the CStateManager
.location
and mode
belong to each other.
dockable
- the element whose location will be setmode
- the mode for which the location is to be setlocation
- the new location
IllegalArgumentException
- if either argument is null
or
if CLocation.findRoot()
or CLocation.findProperty()
returns
null
public CLocation getLocation(Dockable dockable, CDockable.ExtendedMode mode)
dockable
is currently not in mode mode
,
then this method searches for the previously stored location of dockable
.
Note that this method can't tell where dockable
would be
shown if it never was in that mode and the client never specified the
location.
dockable
- the dockable whose location is searchedmode
- the mode which might be taken by dockable
null
IllegalArgumentException
- if any argument is null
public void setMode(Dockable dockable, CDockable.ExtendedMode mode)
dockable
.
dockable
- an element whose mode will be changedmode
- the new modepublic CDockable.ExtendedMode getMode(Dockable dockable)
dockable
is currently into.
dockable
- the questioned element
dockable
public CDockable.ExtendedMode childsExtendedMode(DockStation station)
station
would have.
station
- the station
null
if the station is unknownpublic void setLocation(CommonDockable dockable, CLocation location)
dockable
.
dockable
- the element to movelocation
- the new location of dockable
protected String convertMode(CDockable.ExtendedMode mode)
mode
into one of the strings
StateManager.EXTERNALIZED
, StateManager.MAXIMIZED
,
StateManager.MINIMIZED
or StateManager.NORMALIZED
.
mode
- the mode, not null
protected CDockable.ExtendedMode convertMode(String mode)
mode
into one of the CDockable.ExtendedMode
s.
mode
- StateManager.EXTERNALIZED
, StateManager.MAXIMIZED
,
StateManager.MINIMIZED
or StateManager.NORMALIZED
.
CDockable.ExtendedMode
public CLocation getLocation(Dockable dockable)
dockable
as
good as possible.
dockable
- the element whose location should be searched
null
if no location was foundprotected CStation getAreaOf(Dockable dockable)
dockable
and its parent for the first CStation
that is a working area.
dockable
- the element whose working area is searched
null
protected boolean isValidNormalized(Dockable dockable)
StateManager
dockable
is on a valid normalized
area or not.
isValidNormalized
in class StateManager
dockable
- the element to check
true
if dockable
can remain at the
location that it currently hasprotected CContentArea getCenterOf(Dockable dockable)
CContentArea
on which dockable
is shown.
dockable
- the element whose center is searched
null
protected String[] availableModes(String current, Dockable dockable)
ModeTransitionManager
dockable
can be going into.
availableModes
in class StateManager
current
- the mode dockable
is currently indockable
- the element whose available modes are searched
public void ensureValidLocation(CDockable dockable)
dockable
is in a valid location (a mode that
is enabled by dockable
and in the correct working area,
perhaps changes the current location to ensure that.
dockable
- the element which might not be in a valid locationpublic void normalizeAllWorkingAreaChildren()
CDockable
s which have a working area as
parent, are in their preferred mode.
protected void modeChanged(Dockable dockable, String oldMode, String newMode)
ModeTransitionManager
dockable
has been
changed. This method is intended to be overriden and does not do
anything in its basic version.
modeChanged
in class ModeTransitionManager<StateManager.Location>
dockable
- the element whose mode changedoldMode
- the mode before the changenewMode
- the mode after the changeprotected DockStation getDefaultNormal(Dockable dockable)
StateManager
DockStation
which should be used as default normal
parent for dockable
.
getDefaultNormal
in class StateManager
dockable
- some Dockable
dockable
or null
public DockAction getIngoingAction(String mode, Dockable dockable)
ModeTransitionManager
mode
and that is shown on dockable
.
getIngoingAction
in class ModeTransitionManager<StateManager.Location>
mode
- the mode whose ingoing action is searcheddockable
- the element for which the action will be used
null
public void rebuild(Dockable dockable)
ModeTransitionManager
dockable
has to be
rebuild.
rebuild
in class ModeTransitionManager<StateManager.Location>
dockable
- the element whose actions are searchedprotected boolean process(Dockable dockable, KeyEvent event)
dockable
- the element to which the event belongsevent
- the event
true
if the event has been processed, false
if the event was not used up.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |