bibliothek.gui.dock.station.split
Interface SplitLayoutManager

All Known Implementing Classes:
CLockedResizeLayoutManager, DefaultSplitLayoutManager, DelegatingSplitLayoutManager, LbSplitLayoutManager, LockedResizeLayoutManager

public interface SplitLayoutManager

A manager used to implement the behavior of a SplitDockStation. The SplitLayoutManager is responsible to define the actions that have to be taken on drop and move-events. It is also responsible to validate any movement of the dividers.

Author:
Benjamin Sigg

Method Summary
 void calculateDivider(SplitDockStation station, PutInfo putInfo, Leaf origin)
          Calculates the value a divider should have if the Dockable of putInfo is added alongside of origin.
 void install(SplitDockStation station)
          Called by a SplitDockStation when this manager will be used by the station.
 PutInfo prepareDrop(SplitDockStation station, int x, int y, int titleX, int titleY, boolean checkOverrideZone, Dockable dockable)
          Call forwarded from DockStation.prepareDrop.
 PutInfo prepareMove(SplitDockStation station, int x, int y, int titleX, int titleY, boolean checkOverrideZone, Dockable dockable)
          Call forwarded from DockStation.prepareMove.
 void uninstall(SplitDockStation station)
          Called by a SplitDockStation which used this manager and no longer does.
 void updateBounds(Root root, double x, double y, double factorW, double factorH)
          Called when the bounds of all DockableDisplayer of a station have to be updated.
 double validateDivider(SplitDockStation station, double divider, Node node)
          Tests whether the specified divider-value is legal or not.
 PutInfo validatePutInfo(SplitDockStation station, PutInfo info)
          Checks whether info is valid or not.
 Dockable willMakeFullscreen(SplitDockStation station, Dockable dockable)
          Called before the station changes its fullscreen-Dockable.
 

Method Detail

install

void install(SplitDockStation station)
Called by a SplitDockStation when this manager will be used by the station.

Parameters:
station - the invoking station

uninstall

void uninstall(SplitDockStation station)
Called by a SplitDockStation which used this manager and no longer does.

Parameters:
station - the invoking station

willMakeFullscreen

Dockable willMakeFullscreen(SplitDockStation station,
                            Dockable dockable)
Called before the station changes its fullscreen-Dockable.

Parameters:
station - the invoking station
dockable - the element which the station wants to make fullscreen, can be null
Returns:
the element which the station will made fullscreen, must either be a child of station or null.

prepareDrop

PutInfo prepareDrop(SplitDockStation station,
                    int x,
                    int y,
                    int titleX,
                    int titleY,
                    boolean checkOverrideZone,
                    Dockable dockable)
Call forwarded from DockStation.prepareDrop. This method calculates where to drop a new Dockable.

Parameters:
station - the calling station
x - the x-coordinate of the mouse on the screen
y - the y-coordinate of the mouse on the screen
titleX - the location of the title or x if no title is grabbed
titleY - the location of the title or y if no title is grabbed
checkOverrideZone - whether to respect the override zone of the parent
dockable - the element that might be dropped
Returns:
where to drop dockable or null if the element should not be dropped

prepareMove

PutInfo prepareMove(SplitDockStation station,
                    int x,
                    int y,
                    int titleX,
                    int titleY,
                    boolean checkOverrideZone,
                    Dockable dockable)
Call forwarded from DockStation.prepareMove. This method calculates where to move a Dockable of station.

Parameters:
station - the calling station
x - the x-coordinate of the mouse on the screen
y - the y-coordinate of the mouse on the screen
titleX - the location of the title or x if no title is grabbed
titleY - the location of the title or y if no title is grabbed
checkOverrideZone - whether to respect the override zone of the parent
dockable - the element that might be dropped
Returns:
where to drop dockable or null if the element should not be dropped

calculateDivider

void calculateDivider(SplitDockStation station,
                      PutInfo putInfo,
                      Leaf origin)
Calculates the value a divider should have if the Dockable of putInfo is added alongside of origin. The result has to be stored directly in putInfo.

Parameters:
station - the station for which the calculation has to be done
putInfo - the new child of the station
origin - a leaf of this station or null

validateDivider

double validateDivider(SplitDockStation station,
                       double divider,
                       Node node)
Tests whether the specified divider-value is legal or not.

Parameters:
station - the station for which the divider is calculated
divider - the value of a divider on a Node
node - the Node for which the test is performed
Returns:
a legal value as near as possible to divider

validatePutInfo

PutInfo validatePutInfo(SplitDockStation station,
                        PutInfo info)
Checks whether info is valid or not.

Parameters:
station - the station for which info will be used
info - the preferred drop location
Returns:
a valid PutInfo, info or null.

updateBounds

void updateBounds(Root root,
                  double x,
                  double y,
                  double factorW,
                  double factorH)
Called when the bounds of all DockableDisplayer of a station have to be updated. Subclasses normally can just call Root.updateBounds(double, double, double, double, double, double, boolean) with width and height set to 1.0.

Parameters:
root - the root of a tree of Dockables
x - the left bound
y - the top bound
factorW - a factor with which all x-coordinates have to be multiplied in order to get coordinates in pixels. 0 if the basic station has no size.
factorH - a factor with which all y-coordinates have to be multiplied in order to get coordinates in pixels. 0 if the basic station has no size.