Package bibliothek.gui.dock.common.group
Interface CGroupBehavior
- All Known Implementing Classes:
StackGroupBehavior,TopMostGroupBehavior
public interface CGroupBehavior
A
CGroupBehavior allows to define groups of CDockable. Groups normally
act together when changing the LocationMode: e.g. if one CDockable is minimized, all the other
CDockables follow.- Author:
- Benjamin Sigg
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CGroupBehaviorA behavior that moves around entire stacks ofDockables.static final CGroupBehaviorA behavior that moves only oneDockableat a time. -
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.
-
Field Details
-
Method Details
-
prepare
CGroupMovement prepare(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode target) Calculates how the mode ofdockablehas to be changed such that it matchestarget. Please note that some modules use directlygetGroupElement(LocationModeManager, Dockable, ExtendedMode)and do never call this method.- 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
Dockable getGroupElement(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode mode) Gets the element whose location or mode must be changed in order to applymodetodockable. Normallydockableitself is returned, or a parentDockStationofdockable.- 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
Dockable 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.- 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
boolean shouldForwardActions(LocationModeManager<? extends LocationMode> manager, DockStation station, Dockable dockable, ExtendedMode mode) Tells whether the actions ofdockablefor modemodeshould be shown onstationtoo.- 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
-