bibliothek.gui.dock.facile.mode
Class NormalMode<M extends NormalModeArea>

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.AbstractLocationMode<A>
      extended by bibliothek.gui.dock.facile.mode.DefaultLocationMode<M>
          extended by bibliothek.gui.dock.facile.mode.NormalMode<M>
All Implemented Interfaces:
LocationMode, Mode<Location>, Iterable<M>
Direct Known Subclasses:
CNormalMode

public class NormalMode<M extends NormalModeArea>
extends DefaultLocationMode<M>

CDockables are in NormalMode if they are a child of a NormalModeArea.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.mode.AbstractLocationMode
AbstractLocationMode.DockableHandle
 
Field Summary
static String ICON_IDENTIFIER
          the key used for the IconManager to read the Icon for the "normalize"-action
static Path IDENTIFIER
          The unique identifier of this mode
 
Constructor Summary
protected NormalMode()
          Empty default constructor.
  NormalMode(CControl control)
          Creates a new normal mode.
  NormalMode(DockController controller)
          Creates a new mode.
 
Method Summary
 void ensureNotHidden(Dockable dockable)
          Ensures that no Dockable that has this mode hides dockable.
 ExtendedMode getExtendedMode()
          Gets the unique identifier of this mode.
 ModeSettingFactory<Location> getSettingFactory()
          Gets a factory for creating new ModeSettings.
 Path getUniqueIdentifier()
          Gets a unique identifier, only this Mode must have this identifier.
 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.
 boolean isDefaultMode(Dockable dockable)
          Checks whether this mode is a default mode of dockable.
 void readSetting(ModeSetting<Location> setting)
          Sets the properties of this mode.
 void writeSetting(ModeSetting<Location> setting)
          Gets the current properties of this mode in an independent way.
 
Methods inherited from class bibliothek.gui.dock.facile.mode.DefaultLocationMode
current, runApply
 
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
 

Field Detail

IDENTIFIER

public static final Path IDENTIFIER
The unique identifier of this mode


ICON_IDENTIFIER

public static final String ICON_IDENTIFIER
the key used for the IconManager to read the Icon for the "normalize"-action

See Also:
Constant Field Values
Constructor Detail

NormalMode

protected NormalMode()
Empty default constructor. Subclasses should call AbstractLocationMode.setActionProvider(LocationModeActionProvider) to complete initialization of this mode.


NormalMode

public NormalMode(CControl control)
Creates a new normal mode.

Parameters:
control - the owner of this mode

NormalMode

public NormalMode(DockController controller)
Creates a new mode.

Parameters:
controller - the owner of this mode
Method Detail

getUniqueIdentifier

public Path getUniqueIdentifier()
Description copied from interface: Mode
Gets a unique identifier, only this Mode must have this identifier. Identifiers with the first segment being "dock" are reserved for this framework, clients may choose any other identifiers.

Returns:
the identifier, not null, should contain at least one segment.

getExtendedMode

public ExtendedMode getExtendedMode()
Description copied from interface: LocationMode
Gets the unique identifier of this mode.

Returns:
the unique identifier

isCurrentMode

public boolean isCurrentMode(Dockable dockable)
Description copied from class: DefaultLocationMode
This default implementation calls ModeArea.isChild(Dockable) on each area of this mode and returns true if at least one area returns true.

Specified by:
isCurrentMode in interface LocationMode
Specified by:
isCurrentMode in interface Mode<Location>
Overrides:
isCurrentMode in class DefaultLocationMode<M extends NormalModeArea>
Parameters:
dockable - some dockable, not null
Returns:
whether dockable is in this mode

isDefaultMode

public boolean isDefaultMode(Dockable dockable)
Description copied from interface: Mode
Checks whether this mode is a default mode of dockable. A default mode is a mode that is choosen per default, if no other mode is selected. There should be only one default-mode per Dockable.

Parameters:
dockable - some dockable, not null
Returns:
whether this is a default mode

getSettingFactory

public ModeSettingFactory<Location> getSettingFactory()
Description copied from interface: Mode
Gets a factory for creating new ModeSettings.

Returns:
the factory, can be null

ensureNotHidden

public void ensureNotHidden(Dockable dockable)
Description copied from interface: LocationMode
Ensures that no Dockable that has this mode hides dockable. Note that dockable may or may not be in this mode.

Parameters:
dockable - the element which must not be hidden

writeSetting

public void writeSetting(ModeSetting<Location> setting)
Description copied from interface: Mode
Gets the current properties of this mode in an independent way.

Parameters:
setting - a ModeSetting with the same id as this Mode. This setting was created by a ModeSettingFactory with the same id as this Mode.

readSetting

public void readSetting(ModeSetting<Location> setting)
Description copied from interface: Mode
Sets the properties of this mode. This method will only be called with a ModeSetting that has been created by the current ModeSettingFactory

Parameters:
setting - the new set of properties, not null