bibliothek.gui.dock.station.support
Class ListSpanStrategy

java.lang.Object
  extended by bibliothek.gui.dock.station.support.ListSpanStrategy
Direct Known Subclasses:
FlapSpanStrategy

public abstract class ListSpanStrategy
extends Object

Manages the Spans of a DockStation that orderes its Dockables like a list.

Author:
Benjamin Sigg

Constructor Summary
ListSpanStrategy(String spanFactoryId, DockStation station)
          Creates a new strategy.
 
Method Summary
 int getGap(int index)
          Gets the size of the gap between button index-1 and button index.
protected abstract  int getNumberOfDockables()
          Gets the number of Dockables that are actually shown on the station.
 int getTeasing()
          Gets the current minimum size of the station.
protected abstract  boolean isHorizontal()
          Tells whether the orientation of the underlying DockStation currently is horizontal.
 void reset()
          To be called if the number of children or the orientation changed.
 void setController(DockController controller)
          Called when the DockController of the FlapDockStation changes.
 void size(int index, int size)
          Configures the size of the index'th Span.
protected abstract  void spanResized()
          Called if at least one Span changed its size
 void tease(int index)
          Opens some Spans such that a Dockable could be inserted at index.
 void untease()
          Makes all Spans invisible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSpanStrategy

public ListSpanStrategy(String spanFactoryId,
                        DockStation station)
Creates a new strategy.

Parameters:
spanFactoryId - the unique identifier used to create a StationSpanFactoryValue
station - the station that is using this strategy
Method Detail

setController

public void setController(DockController controller)
Called when the DockController of the FlapDockStation changes.

Parameters:
controller - the new controller, can be null

isHorizontal

protected abstract boolean isHorizontal()
Tells whether the orientation of the underlying DockStation currently is horizontal. A station is horizontal if the Dockables are ordered in a list going from the left side of the station to the right side.

Returns:
whether the station is horizontal or vertical

getNumberOfDockables

protected abstract int getNumberOfDockables()
Gets the number of Dockables that are actually shown on the station.

Returns:
the number of Dockables

spanResized

protected abstract void spanResized()
Called if at least one Span changed its size


reset

public void reset()
To be called if the number of children or the orientation changed.


tease

public void tease(int index)
Opens some Spans such that a Dockable could be inserted at index.

Parameters:
index - the index of the new Dockable

size

public void size(int index,
                 int size)
Configures the size of the index'th Span. Nothing happens if there is no span at index.

Parameters:
index - the index of the span
size - the new size

untease

public void untease()
Makes all Spans invisible.


getTeasing

public int getTeasing()
Gets the current minimum size of the station.

Returns:
the current minimum size

getGap

public int getGap(int index)
Gets the size of the gap between button index-1 and button index.

Parameters:
index - the index of the gap, where 0 is the most left gap
Returns:
the size of the gap