bibliothek.gui.dock.station.screen
Interface ScreenDropSizeStrategy


public interface ScreenDropSizeStrategy

A ScreenDropSizeStrategy is used by a ScreenDockStation to decide some details on how to drop a Dockable.

Author:
Benjamin Sigg

Field Summary
static ScreenDropSizeStrategy CURRENT_SIZE
          The getDropSize(ScreenDockStation, Dockable) of a Dockable is always its current size when using this strategy.
static ScreenDropSizeStrategy PREFERRED_SIZE
          This strategy always returns the preferred size of a Dockable.
 
Method Summary
 Dimension getAddSize(ScreenDockStation station, Dockable dockable)
          Called when dockable is added to station, but not by a drag and drop operation.
 Dimension getDropSize(ScreenDockStation station, Dockable dockable)
          Called when dockable is about to be dropped into station and the new size of dockable must be found.
 void install(ScreenDockStation station)
          Informs this strategy that is is used by station.
 void uninstall(ScreenDockStation station)
          Informs this strategy that it is no longer used by station.
 

Field Detail

CURRENT_SIZE

static final ScreenDropSizeStrategy CURRENT_SIZE
The getDropSize(ScreenDockStation, Dockable) of a Dockable is always its current size when using this strategy. This is the default strategy.


PREFERRED_SIZE

static final ScreenDropSizeStrategy PREFERRED_SIZE
This strategy always returns the preferred size of a Dockable.

Method Detail

install

void install(ScreenDockStation station)
Informs this strategy that is is used by station.

Parameters:
station - the station using this strategy

uninstall

void uninstall(ScreenDockStation station)
Informs this strategy that it is no longer used by station.

Parameters:
station - the station no longer using this strategy

getDropSize

Dimension getDropSize(ScreenDockStation station,
                      Dockable dockable)
Called when dockable is about to be dropped into station and the new size of dockable must be found.

Parameters:
station - the new parent of dockable
dockable - the item that is about to be dropped
Returns:
the new size of dockable. This size will be validated by the current BoundaryRestriction.

getAddSize

Dimension getAddSize(ScreenDockStation station,
                     Dockable dockable)
Called when dockable is added to station, but not by a drag and drop operation.

Parameters:
station - the new parent of dockable
dockable - the item that is about to be dropped
Returns:
the new size of dockable, usually this is the preferred size