org.bounce
Class FormConstraints
- java.lang.Object
-
- org.bounce.FormConstraints
-
public class FormConstraints extends java.lang.ObjectA constraints object, used for the FormLayout, the constraints allow for setting the components position, alignments and fill type.
-
-
Field Summary
Fields Modifier and Type Field and Description static intBOTTOMBOTTOM positionstatic intCENTERCENTER positionstatic intFULLFULL positionstatic intLEFTLEFT positionstatic intRIGHTRIGHT positionstatic intTOPTOP position
-
Constructor Summary
Constructors Constructor and Description FormConstraints()Constructs a default FormConstraint which positions the component over both columns and aligns the component horizontally to the LEFT and vertically at the CENTER.FormConstraints(FormConstraints constraint)Constructs a FormConstraint which copies its values from the constraint supplied.FormConstraints(int position)Constructs a default FormConstraint which aligns the component horizontally to the LEFT and vertically at the CENTER and positions the component at the position supplied.FormConstraints(int position, boolean filled)Constructs a FormConstraint with the filled value set to the value supplied.FormConstraints(int position, int horizontalAlignment)Constructs a FormConstraint which aligns the component horizontally with the value supplied and vertically at the CENTER.FormConstraints(int position, int horizontalAlignment, int verticalAlignment)Constructs a FormConstraint which aligns the component horizontally and vertically with the values supplied.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object object)Finds out if the values in this FormConstraint are equal to the supplied object.intgetHorizontalAlignment()Returns the horizontal alignment for the component.intgetPosition()Returns the column position of the component.intgetVerticalAlignment()Returns the vertical alignment for the component.booleanisFilled()Returns wether the component occupies the full available horizontal space.voidsetFilled(boolean enabled)Sets wether the component should occupy the full available horizontal space.voidsetHorizontalAlignment(int alignment)Sets the horizontal alignment for the component.voidsetPosition(int position)Sets the column position of the component; LEFT, for a component in the left column.voidsetVerticalAlignment(int alignment)Sets the vertical alignment for the component.
-
-
-
Field Detail
-
LEFT
public static final int LEFT
LEFT position- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
BOTTOM position- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
RIGHT position- See Also:
- Constant Field Values
-
TOP
public static final int TOP
TOP position- See Also:
- Constant Field Values
-
CENTER
public static final int CENTER
CENTER position- See Also:
- Constant Field Values
-
FULL
public static final int FULL
FULL position- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FormConstraints
public FormConstraints()
Constructs a default FormConstraint which positions the component over both columns and aligns the component horizontally to the LEFT and vertically at the CENTER.
-
FormConstraints
public FormConstraints(int position)
Constructs a default FormConstraint which aligns the component horizontally to the LEFT and vertically at the CENTER and positions the component at the position supplied.- Parameters:
position- the column position of the component.
-
FormConstraints
public FormConstraints(int position, boolean filled)Constructs a FormConstraint with the filled value set to the value supplied. If the value is set to true, the alignment is no longer important.- Parameters:
position- the column position of the component.filled- whether the component should fill the available horizontal space.
-
FormConstraints
public FormConstraints(int position, int horizontalAlignment)Constructs a FormConstraint which aligns the component horizontally with the value supplied and vertically at the CENTER.- Parameters:
position- the column position of the component.horizontalAlignment- the horizontal alignment type.
-
FormConstraints
public FormConstraints(int position, int horizontalAlignment, int verticalAlignment)Constructs a FormConstraint which aligns the component horizontally and vertically with the values supplied.- Parameters:
position- the column position of the component.horizontalAlignment- the horizontal alignment type.verticalAlignment- the vertical alignment type.
-
FormConstraints
public FormConstraints(FormConstraints constraint)
Constructs a FormConstraint which copies its values from the constraint supplied.- Parameters:
constraint- the form constraint to copy the values from.
-
-
Method Detail
-
setFilled
public void setFilled(boolean enabled)
Sets wether the component should occupy the full available horizontal space. The values for Horizontal and vertical alignment are discarded when the component is filled.- Parameters:
enabled- enables/disables the filling of the full space.
-
isFilled
public boolean isFilled()
Returns wether the component occupies the full available horizontal space. The values for Horizontal and vertical alignment are discarded when the component is filled.- Returns:
- the filling of the available space.
-
setHorizontalAlignment
public void setHorizontalAlignment(int alignment)
Sets the horizontal alignment for the component. The alignment can be any of the following values: LEFT, for a left aligned component. CENTER, for a center aligned component. RIGHT, for a right aligned component.- Parameters:
alignment- the horizontal alignment.
-
getHorizontalAlignment
public int getHorizontalAlignment()
Returns the horizontal alignment for the component.- Returns:
- the horizontal alignment.
- See Also:
setHorizontalAlignment(int)
-
setVerticalAlignment
public void setVerticalAlignment(int alignment)
Sets the vertical alignment for the component. The alignment can be any of the following values: TOP, for a top aligned component. CENTER, for a center aligned component. BOTTOM, for a bottom aligned component.- Parameters:
alignment- the vertical alignment.
-
getVerticalAlignment
public int getVerticalAlignment()
Returns the vertical alignment for the component.- Returns:
- the vertical alignment.
- See Also:
setVerticalAlignment(int)
-
setPosition
public void setPosition(int position)
Sets the column position of the component; LEFT, for a component in the left column. RIGHT, for a component in the right column. FULL, for a component that occupies both columns.- Parameters:
position- the column position of the component.
-
getPosition
public int getPosition()
Returns the column position of the component.- Returns:
- the column position.
- See Also:
setPosition(int)
-
equals
public boolean equals(java.lang.Object object)
Finds out if the values in this FormConstraint are equal to the supplied object.- Overrides:
equalsin classjava.lang.Object- Parameters:
object- the object to test.- Returns:
- true when equal.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG