|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.station.stack.tab.layouting.Size
public class Size
A Size
is used by a LayoutBlock
to describe the layout
that fits to some size.
There are two properties that describe how good a Size
is. They are used in different cases:
type
is a hard restraint, it is used to filter layouts. Layouts with an odd mix of
preferred and minimum sizes are not legal and will never be applied. An example would: if the menu for overflowing
Dockable
s has a mimimum size, the list of tabs must have a minimum size as well.getScore()
is a soft restraint, it is used to order different layouts and to find the one layout
that fits best.
Nested Class Summary | |
---|---|
static class |
Size.Type
What type of size a Size describes. |
Constructor Summary | |
---|---|
Size(Size.Type type,
Dimension size,
double score)
Creates a new size |
|
Size(Size.Type type,
int width,
int height,
double score)
Creates a new size. |
Method Summary | |
---|---|
int |
getHeight()
Gets the vertical amount of pixels. |
double |
getScore()
Tells how much this size is liked, a value of 1.0 indicates that
this is the best possible size, while a value of 0.0 indicates that this
size is as good as unusable |
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. |
Dimension |
toDimension()
Returns this size as Dimension . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Size(Size.Type type, int width, int height, double score)
type
- what kind of size this describeswidth
- horizontal amount of pixelsheight
- vertical amount of pixelsscore
- how much this size is liked, a value of 1.0
indicates that
this is the best possible size, while a value of 0.0
indicates that this
size is as good as unusablepublic Size(Size.Type type, Dimension size, double score)
type
- what kind of size this describessize
- the amount of pixelsscore
- how much this size is liked, a value of 1.0
indicates that
this is the best possible size, while a value of 0.0
indicates that this
size is as good as unusableMethod Detail |
---|
public boolean isMinimum()
Size
describes the minimum size
some component requires.
true
if this is a minimum sizepublic boolean isPreferred()
Size
describes the preferred size
some component requires.
true
if this is a preferred sizepublic Size.Type getType()
null
public int getWidth()
public int getHeight()
public double getScore()
1.0
indicates that
this is the best possible size, while a value of 0.0
indicates that this
size is as good as unusable
public Dimension toDimension()
Dimension
.
Dimension
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |