matthew.awt
Class StrutLayout.StrutConstraint
java.lang.Object
|
+--matthew.awt.StrutLayout.StrutConstraint
- public static final class StrutLayout.StrutConstraint
- extends java.lang.Object
Represents a strut constraint placed on the location of a
component. Each component has nine logical connector points which
may be connected by struts to other components.

Each strut goes from a parent component to a child
and has a set direction and length.
Example:
panel.add (nameField, new StrutLayout.StrutConstraint
(nameLabel, StrutLayout.MID_RIGHT, StrutLayout.MID_LEFT,
StrutLayout.EAST));
- See Also:
StrutLayout.addLayoutComponent(java.awt.Component, java.lang.Object),
StrutLayout.Strut
|
Constructor Summary |
StrutLayout.StrutConstraint(java.awt.Component parent,
int fromConnector,
int toConnector,
int direction)
Create a strut between connection points on a parent and a
child component. |
StrutLayout.StrutConstraint(java.awt.Component parent,
int fromConnector,
int toConnector,
int direction,
int length)
Create a strut between connection points on a parent and a
child component. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
parent
public java.awt.Component parent
fromConnector
public int fromConnector
toConnector
public int toConnector
length
public int length
direction
public int direction
StrutLayout.StrutConstraint
public StrutLayout.StrutConstraint(java.awt.Component parent,
int fromConnector,
int toConnector,
int direction,
int length)
- Create a strut between connection points on a parent and a
child component.
- Parameters:
parent - The component the connector starts from.fromConnector - The connector point on the parent that the
strut is connected to (eg. TOP_LEFT).toConnector - The connector point on the child that the
strut is connected to (eg. TOP_RIGHT).direction - The direction that the strut points
(eg. NORTH).length - The length (in pixels) of the strut along the x
and/or y axes. Thus a NORTH_WEST strut of length 5 will
actually extend 7 pixels diagonally, while a NORTH strut will
extend 5 pixels vertically.- See Also:
StrutLayout.StrutConstraint#StrutConstraint(java.awt.Component, int, int, int),
StrutLayout.VectorConstraint,
StrutLayout.TOP_LEFT,
StrutLayout.MID_TOP,
StrutLayout.TOP_RIGHT,
StrutLayout.MID_RIGHT,
StrutLayout.BOTTOM_RIGHT,
StrutLayout.MID_BOTTOM,
StrutLayout.BOTTOM_LEFT,
StrutLayout.MID_LEFT,
StrutLayout.CENTER,
StrutLayout.NORTH,
StrutLayout.SOUTH,
StrutLayout.EAST,
StrutLayout.WEST,
StrutLayout.NORTH_WEST,
StrutLayout.NORTH_EAST,
StrutLayout.SOUTH_WEST,
StrutLayout.SOUTH_EAST
StrutLayout.StrutConstraint
public StrutLayout.StrutConstraint(java.awt.Component parent,
int fromConnector,
int toConnector,
int direction)
- Create a strut between connection points on a parent and a
child component. The horizontal and/or vertical lengths of the
strut are set to the default defined by
getDefaultStrutLength().
- Parameters:
parent - The component the connector starts from.fromConnector - The connector point on the parent
component that the strut is connected to (eg. TOP_LEFT).toConnector - The connector point on the child component
that the strut is connected to (eg. TOP_RIGHT).direction - The direction that the strut extends
(eg. SOUTH).- See Also:
StrutLayout.StrutConstraint#StrutConstraint(java.awt.Component, int, int, int, int),
StrutLayout.getDefaultStrutLength(),
StrutLayout.VectorConstraint,
StrutLayout.TOP_LEFT,
StrutLayout.MID_TOP,
StrutLayout.TOP_RIGHT,
StrutLayout.MID_RIGHT,
StrutLayout.BOTTOM_RIGHT,
StrutLayout.MID_BOTTOM,
StrutLayout.BOTTOM_LEFT,
StrutLayout.MID_LEFT,
StrutLayout.CENTER,
StrutLayout.NORTH,
StrutLayout.SOUTH,
StrutLayout.EAST,
StrutLayout.WEST,
StrutLayout.NORTH_WEST,
StrutLayout.NORTH_EAST,
StrutLayout.SOUTH_WEST,
StrutLayout.SOUTH_EAST