public class AlignLayout extends ENHGridLayout
| Modifier and Type | Field and Description |
|---|---|
protected Hashtable |
alignment |
static int |
BOTTOM |
static int |
MIDDLE |
protected Hashtable |
resize_height |
protected Hashtable |
resize_width |
static int |
TOP |
col_widths, cols, hgap, row_heights, rows, VARIABLE, vgap| Constructor and 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.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLabelVerticalAlignment(Component child)
Gets the vertical position of a label relative to its control.
|
boolean |
getResizeHeight(Component child)
Gets the component's RezizeHeight value.
|
boolean |
getResizeWidth(Component child)
Gets the component's RezizeWidth value.
|
protected boolean |
isLabel(int col) |
protected void |
setBounds(int pos,
int row,
int col,
Component comp,
int x,
int y,
int col_width,
int row_height) |
void |
setLabelVerticalAlignment(Component child,
int align)
Sets the vertical position of a label relative to its control.
|
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).
|
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).
|
getGridSizes, layoutContainer, minimumLayoutSize, preferredLayoutSizeaddLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toStringprotected Hashtable alignment
protected Hashtable resize_width
protected Hashtable resize_height
public static final int TOP
public static final int MIDDLE
public static final int BOTTOM
public AlignLayout()
public AlignLayout(int cols,
int hgap,
int vgap)
cols - the number of columns (should be a multiple of 2)hgap - the horizontal gap variablevgap - the vertical gap variableIllegalArgumentException - If the rows and columns are invalid.public int getLabelVerticalAlignment(Component child)
child - componentpublic void setLabelVerticalAlignment(Component child, int align)
child - componentalign - TOP, MIDDLE (default), or BOTTOM.IllegalArgumentException - If an invalid value is setpublic boolean getResizeWidth(Component child)
child - componentpublic void setResizeWidth(Component child, boolean v)
child - componentv - flagpublic boolean getResizeHeight(Component child)
child - componentpublic void setResizeHeight(Component child, boolean v)
child - componentv - flagprotected boolean isLabel(int col)
protected void setBounds(int pos,
int row,
int col,
Component comp,
int x,
int y,
int col_width,
int row_height)
setBounds in class ENHGridLayoutCopyright © 2018. All rights reserved.