com.sencha.gxt.core.client.util
Class PreciseRectangle

java.lang.Object
  extended by com.sencha.gxt.core.client.util.PreciseRectangle

public class PreciseRectangle
extends java.lang.Object

Represents a double precision area in a coordinate system.


Constructor Summary
PreciseRectangle()
          Creates a double precision rectangle.
PreciseRectangle(double x, double y, double width, double height)
          Creates a double precision rectangle.
PreciseRectangle(Rectangle rectangle)
          Creates a double precision rectangle using the given Rectangle.
 
Method Summary
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double tolerance)
          Returns true if the point is within the rectangle's region.
 boolean contains(PrecisePoint p)
          Returns true if the point is within the rectangle.
 boolean contains(PrecisePoint p, double tolerance)
           
 double getHeight()
          Returns the height of the rectangle.
 double getWidth()
          Returns the width of the rectangle.
 double getX()
          Returns the x-coordinate of the rectangle.
 double getY()
          Returns the y-coordinate of the rectangle.
 void setHeight(double height)
          Sets the height of the rectangle.
 void setWidth(double width)
          Sets the width of the rectangle.
 void setX(double x)
          Sets the x-coordinate of the rectangle.
 void setY(double y)
          Sets the y-coordinate of the rectangle.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PreciseRectangle

public PreciseRectangle()
Creates a double precision rectangle.


PreciseRectangle

public PreciseRectangle(double x,
                        double y,
                        double width,
                        double height)
Creates a double precision rectangle.

Parameters:
x - the x-coordinate of the rectangle
y - the y-coordinate of the rectangle
width - the width of the rectangle
height - the height of the rectangle

PreciseRectangle

public PreciseRectangle(Rectangle rectangle)
Creates a double precision rectangle using the given Rectangle.

Parameters:
rectangle - the rectangle to use as reference
Method Detail

contains

public boolean contains(double x,
                        double y,
                        double tolerance)
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(PrecisePoint p)
Returns true if the point is within the rectangle.

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

contains

public boolean contains(PrecisePoint p,
                        double tolerance)

contains

public boolean contains(double x,
                        double y)

getX

public double getX()
Returns the x-coordinate of the rectangle.

Returns:
the x-coordinate of the rectangle

setX

public void setX(double x)
Sets the x-coordinate of the rectangle.

Parameters:
x - the x-coordinate of the rectangle

getY

public double getY()
Returns the y-coordinate of the rectangle.

Returns:
the y-coordinate of the rectangle

setY

public void setY(double y)
Sets the y-coordinate of the rectangle.

Parameters:
y - the y-coordinate of the rectangle

getWidth

public double getWidth()
Returns the width of the rectangle.

Returns:
the width of the rectangle

setWidth

public void setWidth(double width)
Sets the width of the rectangle.

Parameters:
width - the width of the rectangle

getHeight

public double getHeight()
Returns the height of the rectangle.

Returns:
the height of the rectangle

setHeight

public void setHeight(double height)
Sets the height of the rectangle.

Parameters:
height - the height of the rectangle

toString

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


Copyright © 2012. All Rights Reserved.