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 normaly act together when changing the LocationMode: e.g. if one CDockable is minimized, all the other CDockables follow.

Author:
Benjamin Sigg

Field Summary
static CGroupBehavior STACKED
          A behavior that moves around entire stacks of Dockables.
static CGroupBehavior TOPMOST
          A behavior that moves only one Dockable at a time.
 
Method Summary
 Dockable getGroupElement(Dockable dockable, ExtendedMode mode)
          Gets the element whose location or mode must be changed in order to apply mode to dockable.
 Dockable getReplaceElement(Dockable old, Dockable dockable, ExtendedMode mode)
          Gets the element which would replace old if old is currently in mode, and dockable is or will not be in mode.
 CGroupMovement prepare(LocationModeManager<? extends LocationMode> manager, Dockable dockable, ExtendedMode target)
          Calculates how the mode of dockable has to be changed such that it matches target.
 boolean shouldForwardActions(DockStation station, Dockable dockable, ExtendedMode mode, ExtendedModeEnablement enablement)
          Tells whether the actions of dockable for mode mode should be shown on station too.
 

Field Detail

TOPMOST

static final CGroupBehavior TOPMOST
A behavior that moves only one Dockable at a time.


STACKED

static final CGroupBehavior STACKED
A behavior that moves around entire stacks of Dockables.

Method Detail

prepare

CGroupMovement prepare(LocationModeManager<? extends LocationMode> manager,
                       Dockable dockable,
                       ExtendedMode target)
Calculates how the mode of dockable has to be changed such that it matches target.

Parameters:
manager - a manager which may be asked for additional information
dockable - the element that was clicked by the user
target - the extended mode intended for dockable

getGroupElement

Dockable getGroupElement(Dockable dockable,
                         ExtendedMode mode)
Gets the element whose location or mode must be changed in order to apply mode to dockable. Normally dockable itself is returned, or a parent DockStation of dockable.

Parameters:
dockable - some element, not null
Returns:
the element that must be repositioned, might be dockable itself, not null

getReplaceElement

Dockable getReplaceElement(Dockable old,
                           Dockable dockable,
                           ExtendedMode mode)
Gets the element which would replace old if old is currently in mode, and dockable is or will not be in mode.

Parameters:
old - some element
dockable - some element, might be old
mode - the mode in which old is
Returns:
the element which would be maximized if dockable is no longer in mode, can be null

shouldForwardActions

boolean shouldForwardActions(DockStation station,
                             Dockable dockable,
                             ExtendedMode mode,
                             ExtendedModeEnablement enablement)
Tells whether the actions of dockable for mode mode should be shown on station too.

Parameters:
station - the parent of dockable
dockable - the element whose actions will be shown
mode - the mode for which the actions are requested
enablement - a strategy telling which ExtendedModes are enabled for which Dockables
Returns:
true if the actions should be forwarded