Package bibliothek.gui.dock.common.group
Class StackGroupBehavior
java.lang.Object
bibliothek.gui.dock.common.group.StackGroupBehavior
- All Implemented Interfaces:
CGroupBehavior
This
This behavior does not move around entire
CGroupBehavior assumes that all Dockables which share a common StackDockStation as
parent belong to the same group. This behavior also assumes that all Combiners will create new
StackDockStations and that StackDockStations cannot be put into each other. All these assumptions
hold true with the default settings of a CControl.This behavior does not move around entire
StackDockStations, it moves around each Dockable individually.
This has the benefit that StackDockStations cannot accidentally be put into each other.- Author:
- Benjamin Sigg
-
Field Summary
Fields inherited from interface bibliothek.gui.dock.common.group.CGroupBehavior
STACKED, TOPMOST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGroupElement(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode mode) Gets the element whose location or mode must be changed in order to applymodetodockable.getReplaceElement(LocationModeManager<? extends LocationMode> manager, Dockable old, Dockable dockable, ExtendedMode mode) Gets the element which would replaceoldifoldis currently inmode, anddockableis or will not be inmode.prepare(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode target) Calculates how the mode ofdockablehas to be changed such that it matchestarget.booleanshouldForwardActions(LocationModeManager<? extends LocationMode> manager, DockStation station, Dockable dockable, ExtendedMode mode) Tells whether the actions ofdockablefor modemodeshould be shown onstationtoo.
-
Constructor Details
-
StackGroupBehavior
public StackGroupBehavior()
-
-
Method Details
-
prepare
public CGroupMovement prepare(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode target) Description copied from interface:CGroupBehaviorCalculates how the mode ofdockablehas to be changed such that it matchestarget. Please note that some modules use directlyCGroupBehavior.getGroupElement(LocationModeManager, Dockable, ExtendedMode)and do never call this method.- Specified by:
preparein interfaceCGroupBehavior- Parameters:
manager- a manager which may be asked for additional informationdockable- the element that was clicked by the usertarget- the extended mode intended fordockable- Returns:
- the operation to execute, may be
null
-
getGroupElement
public Dockable getGroupElement(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode mode) Description copied from interface:CGroupBehaviorGets the element whose location or mode must be changed in order to applymodetodockable. Normallydockableitself is returned, or a parentDockStationofdockable.- Specified by:
getGroupElementin interfaceCGroupBehavior- Parameters:
manager- a manager which may be asked for additional informationdockable- some element, notnullmode- the target mode- Returns:
- the element that must be repositioned, might be
dockableitself, notnull
-
getReplaceElement
public Dockable getReplaceElement(LocationModeManager<? extends LocationMode> manager, Dockable old, Dockable dockable, ExtendedMode mode) Description copied from interface:CGroupBehaviorGets the element which would replaceoldifoldis currently inmode, anddockableis or will not be inmode.- Specified by:
getReplaceElementin interfaceCGroupBehavior- Parameters:
manager- a manager which may be asked for additional informationold- some elementdockable- some element, might beoldmode- the mode in whicholdis- Returns:
- the element which would be maximized if
dockableis no longer inmode, can benull
-
shouldForwardActions
public boolean shouldForwardActions(LocationModeManager<? extends LocationMode> manager, DockStation station, Dockable dockable, ExtendedMode mode) Description copied from interface:CGroupBehaviorTells whether the actions ofdockablefor modemodeshould be shown onstationtoo.- Specified by:
shouldForwardActionsin interfaceCGroupBehavior- Parameters:
manager- a manager which may be asked for additional informationstation- the parent ofdockabledockable- the element whose actions will be shownmode- the mode for which the actions are requested- Returns:
trueif the actions should be forwarded
-