All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.bwt.JCAlignerLayout

java.lang.Object
   |
   +----java.awt.GridLayout
           |
           +----jclass.bwt.JCGridLayout
                   |
                   +----jclass.bwt.JCAlignerLayout

public class JCAlignerLayout
extends JCGridLayout
A layout that provides a simple way to lay out a vertically arranged group of control components, each with an associated label (or other component) placed to its left.

Properties

Name Method
LabelDefaultAlignment setLabelDefaultAlignment
LabelVerticalAlignment setLabelVerticalAlignment
ResizeHeight setResizeHeight
ResizeWidth setResizeWidth


Constructor Index

 o JCAlignerLayout()
Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.
 o JCAlignerLayout(int, int, int)
Creates an aligner layout with the specified number of columns and gaps.

Method Index

 o getLabelDefaultAlignment()
Gets the default label alignment.
 o getLabelVerticalAlignment(Component)
Gets the vertical position of a label relative to its control.
 o getResizeHeight(Component)
Gets the component's RezizeHeight value.
 o getResizeWidth(Component)
Gets the component's RezizeWidth value.
 o reshape(int, int, int, Component, int, int, int, int)
Positions the component.
 o setLabelDefaultAlignment(int)
Sets the default alignment for each label (if the component is a JCLabel):
BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT (default), BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT
 o setLabelVerticalAlignment(Component, int)
Sets the vertical position of a label relative to its control.
 o setResizeHeight(Component, boolean)
Sets whether the control should be resized vertically to the height of the largest component in its row (default: false).
 o setResizeWidth(Component, boolean)
Sets whether the control should be resized horizontally to its parent's right edge if it is in the last column (default: false).

Constructors

 o JCAlignerLayout
 public JCAlignerLayout()
Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.

 o JCAlignerLayout
 public JCAlignerLayout(int cols,
                        int hgap,
                        int vgap)
Creates an aligner layout with the specified number of columns and gaps.

Parameters:
cols - the number of columns (should be a multiple of 2)
hgap - the horizontal gap variable
vgap - the vertical gap variable
Throws: IllegalArgumentException
If the rows and columns are invalid.

Methods

 o getLabelDefaultAlignment
 public int getLabelDefaultAlignment()
Gets the default label alignment.

See Also:
setLabelDefaultAlignment
 o setLabelDefaultAlignment
 public synchronized void setLabelDefaultAlignment(int v)
Sets the default alignment for each label (if the component is a JCLabel):
BWTEnum.TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT (default), BOTTOMLEFT, BOTTOMCENTER and BOTTOMRIGHT

Throws: IllegalArgumentException
If an invalid value is set
 o getLabelVerticalAlignment
 public int getLabelVerticalAlignment(Component child)
Gets the vertical position of a label relative to its control.

See Also:
setLabelVerticalAlignment
 o setLabelVerticalAlignment
 public void setLabelVerticalAlignment(Component child,
                                       int align)
Sets the vertical position of a label relative to its control.

Parameters:
align - BWTEnum.TOP, MIDDLE (default), or BOTTOM.
Throws: IllegalArgumentException
If an invalid value is set
 o getResizeWidth
 public boolean getResizeWidth(Component child)
Gets the component's RezizeWidth value.

See Also:
setResizeWidth
 o setResizeWidth
 public void setResizeWidth(Component child,
                            boolean v)
Sets whether the control should be resized horizontally to its parent's right edge if it is in the last column (default: false).

 o getResizeHeight
 public boolean getResizeHeight(Component child)
Gets the component's RezizeHeight value.

See Also:
setResizeHeight
 o setResizeHeight
 public void setResizeHeight(Component child,
                             boolean v)
Sets whether the control should be resized vertically to the height of the largest component in its row (default: false). This value is ignored for labels (the components in odd columns).

 o reshape
 protected void reshape(int pos,
                        int row,
                        int col,
                        Component comp,
                        int x,
                        int y,
                        int col_width,
                        int row_height)
Positions the component.

Parameters:
pos - the component's index in its parents child list
row,col - component's position
Overrides:
reshape in class JCGridLayout

All Packages  Class Hierarchy  This Package  Previous  Next  Index