bibliothek.gui.dock.station.toolbar
Class SpanToolbarLayoutManager

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.SpanToolbarLayoutManager
All Implemented Interfaces:
LayoutManager, LayoutManager2

public abstract class SpanToolbarLayoutManager
extends Object
implements LayoutManager2

LayoutManager used by the ToolbarDockStation.

Author:
Benjamin Sigg

Constructor Summary
SpanToolbarLayoutManager(ToolbarDockStation station, Container parent)
           
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
           
 void addLayoutComponent(String name, Component comp)
           
 int getGap()
          Gets the size of the gap between each child component.
 int getInsertionIndex(int x, int y)
          Calculates where to insert an item assuming the mouse is at position x/y.
 float getLayoutAlignmentX(Container target)
           
 float getLayoutAlignmentY(Container target)
           
 int getSideGap()
          Gets the size of the gap between the children and the outside border.
 void invalidateLayout(Container target)
           
 void layoutContainer(Container parent)
           
 Dimension maximumLayoutSize(Container target)
           
 Dimension minimumLayoutSize(Container parent)
           
 Dimension preferredLayoutSize(Container parent)
           
 void removeLayoutComponent(Component comp)
           
protected abstract  void revalidate()
           
 void setController(bibliothek.gui.DockController controller)
           
 void setExpandedSpan(int index, boolean mutate)
           
 void setGap(int gap)
          Sets the size of the gap between each child component.
 void setSideGap(int sideGap)
          Sets the size of the gap between the children and the outside border.
 void setSpanSize(bibliothek.gui.Dockable moved)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpanToolbarLayoutManager

public SpanToolbarLayoutManager(ToolbarDockStation station,
                                Container parent)
Method Detail

getGap

public int getGap()
Gets the size of the gap between each child component.

Returns:
the gap size

setGap

public void setGap(int gap)
Sets the size of the gap between each child component.

Parameters:
gap - the size of the gap, at least 0

getSideGap

public int getSideGap()
Gets the size of the gap between the children and the outside border.

Returns:
the size of the gap

setSideGap

public void setSideGap(int sideGap)
Sets the size of the gap between the children and the outside border.

Parameters:
sideGap - the size of the gap, at least 0

setController

public void setController(bibliothek.gui.DockController controller)

getInsertionIndex

public int getInsertionIndex(int x,
                             int y)
Calculates where to insert an item assuming the mouse is at position x/y.

Parameters:
x - the x coordinate of the mouse
y - the y coordinate of the mouse
Returns:
the preferred position to insert a new Dockable

setSpanSize

public void setSpanSize(bibliothek.gui.Dockable moved)

setExpandedSpan

public void setExpandedSpan(int index,
                            boolean mutate)

revalidate

protected abstract void revalidate()

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Specified by:
addLayoutComponent in interface LayoutManager

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Specified by:
removeLayoutComponent in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Specified by:
preferredLayoutSize in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Specified by:
minimumLayoutSize in interface LayoutManager

layoutContainer

public void layoutContainer(Container parent)
Specified by:
layoutContainer in interface LayoutManager

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Specified by:
addLayoutComponent in interface LayoutManager2

maximumLayoutSize

public Dimension maximumLayoutSize(Container target)
Specified by:
maximumLayoutSize in interface LayoutManager2

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Specified by:
getLayoutAlignmentY in interface LayoutManager2

invalidateLayout

public void invalidateLayout(Container target)
Specified by:
invalidateLayout in interface LayoutManager2