Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce
Class FormConstraints

java.lang.Object
  extended by org.bounce.FormConstraints

public class FormConstraints
extends java.lang.Object

A constraints object, used for the FormLayout, the constraints allow for setting the components position, alignments and fill type.

Version:
$Revision: 1.4 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Field Summary
static int BOTTOM
          BOTTOM position
static int CENTER
          CENTER position
static int FULL
          FULL position
static int LEFT
          LEFT position
static int RIGHT
          RIGHT position
static int TOP
          TOP position
 
Constructor Summary
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
 boolean equals(java.lang.Object object)
          Finds out if the values in this FormConstraint are equal to the supplied object.
 int getHorizontalAlignment()
          Returns the horizontal alignment for the component.
 int getPosition()
          Returns the column position of the component.
 int getVerticalAlignment()
          Returns the vertical alignment for the component.
 boolean isFilled()
          Returns wether the component occupies the full available horizontal space.
 void setFilled(boolean enabled)
          Sets wether the component should occupy the full available horizontal space.
 void setHorizontalAlignment(int alignment)
          Sets the horizontal alignment for the component.
 void setPosition(int position)
          Sets the column position of the component; LEFT, for a component in the left column.
 void setVerticalAlignment(int alignment)
          Sets the vertical alignment for the component.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
equals in class java.lang.Object
Parameters:
object - the object to test.
Returns:
true when equal.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.