bibliothek.gui.dock.facile.mode
Class DefaultLocationMode<A extends StationModeArea>

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.AbstractLocationMode<A>
      extended by 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 Locations. This implementation offers a runApply(Dockable, Location, AffectedSet) and Mode.apply(Dockable, Object, AffectedSet) method.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.mode.AbstractLocationMode
AbstractLocationMode.DockableHandle
 
Constructor Summary
DefaultLocationMode()
           
 
Method Summary
 Location current(Dockable dockable)
          This default implementation just returns the location of dockable but does not change any properties.
 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.
 void 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.
 
Methods inherited from class bibliothek.gui.dock.facile.mode.AbstractLocationMode
add, addLocationModeListener, apply, createHandle, get, get, get, getActionsFor, getController, getDefaultArea, getManager, getRepresentation, isModeAvailable, isRepresenting, iterator, listeners, remove, removeLocationModeListener, setActionProvider, setController, setDefaultArea, setManager
 
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
 
Methods inherited from interface bibliothek.gui.dock.support.mode.Mode
getSettingFactory, getUniqueIdentifier, isDefaultMode, readSetting, writeSetting
 

Constructor Detail

DefaultLocationMode

public DefaultLocationMode()
Method Detail

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 void 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 Dockables which might have changed their mode in the set.

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