bibliothek.gui.dock.station.stack.tab.layouting
Class Size

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.layouting.Size
Direct Known Subclasses:
TabsLayoutBlock.TabsSize

public class Size
extends java.lang.Object

A Size is used by a LayoutBlock to describe the layout that fits to some size.

Author:
Benjamin Sigg

Nested Class Summary
static class Size.Type
          What type of size a Size describes.
 
Constructor Summary
Size(Size.Type type, java.awt.Dimension size)
          Creates a new size
Size(Size.Type type, int width, int height)
          Creates a new size.
 
Method Summary
 int getHeight()
          Gets the vertical amount of pixels.
 Size.Type getType()
          Gets the type of this size.
 int getWidth()
          Gets the horizontal amount of pixels.
 boolean isMinimum()
          Tells whether this Size describes the minimum size some component requires.
 boolean isPreferred()
          Tells whether this Size describes the preferred size some component requires.
 java.awt.Dimension toDimension()
          Returns this size as Dimension.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Size

public Size(Size.Type type,
            int width,
            int height)
Creates a new size.

Parameters:
type - what kind of size this describes
width - horizontal amount of pixels
height - vertical amount of pixels

Size

public Size(Size.Type type,
            java.awt.Dimension size)
Creates a new size

Parameters:
type - what kind of size this describes
size - the amount of pixels
Method Detail

isMinimum

public boolean isMinimum()
Tells whether this Size describes the minimum size some component requires.

Returns:
true if this is a minimum size

isPreferred

public boolean isPreferred()
Tells whether this Size describes the preferred size some component requires.

Returns:
true if this is a preferred size

getType

public Size.Type getType()
Gets the type of this size.

Returns:
the type, never null

getWidth

public int getWidth()
Gets the horizontal amount of pixels.

Returns:
the width

getHeight

public int getHeight()
Gets the vertical amount of pixels.

Returns:
the height

toDimension

public java.awt.Dimension toDimension()
Returns this size as Dimension.

Returns:
a new Dimension

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object