Package com.cloudgarden.layout
Class AnchorConstraint
java.lang.Object
com.cloudgarden.layout.AnchorConstraint
Used by both AnchorLayout (SWT) and AnchorLayoutManager (Swing)
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
(Absolute anchor) Meaning: This side is anchored a fixed distance in pixels (given by the value for this side) from it's parent's respective side.static int
Meaning: This side is not anchored.static int
(Relative anchor) Meaning: This side is anchored so that it always occurs a fixed fraction of the distance along it's parent's side.int
int
int
int
int
int
int
int
-
Constructor Summary
ConstructorDescriptionAnchorConstraint(int top, int right, int bottom, int left, int topType, int rightType, int bottomType, int leftType)
Creates an AnchorConstraint. -
Method Summary
-
Field Details
-
ANCHOR_NONE
public static final int ANCHOR_NONEMeaning: This side is not anchored.- See Also:
- Constant Field Values
-
ANCHOR_REL
public static final int ANCHOR_REL(Relative anchor) Meaning: This side is anchored so that it always occurs a fixed fraction of the distance along it's parent's side. The position is calculated by the formula " position = (parent side)*(value)/1000 " so for instance if top=100 and topType == ANCHOR_REL then the value of y for this side would be (parent height)*top/1000.- See Also:
- Constant Field Values
-
ANCHOR_ABS
public static final int ANCHOR_ABS(Absolute anchor) Meaning: This side is anchored a fixed distance in pixels (given by the value for this side) from it's parent's respective side. For instance, if bottomType == ANCHOR_ABS and bottom = 100 then the bottom side of this component will remain fixed 100 pixels from the bottom side of it's parent container.- See Also:
- Constant Field Values
-
top
public int top -
bottom
public int bottom -
left
public int left -
right
public int right -
topType
public int topType -
bottomType
public int bottomType -
rightType
public int rightType -
leftType
public int leftType
-
-
Constructor Details
-
AnchorConstraint
public AnchorConstraint() -
AnchorConstraint
public AnchorConstraint(int top, int right, int bottom, int left, int topType, int rightType, int bottomType, int leftType)Creates an AnchorConstraint.- Parameters:
top
- - value (relative or absolute) for top sideright
- - like 'top' but for right sidebottom
- - like 'top' but for bottom sideleft
- - like 'top' but for left sidetopType
- - either ANCHOR_ABS, ANCHOR_REL or ANCHOR_NONE to indicate whether the 'top' parameter is an absolute value (in pixels) or a fractional value (in 1/1000 ths) of the height of this component's parent, denoting where the anchor will be applied (if at all).rightType
- - like 'topType' but for right sidebottomType
- - like 'topType' but for bottom sideleftType
- - like 'topType' but for left side
-