bibliothek.gui.dock.facile.mode
Class DefaultLocationMode<A extends StationModeArea>
java.lang.Object
bibliothek.gui.dock.facile.mode.AbstractLocationMode<A>
bibliothek.gui.dock.facile.mode.DefaultLocationMode<A>
- Type Parameters:
A
- the areas that are managed by this mode
- All Implemented Interfaces:
- LocationMode, Mode<Location>, Iterable<A>
- Direct Known Subclasses:
- ExternalizedMode, MinimizedMode, NormalMode
public abstract class DefaultLocationMode<A extends StationModeArea>
- extends AbstractLocationMode<A>
Abstract implementation of a Mode
that works with Location
s. This
implementation offers a runApply(Dockable, Location, AffectedSet)
and
Mode.apply(Dockable, Object, AffectedSet)
method.
- Author:
- Benjamin Sigg
Methods inherited from class bibliothek.gui.dock.facile.mode.AbstractLocationMode |
add, addLocationModeListener, apply, aside, createHandle, get, get, get, get, getActionsFor, getController, getDefaultArea, getManager, getRepresentation, getRepresentationIds, isModeAvailable, isModeHidden, isRepresenting, iterator, listeners, remove, removeLocationModeListener, setActionProvider, setController, setDefaultArea, setManager, setShouldAutoFocus, shouldAutoFocus |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultLocationMode
public DefaultLocationMode()
current
public Location current(Dockable dockable)
- This default implementation just returns the location of
dockable
but does not change any properties.
- Parameters:
dockable
- the element
- Returns:
- history information that is needed when calling
Mode.apply(Dockable, Object, AffectedSet)
runApply
public boolean runApply(Dockable dockable,
Location history,
AffectedSet set)
- This default implementation uses the
DockStation.move(Dockable, DockableProperty)
and DockStation.drop(Dockable, DockableProperty)
methods to put
dockable
at its location.
- Specified by:
runApply
in class AbstractLocationMode<A extends StationModeArea>
- Parameters:
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.
- Returns:
true
if dockable
was moved, false
if the method failed
to set the location of dockable
for any reason
isCurrentMode
public boolean isCurrentMode(Dockable dockable)
- This default implementation calls
ModeArea.isChild(Dockable)
on each
area of this mode and returns true
if at least one area returns true
.
- Parameters:
dockable
- some dockable, not null
- Returns:
- whether
dockable
is in this
mode