Package bibliothek.gui.dock.facile.mode
Class ExternalizedMode<M extends ExternalizedModeArea>
java.lang.Object
bibliothek.gui.dock.facile.mode.AbstractLocationMode<A>
bibliothek.gui.dock.facile.mode.DefaultLocationMode<M>
bibliothek.gui.dock.facile.mode.ExternalizedMode<M>
- Type Parameters:
M- the areas that are managed by this mode
- All Implemented Interfaces:
LocationMode,Mode<Location>,Iterable<M>
- Direct Known Subclasses:
CExternalizedMode
Represents a mode in which dockables are freely floating on the screen.
- Author:
- Benjamin Sigg
-
Nested Class Summary
Nested classes/interfaces inherited from class bibliothek.gui.dock.facile.mode.AbstractLocationMode
AbstractLocationMode.DockableHandle -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringthe key used for theIconManagerto read theIconfor the "externalize"-actionstatic final Paththe unique identifier of this mode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty default constructor.ExternalizedMode(CControl control) Creates a new mode.ExternalizedMode(DockController controller) Creates a new mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidensureNotHidden(Dockable dockable) Ensures that noDockablethat has this mode hidesdockable.Gets the current implementation of some algorithms of this mode.Gets the unique identifier of this mode.Gets a factory for creating newModeSettings.Gets a unique identifier, only thisModemust have this identifier.booleanisDefaultMode(Dockable dockable) Checks whether this mode is a default mode ofdockable.voidreadSetting(ModeSetting<Location> setting) Sets the properties of this mode.booleanrunApply(Dockable dockable, Location history, AffectedSet set) This default implementation uses theDockStation.move(Dockable, DockableProperty)andDockStation.drop(Dockable, DockableProperty)methods to putdockableat its location.voidsetBehavior(ExternalizedModeBehavior behavior) Tells thisExternalizedModehow some algorithms are implemented.voidwriteSetting(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, isCurrentModeMethods 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, shouldAutoFocusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
IDENTIFIER
the unique identifier of this mode -
ICON_IDENTIFIER
the key used for theIconManagerto read theIconfor the "externalize"-action- See Also:
-
-
Constructor Details
-
ExternalizedMode
protected ExternalizedMode()Empty default constructor. Subclasses should callAbstractLocationMode.setActionProvider(LocationModeActionProvider)to complete initialization of this mode. -
ExternalizedMode
Creates a new mode.- Parameters:
control- the control in whose realm this mode works
-
ExternalizedMode
Creates a new mode.- Parameters:
controller- the owner of this mode
-
-
Method Details
-
getUniqueIdentifier
Description copied from interface:ModeGets a unique identifier, only thisModemust 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
Description copied from interface:LocationModeGets the unique identifier of this mode.- Returns:
- the unique identifier
-
isDefaultMode
Description copied from interface:ModeChecks whether this mode is a default mode ofdockable. A default mode is a mode that is chosen per default, if no other mode is selected. There should be only one default-mode perDockable.- Parameters:
dockable- some dockable, notnull- Returns:
- whether this is a default mode
-
runApply
Description copied from class:DefaultLocationModeThis default implementation uses theDockStation.move(Dockable, DockableProperty)andDockStation.drop(Dockable, DockableProperty)methods to putdockableat its location.- Overrides:
runApplyin classDefaultLocationMode<M extends ExternalizedModeArea>- Parameters:
dockable- the element whose mode becomesthishistory- history information that was returned by this mode when callingMode.current(Dockable)the last time.set- this method has to store allDockables which might have changed their mode in the set.- Returns:
trueifdockablewas moved,falseif the method failed to set the location ofdockablefor any reason
-
getSettingFactory
Description copied from interface:ModeGets a factory for creating newModeSettings.- Returns:
- the factory, can be
null
-
setBehavior
Tells thisExternalizedModehow some algorithms are implemented.- Parameters:
behavior- the new behavior, notnull
-
getBehavior
Gets the current implementation of some algorithms of this mode.- Returns:
- the behavior
-
ensureNotHidden
Description copied from interface:LocationModeEnsures that noDockablethat has this mode hidesdockable. Note thatdockablemay or may not be in this mode.- Parameters:
dockable- the element which must not be hidden
-
writeSetting
Description copied from interface:ModeGets the current properties of this mode in an independent way.- Parameters:
setting- aModeSettingwith the same id as thisMode. This setting was created by aModeSettingFactorywith the same id as thisMode.
-
readSetting
Description copied from interface:ModeSets the properties of this mode. This method will only be called with aModeSettingthat has been created by the currentModeSettingFactory- Parameters:
setting- the new set of properties, notnull
-