public class TableLayoutConstraints
extends java.lang.Object
implements java.io.Serializable
We use the convention of specifying row before column to conform with the swing standards. This seems counterintuitive when specifying x,y (actually y,x) co-ordinates however we felt it was more important to conform to existing java layout standards.
| Modifier and Type | Field and Description |
|---|---|
private int |
column_ |
private int |
columnSpan_ |
private int |
horizontalAlignment_ |
private boolean |
horizontalStretch_ |
private boolean |
isImmutable_ |
private boolean |
obeyMaximumSize_ |
private boolean |
obeyMinimumSize_ |
private int |
row_ |
private int |
rowSpan_ |
private static long |
serialVersionUID |
private int |
verticalAlignment_ |
private boolean |
verticalStretch_ |
| Constructor and Description |
|---|
TableLayoutConstraints(int row,
int column)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
assertNotNull(java.lang.String fieldName,
java.lang.Object fieldValue)
Verify that the specified value is not null.
|
private void |
ensureMutable()
Check to make sure that we are allowed to modify this object.
|
int |
getColumn()
Return the column.
|
int |
getColumnSpan()
Return the number of columns this component will span.
|
int |
getHorizontalAlignment()
Return the horizontalAlignment.
|
boolean |
getHorizontalStretch()
Return true if this component can be stretched horizontally.
|
boolean |
getObeyMaximumSize()
Return true if we are obeying the maximum size.
|
boolean |
getObeyMinimumSize()
Return true if we are obeying the minimum size.
|
int |
getRow()
Return the row.
|
int |
getRowSpan()
Return the number of rows this component will span.
|
int |
getVerticalAlignment()
Return the vertical alignment.
|
boolean |
getVerticalStretch()
Return true if this component can be stretched vertically.
|
boolean |
isImmutable()
Return true if this object is immutable.
|
static TableLayoutConstraints |
makeConstraints(java.lang.String constraintString)
Create an instance of TableLayoutConstraints from the specified string.
|
private static void |
parseConstraintString(TableLayoutConstraints constraints,
java.lang.String constraintString,
boolean isRow)
Parse the constraint string.
|
void |
setColumn(int column)
Set the column.
|
void |
setColumnSpan(int span)
Set the number of columns that this component will span.
|
void |
setHorizontalAlignment(int alignment)
Set the horizontal alignment of the component within the specified
area.
|
void |
setHorizontalStretch(boolean stretch)
Set whether or not this component can be stretched horizontally.
|
void |
setImmutable()
Make this object immutable.
|
void |
setObeyMaximumSize(boolean obey)
Set whether or not the component should obey it's maximum size.
|
void |
setObeyMinimumSize(boolean obey)
Set whether or not we should obey the minimum size of the component.
|
void |
setRow(int row)
Set the row.
|
void |
setRowSpan(int span)
Set the number of rows that this component will span.
|
void |
setVerticalAlignment(int alignment)
Set the vertical alignment of the component within the specified area.
|
void |
setVerticalStretch(boolean stretch)
Set whether or not this component can be stretched vertically.
|
java.lang.String |
toString()
Return a string representation of this object.
|
private static final long serialVersionUID
private boolean isImmutable_
private boolean obeyMaximumSize_
private boolean obeyMinimumSize_
private int row_
private int column_
private int rowSpan_
private int columnSpan_
private int verticalAlignment_
private boolean verticalStretch_
private int horizontalAlignment_
private boolean horizontalStretch_
public TableLayoutConstraints(int row,
int column)
row - The starting row.column - The starting column.public final java.lang.String toString()
toString in class java.lang.Objectpublic final void setImmutable()
public final boolean isImmutable()
private void ensureMutable()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - If the object is immutablepublic final void setRow(int row)
row - The row.public final int getRow()
public final void setColumn(int column)
column - The new column.public final int getColumn()
public final void setRowSpan(int span)
span - The new row span.public final int getRowSpan()
public final void setColumnSpan(int span)
span - The new span.public final int getColumnSpan()
public final void setVerticalAlignment(int alignment)
alignment - The new alignment.public final int getVerticalAlignment()
public final void setHorizontalAlignment(int alignment)
alignment - The new alignment.public final int getHorizontalAlignment()
public final void setVerticalStretch(boolean stretch)
stretch - true if the component will stretch vertically.public final boolean getVerticalStretch()
public final void setHorizontalStretch(boolean stretch)
stretch - true if the component will stretch horizontally.public final boolean getHorizontalStretch()
public final void setObeyMaximumSize(boolean obey)
obey - true if we are to obey the maximum size.public final boolean getObeyMaximumSize()
public final void setObeyMinimumSize(boolean obey)
obey - true if we are to obey the minimum size.public final boolean getObeyMinimumSize()
public static TableLayoutConstraints makeConstraints(java.lang.String constraintString)
constraintString - The constraints string.private static void parseConstraintString(TableLayoutConstraints constraints, java.lang.String constraintString, boolean isRow)
constraints - The new constraints objectconstraintString - The constraints as an input stringisRow - true if these constraints are for a rowprotected static final void assertNotNull(java.lang.String fieldName,
java.lang.Object fieldValue)
throws DetailedNullPointerException
fieldName - The name of the field to checkfieldValue - The value of the field to checkDetailedNullPointerException - If fieldValue is null