borland.jbcl Packages  borland.jbcl Class Hierarchy  borland.jbcl.layout 

XYConstraints component

java.lang.Object
   +----borland.jbcl.layout.XYConstraints

About the XYConstraints component

Constructors  Properties  Methods  

Implements Cloneable

The XYConstraints object is the constraint object created when a component is added to an XYLayout. The constraints are the x and y coordinates that position the upper-left corner of the control relative to the container, and the width and height of the control.

See also: XYLayout


XYConstraints constructors

XYConstraints properties

*Read-only properties **Write-only properties

Properties implemented in this class

Properties implemented in java.lang.Object

XYConstraints methods

Methods implemented in this class

Methods implemented in java.lang.Object


XYConstraints constructors

XYConstraints()

  public XYConstraints()
Constructs an XYConstraints object.

XYConstraints(int, int, int, int)

  public XYConstraints(int x, int y, int width, int height)
Constructs an XYConstraints object using the constraints passed to this constructor.

Parameters:

x
The x coordinate that specifies the number of pixels from the left edge of the container.
y
The y coordinate that specifies the number of pixels from the top edge of the container.
width
The width of the control added to the container in pixels. A value less than or equal to 0 means that the control's preferred width is used.
height
The height of the control added to the container in pixels. A value less than or equal to 0 means that the control's preferred height is used.

XYConstraints properties

height

 public int getHeight()
 public void setHeight(int height)
Retrieves and sets the height of the control in pixels.

Parameters:

height
The height of the control added to the container in pixels. A value less than or equal to 0 means that the control's preferred height is used.

width

 public int getWidth()
 public void setWidth(int width)
Retrieves and sets the width of the control in pixels.

Parameters:

width
The width of the control added to the container in pixels. A value less than or equal to 0 means that the control's preferred width is used.

x

 public int getX()
 public void setX(int x)
Retrieves and sets the distance from the left side of the container in pixels.

Parameters:

x
The distance in pixels from the left edge of the container.

y

 public int getY()
 public void setY(int y)
Retrieves and sets the distance from the top of the container in pixels.

Parameters:

y
The distance in pixels from the top of the container.

XYConstraints methods

clone()

  public Object clone()
Creates a copy of this XYConstraints object. The constraints are identical in both XYConstraints objects.

Overrides: java.lang.Object.clone()

equals(java.lang.Object)

  public boolean equals(java.lang.Object that)
Compares another XYConstraints object to this one. equals() returns true if the objects are equal; otherwise, equals() returns false.

Parameters:

that
The XYConstraints object being compared to this one.

Overrides: java.lang.Object.equals(Object)

hashCode()

  public int hashCode()
Returns the hashcode for this XYConstraints.

Overrides: java.lang.Object.hashCode()

toString()

  public String toString()
Returns a string that displays constraint values. This is the returned string:

"XYConstraints[" + x + "," + y + "," + width + "," + height + "]"

where x is the distance from the left edge of the container, y is the distance from the top of the container, width is the width of the control, and height is the height of the control. All of these values are in pixels.

Overrides: java.lang.Object.toString()