|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbuoy.widget.LayoutInfo
public class LayoutInfo
A LayoutInfo object contains information about how a Widget should be layed out within the space provided by its WidgetContainer. Most containers allow you to specify a default LayoutInfo for all Widgets, and also to specify a different one for each Widget.
It is permitted to reuse a single LayoutInfo object for multiple Widgets. In that case, any change made to the LayoutInfo will affect all Widgets for which it is used.
Nested Class Summary | |
---|---|
static class |
LayoutInfo.Alignment
This inner class represents a value for the alignment. |
static class |
LayoutInfo.FillType
This inner class represents a value for the fill. |
Field Summary | |
---|---|
static LayoutInfo.FillType |
BOTH
|
static LayoutInfo.Alignment |
CENTER
|
static LayoutInfo.Alignment |
EAST
|
static LayoutInfo.FillType |
HORIZONTAL
|
static LayoutInfo.FillType |
NONE
|
static LayoutInfo.Alignment |
NORTH
|
static LayoutInfo.Alignment |
NORTHEAST
|
static LayoutInfo.Alignment |
NORTHWEST
|
static LayoutInfo.Alignment |
SOUTH
|
static LayoutInfo.Alignment |
SOUTHEAST
|
static LayoutInfo.Alignment |
SOUTHWEST
|
static LayoutInfo.FillType |
VERTICAL
|
static LayoutInfo.Alignment |
WEST
|
Constructor Summary | |
---|---|
LayoutInfo()
Create a LayoutInfo object with the following default values: no padding, no insets, center alignment, and no fill. |
|
LayoutInfo(LayoutInfo.Alignment align,
LayoutInfo.FillType fill)
Create a LayoutInfo object with no padding or insets. |
|
LayoutInfo(LayoutInfo.Alignment align,
LayoutInfo.FillType fill,
java.awt.Insets insets,
java.awt.Dimension padding)
Create a LayoutInfo object. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Create a duplicate of this object. |
LayoutInfo.Alignment |
getAlignment()
Get the alignment of the Widget within its available space. |
LayoutInfo.FillType |
getFill()
Get whether the Widget should grow to fill the available space. |
java.awt.Insets |
getInsets()
Get the extra space (in pixels) that should be added around the Widget. |
java.awt.Dimension |
getMaximumSize(Widget widget)
Get the maximum size of a Widget, taking into account the insets and padding specified by this object. |
java.awt.Dimension |
getPadding()
Get the extra padding, in pixels, that should be added to the preferred size of the Widget. |
java.awt.Dimension |
getPreferredSize(Widget widget)
Get the preferred size of a Widget, taking into account the insets and padding specified by this object. |
java.awt.Rectangle |
getWidgetLayout(Widget widget,
java.awt.Rectangle rect)
Given a Widget, and a Rectangle in which to position it, return the desired bounds of the Widget. |
void |
setAlignment(LayoutInfo.Alignment align)
Set the alignment of the Widget within its available space. |
void |
setFill(LayoutInfo.FillType fill)
Set whether the Widget should grow to fill the available space. |
void |
setInsets(java.awt.Insets insets)
Set the extra space (in pixels) that should be added around the Widget. |
void |
setPadding(java.awt.Dimension padding)
Set the extra padding, in pixels, that should be added to the preferred size of the Widget. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final LayoutInfo.Alignment CENTER
public static final LayoutInfo.Alignment NORTH
public static final LayoutInfo.Alignment SOUTH
public static final LayoutInfo.Alignment WEST
public static final LayoutInfo.Alignment EAST
public static final LayoutInfo.Alignment NORTHEAST
public static final LayoutInfo.Alignment SOUTHEAST
public static final LayoutInfo.Alignment NORTHWEST
public static final LayoutInfo.Alignment SOUTHWEST
public static final LayoutInfo.FillType NONE
public static final LayoutInfo.FillType HORIZONTAL
public static final LayoutInfo.FillType VERTICAL
public static final LayoutInfo.FillType BOTH
Constructor Detail |
---|
public LayoutInfo()
public LayoutInfo(LayoutInfo.Alignment align, LayoutInfo.FillType fill)
align
- the alignment of the Widget. This should be equal to one of the alignment constants
defined by this class: CENTER, NORTH, NORTHEAST, EAST, etc.fill
- specifies whether the Widget should grow to fill the available space. This should be
equal to NONE, HORIZONTAL, VERTICAL, BOTH.public LayoutInfo(LayoutInfo.Alignment align, LayoutInfo.FillType fill, java.awt.Insets insets, java.awt.Dimension padding)
align
- the alignment of the Widget. This should be equal to one of the alignment constants
defined by this class: CENTER, NORTH, NORTHEAST, EAST, etc.fill
- specifies whether the Widget should grow to fill the available space. This should be
equal to NONE, HORIZONTAL, VERTICAL, BOTH.insets
- specifies extra space (in pixels) that should be added around the Widget. If this is
null, no insets will be used.padding
- extra padding, in pixels. This requests that the Widget be made larger than its
preferred size. If this is null, no padding will be used.Method Detail |
---|
public LayoutInfo.Alignment getAlignment()
public void setAlignment(LayoutInfo.Alignment align)
public LayoutInfo.FillType getFill()
public void setFill(LayoutInfo.FillType fill)
public java.awt.Insets getInsets()
public void setInsets(java.awt.Insets insets)
public java.awt.Dimension getPadding()
public void setPadding(java.awt.Dimension padding)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.awt.Dimension getPreferredSize(Widget widget)
public java.awt.Dimension getMaximumSize(Widget widget)
public java.awt.Rectangle getWidgetLayout(Widget widget, java.awt.Rectangle rect)
widget
- the Widget to positionrect
- the rectangle within which the Widget should be positioned. This is typically the
region a WidgetContainer has set aside for this particular Widget.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |