Package org.tn5250j.tools
Class AlignLayout
- java.lang.Object
-
- java.awt.GridLayout
-
- org.tn5250j.tools.ENHGridLayout
-
- org.tn5250j.tools.AlignLayout
-
- All Implemented Interfaces:
java.awt.LayoutManager,java.io.Serializable
public class AlignLayout extends ENHGridLayout
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Hashtablealignmentstatic intBOTTOMstatic intMIDDLEprotected java.util.Hashtableresize_heightprotected java.util.Hashtableresize_widthstatic intTOP-
Fields inherited from class org.tn5250j.tools.ENHGridLayout
col_widths, cols, hgap, row_heights, rows, VARIABLE, vgap
-
-
Constructor Summary
Constructors Constructor Description AlignLayout()Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.AlignLayout(int cols, int hgap, int vgap)Creates an aligner layout with the specified number of columns and gaps.
-
Method Summary
Modifier and Type Method Description intgetLabelVerticalAlignment(java.awt.Component child)Gets the vertical position of a label relative to its control.booleangetResizeHeight(java.awt.Component child)Gets the component's RezizeHeight value.booleangetResizeWidth(java.awt.Component child)Gets the component's RezizeWidth value.protected booleanisLabel(int col)protected voidsetBounds(int pos, int row, int col, java.awt.Component comp, int x, int y, int col_width, int row_height)voidsetLabelVerticalAlignment(java.awt.Component child, int align)Sets the vertical position of a label relative to its control.voidsetResizeHeight(java.awt.Component child, boolean v)Sets whether the control should be resized vertically to the height of the largest component in its row (default: false).voidsetResizeWidth(java.awt.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).-
Methods inherited from class org.tn5250j.tools.ENHGridLayout
getGridSizes, layoutContainer, minimumLayoutSize, preferredLayoutSize
-
-
-
-
Field Detail
-
alignment
protected java.util.Hashtable alignment
-
resize_width
protected java.util.Hashtable resize_width
-
resize_height
protected java.util.Hashtable resize_height
-
TOP
public static final int TOP
- See Also:
- Constant Field Values
-
MIDDLE
public static final int MIDDLE
- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AlignLayout
public AlignLayout()
Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.
-
AlignLayout
public AlignLayout(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 variablevgap- the vertical gap variable- Throws:
java.lang.IllegalArgumentException- If the rows and columns are invalid.
-
-
Method Detail
-
getLabelVerticalAlignment
public int getLabelVerticalAlignment(java.awt.Component child)
Gets the vertical position of a label relative to its control.- Parameters:
child- component- Returns:
- number
-
setLabelVerticalAlignment
public void setLabelVerticalAlignment(java.awt.Component child, int align)Sets the vertical position of a label relative to its control.- Parameters:
child- componentalign- TOP, MIDDLE (default), or BOTTOM.- Throws:
java.lang.IllegalArgumentException- If an invalid value is set
-
getResizeWidth
public boolean getResizeWidth(java.awt.Component child)
Gets the component's RezizeWidth value.- Parameters:
child- component- Returns:
- flag
-
setResizeWidth
public void setResizeWidth(java.awt.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).- Parameters:
child- componentv- flag
-
getResizeHeight
public boolean getResizeHeight(java.awt.Component child)
Gets the component's RezizeHeight value.- Parameters:
child- component- Returns:
- flag
-
setResizeHeight
public void setResizeHeight(java.awt.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).- Parameters:
child- componentv- flag
-
isLabel
protected boolean isLabel(int col)
-
setBounds
protected void setBounds(int pos, int row, int col, java.awt.Component comp, int x, int y, int col_width, int row_height)- Overrides:
setBoundsin classENHGridLayout
-
-