|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.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 ModeAreas. 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 LocationModeListeners
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 Dockables which show actions
that are provided by the current LocationModeActionProviderpublic void setManager(LocationModeManager<?> manager)
LocationMode
setManager in interface LocationModemanager - the manager or nullpublic LocationModeManager<?> getManager()
getManager in interface LocationModenullpublic void setController(DockController controller)
LocationModeModeAreas.
setController in interface LocationModecontroller - the new controller or nullpublic DockController getController()
nullpublic void addLocationModeListener(LocationModeListener listener)
LocationModeapply starts or finishes.
addLocationModeListener in interface LocationModelistener - the new listenerpublic void removeLocationModeListener(LocationModeListener listener)
LocationModelistener from this mode.
removeLocationModeListener in interface LocationModelistener - the listener to removeprotected LocationModeListener[] listeners()
public void add(A area)
area - the new area, not nullpublic A remove(String key)
key from this
mode.
key - the identifier of the area
nullpublic 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
nullpublic DockStation getRepresentation(String uniqueId)
LocationModeDockStation 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.
getRepresentation in interface LocationModeuniqueId - the id of some station
nullpublic 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)
ModeDockActionSource 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 nullmode - the mode of dockable, not null
dockable, can be nullprotected boolean isModeAvailable(Dockable dockable)
dockable.
dockable - some element to check
true if this mode is availablepublic boolean isRepresenting(DockStation station)
LocationModestation and represents the mode
children of station are in.
isRepresenting in interface LocationModestation - the station which is to be tested
station
public void apply(Dockable dockable,
Location history,
AffectedSet set)
Modedockable.
apply in interface Mode<Location>dockable - the element whose mode becomes thishistory - 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 Dockables 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 LocationModeListeners
are informed. Applies this mode to dockable.
dockable - the element whose mode becomes thishistory - history information that was returned by this mode when calling
Mode.current(Dockable) the last time.set - this method has to store all Dockables 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 | |||||||||