|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uic.zaval.layout.Constraints
public class Constraints
In finding a place in the grid of the NaturalLayout you can add a Constraints object add adding the widget to the parent.
JPanel parent = new JPanel(new NaturalLayout(10, 10)); parent.add(myChildWidget, new Constraint("0,0");
The different constructors in this class will give you more hints to the options you have. The most convenient method of adding a widget is using the constructor that takes a formatted String. You can even leave away the invocation of a new Constraints object so your add could look like:
parent.add(myChildWidget, "1,0, 2,0");
NaturalLayout
Field Summary | |
---|---|
static char |
ALIGN_HORIZONTAL_CENTER
|
static char |
ALIGN_HORIZONTAL_FILLED
|
static char |
ALIGN_HORIZONTAL_LEFT
|
static char |
ALIGN_HORIZONTAL_RIGHT
|
static char |
ALIGN_VERTICAL_BOTTOM
|
static char |
ALIGN_VERTICAL_CENTER
|
static char |
ALIGN_VERTICAL_FILLED
|
static char |
ALIGN_VERTICAL_TOP
|
protected int |
col1
Cell in which the upper left corner of the component lays |
protected int |
col2
Cell in which the lower right corner of the component lays |
protected int |
hAlign
justification |
protected int |
row1
Cell in which the upper left corner of the component lays |
protected int |
row2
Cell in which the lower right corner of the component lays |
protected int |
vAlign
justification |
Constructor Summary | |
---|---|
Constraints()
Constructs an Constraints with the default settings. |
|
Constraints(int col1,
int row1,
int col2,
int row2,
int hAlign,
int vAlign)
Constructs an Constraints a set of constraints. |
|
Constraints(String constraints)
Constructs an Constraints from a string. |
Method Summary | |
---|---|
int |
getHorizontalAlignment()
|
int |
getLastColumn()
|
int |
getLastRow()
|
int |
getStartColumn()
|
int |
getStartRow()
|
int |
getVerticalAlignment()
|
void |
setHorizontalAlignment(int hAlign)
|
void |
setLastColumn(int col)
|
void |
setLastRow(int row)
|
void |
setStartColumn(int col)
|
void |
setStartRow(int row)
|
void |
setVerticalAlignment(int vAlign)
|
String |
toString()
Gets a string representation of this Constraints. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char ALIGN_HORIZONTAL_LEFT
public static final char ALIGN_HORIZONTAL_RIGHT
public static final char ALIGN_HORIZONTAL_CENTER
public static final char ALIGN_HORIZONTAL_FILLED
public static final char ALIGN_VERTICAL_TOP
public static final char ALIGN_VERTICAL_BOTTOM
public static final char ALIGN_VERTICAL_CENTER
public static final char ALIGN_VERTICAL_FILLED
protected int col1
protected int row1
protected int col2
protected int row2
protected int hAlign
protected int vAlign
Constructor Detail |
---|
public Constraints()
public Constraints(String constraints)
constraints
- indicates Constraints's position and justification
as a string in the form "column, row" or
"column, row, horizontal justification, vertical
justification" or "column 1, row 1, column 2, row 2".
It is also acceptable to delimit the paramters with
spaces instead of commas.public Constraints(int col1, int row1, int col2, int row2, int hAlign, int vAlign)
col1
- column where upper-left cornor of the component is placedrow1
- row where upper-left cornor of the component is placedcol2
- column where lower-right cornor of the component is placedrow2
- row where lower-right cornor of the component is placedhAlign
- horizontal justification of a component in a single cellvAlign
- vertical justification of a component in a single cellMethod Detail |
---|
public String toString()
toString
in class Object
public int getStartRow()
public void setStartRow(int row)
row
- the value to set.public int getStartColumn()
public void setStartColumn(int col)
col
- the value to set.public int getLastRow()
public void setLastRow(int row)
row
- the value to set.public int getLastColumn()
public void setLastColumn(int col)
col
- the value to set.public int getVerticalAlignment()
public void setVerticalAlignment(int vAlign)
vAlign
- the value to set.public int getHorizontalAlignment()
public void setHorizontalAlignment(int hAlign)
hAlign
- the value to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |