    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

##

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

##

getLabelDefaultAlignment()
  Gets the default label alignment.
getLabelVerticalAlignment(Component)
  Gets the vertical position of a label relative to its control.
getResizeHeight(Component)
  Gets the component's RezizeHeight value.
getResizeWidth(Component)
  Gets the component's RezizeWidth value.
reshape(int, int, int, Component, int, int, int, int)
  Positions the component.
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
setLabelVerticalAlignment(Component, int)
  Sets the vertical position of a label relative to its control.
setResizeHeight(Component, boolean)
  Sets whether the control should be resized vertically to the height of the largest component in its row (default: false).
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).

##

JCAlignerLayout

      public JCAlignerLayout()

  Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.

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.

##

getLabelDefaultAlignment

      public int getLabelDefaultAlignment()

  Gets the default label alignment.

  See Also:
    setLabelDefaultAlignment

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

getLabelVerticalAlignment

      public int getLabelVerticalAlignment(Component child)

  Gets the vertical position of a label relative to its control.

  See Also:
    setLabelVerticalAlignment

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

getResizeWidth

      public boolean getResizeWidth(Component child)

  Gets the component's RezizeWidth value.

  See Also:
    setResizeWidth

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).

getResizeHeight

      public boolean getResizeHeight(Component child)

  Gets the component's RezizeHeight value.

  See Also:
    setResizeHeight

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).

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