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

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.MenuLineLayoutPossibility

public class MenuLineLayoutPossibility
extends Object

A possibility for a layout of tabs, menus and actions as described by the MenuLineLayout.

Author:
Benjamin Sigg

Constructor Summary
MenuLineLayoutPossibility(MenuLineLayoutPane pane, Size tab, Size menu, Size info)
          Creates a new layout.
 
Method Summary
 void apply()
          Applies the sizes specified in this layout.
 MenuLineLayoutPane getPane()
          Gets the representation of the TabPane for which which possible layout is evaluated.
 double getScore()
          Tells how good this layout is.
 Dimension getSize()
          Gets the size this layout requires, this Dimension does not include the preferred or minimal size required for the tab pane.
 boolean isPreferred()
          Tells whether this layout shows all items with their preferred size.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuLineLayoutPossibility

public MenuLineLayoutPossibility(MenuLineLayoutPane pane,
                                 Size tab,
                                 Size menu,
                                 Size info)
Creates a new layout.

Parameters:
pane - the TabPane for which this possible layout is checked
tab - the size of the tabs, not null
menu - the size of the menu, may be null to indicate that the menu is invisible
info - the size of the info panel, may be null if there is no info panel to show
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getScore

public double getScore()
Tells how good this layout is. As higher a score, as better a layout is. The layout which shows all components with their preferred size has a score of 1.0, the layout which does not show anything has a score of 0.0.

Returns:
the score of this layout

isPreferred

public boolean isPreferred()
Tells whether this layout shows all items with their preferred size.

Returns:
whether this layout is a preferred layout

getPane

public MenuLineLayoutPane getPane()
Gets the representation of the TabPane for which which possible layout is evaluated.

Returns:
the pane, not null

getSize

public Dimension getSize()
Gets the size this layout requires, this Dimension does not include the preferred or minimal size required for the tab pane.

Returns:
the size

apply

public void apply()
Applies the sizes specified in this layout.