bibliothek.gui.dock.station.stack.tab
Class MenuLineLayout

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.AbstractTabLayoutManager<MenuLineLayoutPane>
      extended by bibliothek.gui.dock.station.stack.tab.MenuLineLayout
All Implemented Interfaces:
TabLayoutManager

public class MenuLineLayout
extends AbstractTabLayoutManager<MenuLineLayoutPane>

Orders tabs in a line, if there is not enough space a menu is used. Also ensures the info-panel has its preferred size.

Author:
Benjamin Sigg

Constructor Summary
MenuLineLayout()
           
 
Method Summary
protected  MenuLineLayoutPane createInfoFor(TabPane pane)
          Creates a new bag for information about pane.
protected  void destroy(MenuLineLayoutPane info)
          Called when the information info is no longer required.
protected  AxisConversion getConversion(TabPane pane)
          Creates a new AxisConversion to convert a layout that is at the top of dockables to a layout at the TabPlacement given by pane.
 MenuLineLayoutFactory getFactory()
          Gets a factory which can be used to create items useful for this MenuLineLayout.
 int getIndexOfTabAt(TabPane pane, Point mouseLocation)
          Finds out which tab is below the mouse at location mouseLocation.
 Dimension getMinimumSize(TabPane pane)
          Gets the minimal size that TabPane.getAvailableArea() should return.
 Dimension getPreferredSize(TabPane pane)
          Gets the preferred size that TabPane.getAvailableArea() should return.
protected  Size[] getSizes(LayoutBlock block, Size.Type type)
          Collects all the Sizes whose type is type.
protected  Size[] getSizes(Size[] choices, Size.Type type)
          Makes a selection of those Sizes with type.
 MenuLineLayoutStrategy getStrategy()
          Gets the strategy with the customized algorithms.
 void layout(TabPane pane)
          Lays out the tabs on pane, this manager is free to make any layout it wishes.
 void setFactory(MenuLineLayoutFactory factory)
          Sets a factory to create items that are required by this MenuLineLayout.
 void setStrategy(MenuLineLayoutStrategy strategy)
          Sets a strategy offering customized algorithms.
 
Methods inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabLayoutManager
getInfo, install, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuLineLayout

public MenuLineLayout()
Method Detail

setFactory

public void setFactory(MenuLineLayoutFactory factory)
Sets a factory to create items that are required by this MenuLineLayout.

Parameters:
factory - the new factory, not null

getFactory

public MenuLineLayoutFactory getFactory()
Gets a factory which can be used to create items useful for this MenuLineLayout.

Returns:
the factory

setStrategy

public void setStrategy(MenuLineLayoutStrategy strategy)
Sets a strategy offering customized algorithms. These algorithms are used to fine tune the behavior of this MenuLineLayout.

Parameters:
strategy - the strategy, not null

getStrategy

public MenuLineLayoutStrategy getStrategy()
Gets the strategy with the customized algorithms.

Returns:
the strategy
See Also:
setStrategy(MenuLineLayoutStrategy)

createInfoFor

protected MenuLineLayoutPane createInfoFor(TabPane pane)
Description copied from class: AbstractTabLayoutManager
Creates a new bag for information about pane.

Specified by:
createInfoFor in class AbstractTabLayoutManager<MenuLineLayoutPane>
Parameters:
pane - some panel
Returns:
the information for pane

destroy

protected void destroy(MenuLineLayoutPane info)
Description copied from class: AbstractTabLayoutManager
Called when the information info is no longer required.

Specified by:
destroy in class AbstractTabLayoutManager<MenuLineLayoutPane>
Parameters:
info - the information bag to delete

getIndexOfTabAt

public int getIndexOfTabAt(TabPane pane,
                           Point mouseLocation)
Description copied from interface: TabLayoutManager
Finds out which tab is below the mouse at location mouseLocation.

Parameters:
pane - the panel for which to search the tab
mouseLocation - the location of the mouse
Returns:
the index of the tab beneath mouseLocation or null

getMinimumSize

public Dimension getMinimumSize(TabPane pane)
Description copied from interface: TabLayoutManager
Gets the minimal size that TabPane.getAvailableArea() should return.

Parameters:
pane - some panel
Returns:
the minimal size of the available area of pane

getPreferredSize

public Dimension getPreferredSize(TabPane pane)
Description copied from interface: TabLayoutManager
Gets the preferred size that TabPane.getAvailableArea() should return.

Parameters:
pane - some panel
Returns:
the preferred size of the available area of pane

layout

public void layout(TabPane pane)
Description copied from interface: TabLayoutManager
Lays out the tabs on pane, this manager is free to make any layout it wishes. However, the result should allow the user to still select any tab.

Parameters:
pane - the pane whose tabs should be positioned

getSizes

protected Size[] getSizes(LayoutBlock block,
                          Size.Type type)
Collects all the Sizes whose type is type.

Parameters:
block - the source of the size, may be null
type - the type to search, not null
Returns:
an array containing sizes, may have length 0, never null

getSizes

protected Size[] getSizes(Size[] choices,
                          Size.Type type)
Makes a selection of those Sizes with type.

Parameters:
choices - available sizes
type - the type searched
Returns:
sizes fitting type

getConversion

protected AxisConversion getConversion(TabPane pane)
Creates a new AxisConversion to convert a layout that is at the top of dockables to a layout at the TabPlacement given by pane.

Parameters:
pane - the panel for which the conversion is used
Returns:
the new conversion