All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.geom.Rectangle2D.Double

java.lang.Object
    |
    +----java.awt.geom.RectangularShape
            |
            +----java.awt.geom.Rectangle2D
                    |
                    +----java.awt.geom.Rectangle2D.Double

public static class Rectangle2D.Double
extends Rectangle2D
A rectangle specified in double coordinates.


Variable Index

 o height
The height of the rectangle.
 o width
The width of the rectangle.
 o x
The x coordinate of the rectangle.
 o y
The y coordinate of the rectangle.

Constructor Index

 o Rectangle2D.Double()
Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).
 o Rectangle2D.Double(double, double, double, double)
Constructs and initializes a rectangle from the specified coordinates.

Method Index

 o getHeight()
Returns the height of the rectangle in double precision.
 o getWidth()
Returns the width of the rectangle in double precision.
 o getX()
Returns the X coordinate of the rectangle in double precision.
 o getY()
Returns the Y coordinate of the rectangle in double precision.
 o isEmpty()
Determines whether the rectangle is empty.
 o outcode(double, double)
Determines where the specified double coordinates lie with respect to this Rectangle.
 o setRect(double, double, double, double)
Sets the location and size of this rectangle to the specified double values.
 o setRect(Rectangle2D)
Sets this rectangle to be the same as the specified Rectangle.
 o toString()
Returns the String representation of this Rectangle.

Variables

 o x
public double x
The x coordinate of the rectangle.

 o y
public double y
The y coordinate of the rectangle.

 o width
public double width
The width of the rectangle.

 o height
public double height
The height of the rectangle.

Constructors

 o Rectangle2D.Double
public Rectangle2D.Double()
Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).

 o Rectangle2D.Double
public Rectangle2D.Double(double x,
                          double y,
                          double w,
                          double h)
Constructs and initializes a rectangle from the specified coordinates.

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

Methods

 o getX
public double getX()
Returns the X coordinate of the rectangle in double precision.

Overrides:
getX in class RectangularShape
 o getY
public double getY()
Returns the Y coordinate of the rectangle in double precision.

Overrides:
getY in class RectangularShape
 o getWidth
public double getWidth()
Returns the width of the rectangle in double precision.

Overrides:
getWidth in class RectangularShape
 o getHeight
public double getHeight()
Returns the height of the rectangle in double precision.

Overrides:
getHeight in class RectangularShape
 o isEmpty
public boolean isEmpty()
Determines whether the rectangle is empty.

Overrides:
isEmpty in class RectangularShape
 o setRect
public void setRect(double x,
                    double y,
                    double w,
                    double h)
Sets the location and size of this rectangle to the specified double values.

Overrides:
setRect in class Rectangle2D
 o setRect
public void setRect(Rectangle2D r)
Sets this rectangle to be the same as the specified Rectangle.

Overrides:
setRect in class Rectangle2D
 o outcode
public int outcode(double x,
                   double y)
Determines where the specified double coordinates lie with respect to this Rectangle. This method computes a binary OR of the appropriate mask values indicating which sides of the rectangle the given point is outside of.

Returns:
the logical OR of all appropriate out codes
Overrides:
outcode in class Rectangle2D
See Also:
OUT_LEFT, OUT_TOP, OUT_RIGHT, OUT_BOTTOM
 o toString
public String toString()
Returns the String representation of this Rectangle.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature