com.extjs.gxt.ui.client.util
Class Rectangle

java.lang.Object
  extended by com.extjs.gxt.ui.client.util.Rectangle

public class Rectangle
extends java.lang.Object

Represents an area in a coordinate system.

See Also:
Point

Field Summary
 int height
          The height of the rectangle.
 int width
          The width of the rectangle.
 int x
          The x coordinate.
 int y
          The y coordinate.
 
Constructor Summary
Rectangle()
          Create a new rectangle instance.
Rectangle(int x, int y, int width, int height)
          Creates a new rectangle instance.
 
Method Summary
 boolean contains(int x, int y)
          Returns true if the point is within the rectangle's region.
 boolean contains(Point p)
          Returns true if the point is within the rectangle.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public int x
The x coordinate.


y

public int y
The y coordinate.


width

public int width
The width of the rectangle.


height

public int height
The height of the rectangle.

Constructor Detail

Rectangle

public Rectangle()
Create a new rectangle instance.


Rectangle

public Rectangle(int x,
                 int y,
                 int width,
                 int height)
Creates a new rectangle instance.

Parameters:
x - the x value
y - the y value
width - the rectangle's width
height - the rectangle's height
Method Detail

contains

public boolean contains(int x,
                        int y)
Returns true if the point is within the rectangle's region.

Parameters:
x - the x coordinate value
y - the y coordinate value
Returns:
true if xy is contained within the rectangle

contains

public boolean contains(Point p)
Returns true if the point is within the rectangle.

Parameters:
p - the point
Returns:
true if the point is contained within the rectangle

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object