bibliothek.gui.dock.station.flap
Class DefaultFlapLayoutManager

java.lang.Object
  extended by bibliothek.gui.dock.station.flap.AbstractFlapLayoutManager
      extended by bibliothek.gui.dock.station.flap.DefaultFlapLayoutManager
All Implemented Interfaces:
FlapLayoutManager

public class DefaultFlapLayoutManager
extends AbstractFlapLayoutManager
implements FlapLayoutManager

The default implementation of FlapLayoutManager. Uses the same size for all children of one FlapDockStation.

Author:
Benjamin Sigg

Constructor Summary
DefaultFlapLayoutManager()
           
 
Method Summary
 int getSize(FlapDockStation station, Dockable dockable)
          Called when dockable is about to open and station has to find out which size dockable should have.
 void install(FlapDockStation station)
          Called before this manager is used.
 boolean isHold(FlapDockStation station, Dockable dockable)
          Called when dockable is added to station and station does not know whether dockable should be hold open even when it is not focused.
 boolean isHoldSwitchable(FlapDockStation station, Dockable dockable)
          Tells whether the user is supposed to switch the hold property.
 void setHold(FlapDockStation station, Dockable dockable, boolean hold)
          Called when the user changes the hold property of dockable.
 void setHoldSwitchable(FlapDockStation station, Dockable dockable, boolean switchable)
          Sets the result of isHoldSwitchable(FlapDockStation, Dockable).
 void setSize(FlapDockStation station, Dockable dockable, int size)
          Called when the user changes the size of dockable.
 void uninstall(FlapDockStation station)
          Called when this manager is no longer used.
 
Methods inherited from class bibliothek.gui.dock.station.flap.AbstractFlapLayoutManager
addListener, fireHoldSwitchableChanged, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.station.flap.FlapLayoutManager
addListener, removeListener
 

Constructor Detail

DefaultFlapLayoutManager

public DefaultFlapLayoutManager()
Method Detail

install

public void install(FlapDockStation station)
Description copied from interface: FlapLayoutManager
Called before this manager is used.

Specified by:
install in interface FlapLayoutManager
Parameters:
station - the station that will use this manager

uninstall

public void uninstall(FlapDockStation station)
Description copied from interface: FlapLayoutManager
Called when this manager is no longer used.

Specified by:
uninstall in interface FlapLayoutManager
Parameters:
station - the station that will no longer use this manager

getSize

public int getSize(FlapDockStation station,
                   Dockable dockable)
Description copied from interface: FlapLayoutManager
Called when dockable is about to open and station has to find out which size dockable should have.

Specified by:
getSize in interface FlapLayoutManager
Parameters:
station - the caller
dockable - the child of station that is going to be shown.
Returns:
the size of dockable

isHold

public boolean isHold(FlapDockStation station,
                      Dockable dockable)
Description copied from interface: FlapLayoutManager
Called when dockable is added to station and station does not know whether dockable should be hold open even when it is not focused.

Specified by:
isHold in interface FlapLayoutManager
Parameters:
station - the caller
dockable - the new element on station
Returns:
the initial value of the hold property

setHold

public void setHold(FlapDockStation station,
                    Dockable dockable,
                    boolean hold)
Description copied from interface: FlapLayoutManager
Called when the user changes the hold property of dockable.

Specified by:
setHold in interface FlapLayoutManager
Parameters:
station - the caller
dockable - the child of station whose property has changed
hold - the new value

setSize

public void setSize(FlapDockStation station,
                    Dockable dockable,
                    int size)
Description copied from interface: FlapLayoutManager
Called when the user changes the size of dockable.

Specified by:
setSize in interface FlapLayoutManager
Parameters:
station - the caller
dockable - the element whose size has been changed
size - the new size

isHoldSwitchable

public boolean isHoldSwitchable(FlapDockStation station,
                                Dockable dockable)
Description copied from interface: FlapLayoutManager
Tells whether the user is supposed to switch the hold property.

Specified by:
isHoldSwitchable in interface FlapLayoutManager
Parameters:
station - the caller
dockable - the child of station whose property is asked
Returns:
true if the hold property can be changed, false if the user should not be presented with a button to change the property

setHoldSwitchable

public void setHoldSwitchable(FlapDockStation station,
                              Dockable dockable,
                              boolean switchable)
Sets the result of isHoldSwitchable(FlapDockStation, Dockable). The result will be reset to true if dockable is removed from station.

Parameters:
station - the station for which the setting should be changed
dockable - a child of station
switchable - whether the hold property of dockable is switchable