|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.facile.mode.AbstractLocationMode<A>
A
- the values managed by this modepublic abstract class AbstractLocationMode<A extends ModeArea>
This abstract class offers various properties that may be useful for any implementation
of LocationMode
. It also allows to store a set of ModeArea
s. Basic methods
to verify and change the Mode
of a Dockable
are implemented too.
Nested Class Summary | |
---|---|
protected class |
AbstractLocationMode.DockableHandle
Meta information about a currently registered Dockable. |
Constructor Summary | |
---|---|
AbstractLocationMode()
|
Method Summary | |
---|---|
void |
add(A area)
Adds an area to this mode. |
void |
addLocationModeListener(LocationModeListener listener)
Adds a listener to this mode. |
void |
apply(Dockable dockable,
Location history,
AffectedSet set)
Applies this mode to dockable . |
protected AbstractLocationMode.DockableHandle |
createHandle(Dockable dockable)
Creates a new handle for dockable . |
A |
get(Dockable dockable)
Recursively searches through all stations of dockable
until a station is found that is registered at this mode. |
A |
get(DockStation station)
Recursively searches through all areas known to this mode until the mode is found that represents station . |
A |
get(String key)
Gets the area with the specified id. |
DockActionSource |
getActionsFor(Dockable dockable,
Mode<Location> mode)
Gets a DockActionSource which should be shown on dockable
which is currently in mode . |
DockController |
getController()
Gets the controller in whose realm this mode works. |
A |
getDefaultArea()
Gets the default area of this mode, can be null . |
LocationModeManager<?> |
getManager()
Gets the owner of this mode. |
DockStation |
getRepresentation(String uniqueId)
Gets the one DockStation that is known with the root-id uniqueId . |
protected boolean |
isModeAvailable(Dockable dockable)
Tells whether this mode is available for dockable . |
boolean |
isRepresenting(DockStation station)
Tells whether this mode knows station and represents the mode
children of station are in. |
Iterator<A> |
iterator()
|
protected LocationModeListener[] |
listeners()
Gets all the listeners that are currently registered at this mode. |
A |
remove(String key)
Removes the area with identifier key from this
mode. |
void |
removeLocationModeListener(LocationModeListener listener)
Removes listener from this mode. |
protected abstract void |
runApply(Dockable dockable,
Location history,
AffectedSet set)
Called by apply(Dockable, Location, AffectedSet) after the LocationModeListener s
are informed. |
void |
setActionProvider(LocationModeActionProvider actionProvider)
Sets the LocationModeActionProvider for this mode. |
void |
setController(DockController controller)
Connects this mode with a controller. |
void |
setDefaultArea(A defaultArea)
Sets the default area of this mode. |
void |
setManager(LocationModeManager<?> manager)
Sets the manager which is using this mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.facile.mode.LocationMode |
---|
ensureNotHidden, getExtendedMode, isCurrentMode |
Methods inherited from interface bibliothek.gui.dock.support.mode.Mode |
---|
current, getSettingFactory, getUniqueIdentifier, isDefaultMode, readSetting, writeSetting |
Constructor Detail |
---|
public AbstractLocationMode()
Method Detail |
---|
public void setActionProvider(LocationModeActionProvider actionProvider)
LocationModeActionProvider
for this mode.
actionProvider
- the provider, not null
IllegalArgumentException
- if actionProvider
is null
IllegalStateException
- if there are already Dockable
s which show actions
that are provided by the current LocationModeActionProvider
public void setManager(LocationModeManager<?> manager)
LocationMode
setManager
in interface LocationMode
manager
- the manager or null
public LocationModeManager<?> getManager()
getManager
in interface LocationMode
null
public void setController(DockController controller)
LocationMode
ModeArea
s.
setController
in interface LocationMode
controller
- the new controller or null
public DockController getController()
null
public void addLocationModeListener(LocationModeListener listener)
LocationMode
apply
starts or finishes.
addLocationModeListener
in interface LocationMode
listener
- the new listenerpublic void removeLocationModeListener(LocationModeListener listener)
LocationMode
listener
from this mode.
removeLocationModeListener
in interface LocationMode
listener
- the listener to removeprotected LocationModeListener[] listeners()
public void add(A area)
area
- the new area, not null
public A remove(String key)
key
from this
mode.
key
- the identifier of the area
null
public Iterator<A> iterator()
iterator
in interface Iterable<A extends ModeArea>
public void setDefaultArea(A defaultArea)
get(Dockable)
returns null
for some key.
defaultArea
- the default area, can be null
. Must be
registered using add(ModeArea)
first.public A getDefaultArea()
null
. The default area
is the oldest area that was added to this mode and whose property
ModeArea.autoDefaultArea()
is true
, or the one area set
through setDefaultArea(ModeArea)
.
public A get(String key)
key
- the name of the area
null
public DockStation getRepresentation(String uniqueId)
LocationMode
DockStation
that is known with the root-id uniqueId
.
The uniqueId
is the same id as used returned by Location.getRoot()
of Location
s issued by this mode.
getRepresentation
in interface LocationMode
uniqueId
- the id of some station
null
public A get(Dockable dockable)
dockable
until a station is found that is registered at this mode.
dockable
- the element whose root is searched
null
, never dockable
itselfpublic A get(DockStation station)
station
. If station
is a Dockable
that its parent station is searched too.
station
- the station whose area is to be found
ModeArea.getStation()
equals station
,
may be null
public DockActionSource getActionsFor(Dockable dockable, Mode<Location> mode)
Mode
DockActionSource
which should be shown on dockable
which is currently in mode
. This method will be called
every time when dockable
changes its mode.
getActionsFor
in interface Mode<Location>
dockable
- some element, not null
mode
- the mode of dockable
, not null
dockable
, can be null
protected boolean isModeAvailable(Dockable dockable)
dockable
.
dockable
- some element to check
true
if this mode is availablepublic boolean isRepresenting(DockStation station)
LocationMode
station
and represents the mode
children of station
are in.
isRepresenting
in interface LocationMode
station
- the station which is to be tested
station
public void apply(Dockable dockable, Location history, AffectedSet set)
Mode
dockable
.
apply
in interface Mode<Location>
dockable
- the element whose mode becomes this
history
- history information that was returned by this mode
on its last call to Mode.current(Dockable)
. May be null
if this mode was never applied or returns null
on Mode.current(Dockable)
.set
- this method has to store all Dockable
s which might have changed their
mode in the set.protected abstract void runApply(Dockable dockable, Location history, AffectedSet set)
apply(Dockable, Location, AffectedSet)
after the LocationModeListener
s
are informed. Applies this mode to dockable
.
dockable
- the element whose mode becomes this
history
- history information that was returned by this mode when calling
Mode.current(Dockable)
the last time.set
- this method has to store all Dockable
s which might have changed their
mode in the set.protected AbstractLocationMode.DockableHandle createHandle(Dockable dockable)
dockable
.
dockable
- the newly registered element
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |