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

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.DefaultMenuLineLayoutStrategy
All Implemented Interfaces:
MenuLineLayoutStrategy

public class DefaultMenuLineLayoutStrategy
extends Object
implements MenuLineLayoutStrategy

The default implementation of MenuLineLayoutStrategy provides a generic setting that should work for most cases.

Author:
Benjamin Sigg

Constructor Summary
DefaultMenuLineLayoutStrategy()
           
 
Method Summary
 double getScore(MenuLineLayoutPossibility possibility, Size menuSize, Size infoSize, Size tabSize)
          Calculates how good a layout with the given sizes is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMenuLineLayoutStrategy

public DefaultMenuLineLayoutStrategy()
Method Detail

getScore

public double getScore(MenuLineLayoutPossibility possibility,
                       Size menuSize,
                       Size infoSize,
                       Size tabSize)
Description copied from interface: MenuLineLayoutStrategy
Calculates how good a layout with the given sizes is. To calculate the score the method may call Size.getScore(). MenuLineLayout will create different combinations of Size, call this method, and use the one combination with the highest score.

Specified by:
getScore in interface MenuLineLayoutStrategy
Parameters:
possibility - a description of the layout that might be applied
menuSize - the size of the menu, can be null if the menu is now shown
infoSize - the size of the info-component, can be null if the component is not shown
tabSize - the size of the tabs, can be null if there are no tabs
Returns:
the score, a value between 0.0 and 1.0