|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.FlowLayout
net.wotonomy.ui.swing.components.BetterFlowLayout
public class BetterFlowLayout
BetterFlowLayout works just like FlowLayout, except that you can specify a vertical orientation in addition to the usual horizontal orientations. You can also specify that all the components be sized to the same height and/or width. By default, the behavior is identical to FlowLayout.
Field Summary | |
---|---|
static int |
BOTTOM
This value indicates vertical orientation and that each column of components should be bottom-justified. |
static int |
CENTER_VERTICAL
This value indicates vertical orientation and that each column of components should be centered. |
protected boolean |
isHeightUniform
Tracks component sizing of height. |
protected boolean |
isHorizontal
Tracks orientation. |
protected boolean |
isWidthUniform
Tracks component sizing of width. |
static int |
TOP
This value indicates vertical orientation and that each column of components should be top-justified. |
Fields inherited from class java.awt.FlowLayout |
---|
CENTER, LEADING, LEFT, RIGHT, TRAILING |
Constructor Summary | |
---|---|
BetterFlowLayout()
Constructs a new Flow Layout with a centered alignment and a default 5-unit horizontal and vertical gap. |
|
BetterFlowLayout(int align)
Constructs a new Flow Layout with the specified alignment and a default 5-unit horizontal and vertical gap. |
|
BetterFlowLayout(int align,
int hgap,
int vgap)
Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps. |
Method Summary | |
---|---|
protected java.awt.Dimension |
getUniformDimension(java.awt.Container target)
Returns a dimension representing the maximum preferred height and width of all the components in the container. |
boolean |
isHeightUniform()
Determines whether all components will have the same height. |
boolean |
isWidthUniform()
Determines whether all components will have the same width. |
void |
layoutContainer(java.awt.Container target)
Lays out the container. |
protected void |
layoutContainerHorizontal(java.awt.Container target)
Lays out the container. |
protected void |
layoutContainerVertical(java.awt.Container target)
Lays out the container. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to layout the components contained in the specified target container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
java.awt.Dimension |
preferredLayoutSizeHorizontal(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
java.awt.Dimension |
preferredLayoutSizeVertical(java.awt.Container target)
Returns the preferred dimensions for this layout given the components in the specified target container. |
void |
setAlignment(int align)
Sets the alignment for this layout. |
void |
setHeightUniform(boolean isUniform)
Sets whether all components should have the same height. |
void |
setWidthUniform(boolean isUniform)
Sets whether all components should have the same width. |
java.lang.String |
toString()
Returns a string representation of this BetterFlowLayout
object and its values. |
Methods inherited from class java.awt.FlowLayout |
---|
addLayoutComponent, getAlignment, getHgap, getVgap, removeLayoutComponent, setHgap, setVgap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TOP
public static final int CENTER_VERTICAL
public static final int BOTTOM
protected boolean isHorizontal
protected boolean isWidthUniform
protected boolean isHeightUniform
Constructor Detail |
---|
public BetterFlowLayout()
public BetterFlowLayout(int align)
BetterFlowLayout.LEFT
, BetterFlowLayout.RIGHT
,
or BetterFlowLayout.CENTER
.
align
- the alignment valuepublic BetterFlowLayout(int align, int hgap, int vgap)
The value of the alignment argument must be one of
BetterFlowLayout.LEFT
, BetterFlowLayout.RIGHT
,
or BetterFlowLayout.CENTER
.
align
- the alignment value.hgap
- the horizontal gap between components.vgap
- the vertical gap between components.Method Detail |
---|
public void setHeightUniform(boolean isUniform)
isUniform
- the new value.isHeightUniform
public void setWidthUniform(boolean isUniform)
isUniform
- the new value.isWidthUniform
public boolean isHeightUniform()
public boolean isWidthUniform()
public void setAlignment(int align)
LEFT
,
RIGHT
, and CENTER
.
Possible values for vertical orientation are TOP
,
BOTTOM
, and CENTER_VERTICAL
.
setAlignment
in class java.awt.FlowLayout
align
- the alignment value.FlowLayout.getAlignment()
public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
preferredLayoutSize
in class java.awt.FlowLayout
target
- the component which needs to be laid out
Container
,
minimumLayoutSize(java.awt.Container)
,
Container.getPreferredSize()
public java.awt.Dimension preferredLayoutSizeHorizontal(java.awt.Container target)
target
- the component which needs to be laid out
Container
,
minimumLayoutSize(java.awt.Container)
,
Container.getPreferredSize()
public java.awt.Dimension preferredLayoutSizeVertical(java.awt.Container target)
target
- the component which needs to be laid out
Container
,
minimumLayoutSize(java.awt.Container)
,
Container.getPreferredSize()
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
minimumLayoutSize
in class java.awt.FlowLayout
target
- the component which needs to be laid out
preferredLayoutSize(java.awt.Container)
,
Container
,
Container.doLayout()
public void layoutContainer(java.awt.Container target)
BetterFlowLayout
object.
layoutContainer
in interface java.awt.LayoutManager
layoutContainer
in class java.awt.FlowLayout
target
- the specified component being laid out.Container
,
Container.doLayout()
protected void layoutContainerHorizontal(java.awt.Container target)
BetterFlowLayout
object.
target
- the specified component being laid out.Container
,
Container.doLayout()
protected void layoutContainerVertical(java.awt.Container target)
BetterFlowLayout
object.
target
- the specified component being laid out.Container
,
Container.doLayout()
protected java.awt.Dimension getUniformDimension(java.awt.Container target)
target
- the container to scan.
public java.lang.String toString()
BetterFlowLayout
object and its values.
toString
in class java.awt.FlowLayout
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |