|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uic.layout.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 |
horizontalPolicy
sizing policies |
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 |
static String |
SIZE_POLICY_EXPANDING
|
static String |
SIZE_POLICY_FIXED
|
static String |
SIZE_POLICY_IGNORED
|
static String |
SIZE_POLICY_MAXIMUM
|
static String |
SIZE_POLICY_MINIMUM
|
static String |
SIZE_POLICY_MINIMUM_EXPANDING
|
static String |
SIZE_POLICY_PREFERRED
|
protected int |
vAlign
justification |
protected int |
verticalPolicy
sizing policies |
Constructor Summary | |
Constraints()
Constructs an Constraints with the default settings. |
|
Constraints(int col1,
int row1,
int col2,
int row2,
int hAlign,
int vAlign)
|
|
Constraints(int col1,
int row1,
int col2,
int row2,
int hAlign,
int vAlign,
int horizontalPolicy,
int verticalPolicy)
Constructs an Constraints a set of constraints. |
|
Constraints(String constraints)
Constructs an Constraints from a string. |
Method Summary | |
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
public static final String SIZE_POLICY_FIXED
public static final String SIZE_POLICY_MINIMUM
public static final String SIZE_POLICY_MAXIMUM
public static final String SIZE_POLICY_PREFERRED
public static final String SIZE_POLICY_MINIMUM_EXPANDING
public static final String SIZE_POLICY_EXPANDING
public static final String SIZE_POLICY_IGNORED
protected int col1
protected int row1
protected int col2
protected int row2
protected int hAlign
protected int vAlign
protected int horizontalPolicy
protected int verticalPolicy
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)
public Constraints(int col1, int row1, int col2, int row2, int hAlign, int vAlign, int horizontalPolicy, int verticalPolicy)
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 cellhorizontalPolicy
- the sizing policy horizontallyverticalPolicy
- the sizing policy verticallyMethod Detail |
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |