Java Platform 1.2
Beta 4

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.

Since:
JDK1.2

Inner classes inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double , Rectangle2D.Float
 
Field Summary
 double height
          The height of the rectangle.
 double width
          The width of the rectangle.
 double x
          The x coordinate of the rectangle.
 double y
          The y coordinate of the rectangle.
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM , OUT_LEFT , OUT_RIGHT , OUT_TOP
 
Constructor Summary
Rectangle2D.Double()
          Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).
Rectangle2D.Double(double x, double y, double w, double h)
          Constructs and initializes a rectangle from the specified double coordinates.
 
Method Summary
 Rectangle2D createIntersection(Rectangle2D r)
          Return a new Rectangle2D object representing the intersection of this rectangle with the given rectangle.
 Rectangle2D createUnion(Rectangle2D r)
          Return a new Rectangle2D object representing the union of this rectangle with the given rectangle.
 double getHeight()
          Returns the height of the rectangle in double precision.
 double getWidth()
          Returns the width of the rectangle in double precision.
 double getX()
          Returns the X coordinate of the rectangle in double precision.
 double getY()
          Returns the Y coordinate of the rectangle in double precision.
 boolean isEmpty()
          Determines whether the rectangle is empty.
 int outcode(double x, double y)
          Determines where the specified double coordinates lie with respect to this Rectangle.
 void setRect(double x, double y, double w, double h)
          Sets the location and size of this rectangle to the specified double values.
 void setRect(Rectangle2D r)
          Sets this rectangle to be the same as the specified Rectangle.
 String toString()
          Returns the String representation of this Rectangle.
 
Methods inherited from class java.awt.geom.Rectangle2D
add , add , add , contains , contains , equals , getBounds2D , getPathIterator , getPathIterator , intersect , intersects , intersectsLine , intersectsLine , outcode , setFrame , union
 
Methods inherited from class java.awt.geom.RectangularShape
clone , contains , contains , getBounds , getCenterX , getCenterY , getFrame , getMaxX , getMaxY , getMinX , getMinY , intersects , setFrame , setFrame , setFrameFromCenter , setFrameFromCenter , setFrameFromDiagonal , setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait
 

Field Detail

x

public double x
The x coordinate of the rectangle.
Since:
JDK1.2

y

public double y
The y coordinate of the rectangle.
Since:
JDK1.2

width

public double width
The width of the rectangle.
Since:
JDK1.2

height

public double height
The height of the rectangle.
Since:
JDK1.2
Constructor Detail

Rectangle2D.Double

public Rectangle2D.Double()
Constructs a new rectangle, initialized to location (0, 0) and size (0, 0).
Since:
JDK1.2

Rectangle2D.Double

public Rectangle2D.Double(double x,
                          double y,
                          double w,
                          double h)
Constructs and initializes a rectangle from the specified double coordinates.
Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the rectangle
height - the height of the rectangle
Since:
JDK1.2
Method Detail

getX

public double getX()
Returns the X coordinate of the rectangle in double precision.
Overrides:
getX in class RectangularShape
Since:
JDK1.2

getY

public double getY()
Returns the Y coordinate of the rectangle in double precision.
Overrides:
getY in class RectangularShape
Since:
JDK1.2

getWidth

public double getWidth()
Returns the width of the rectangle in double precision.
Overrides:
getWidth in class RectangularShape
Since:
JDK1.2

getHeight

public double getHeight()
Returns the height of the rectangle in double precision.
Overrides:
getHeight in class RectangularShape
Since:
JDK1.2

isEmpty

public boolean isEmpty()
Determines whether the rectangle is empty.
Overrides:
isEmpty in class RectangularShape
Since:
JDK1.2

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
Since:
JDK1.2

setRect

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

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
Since:
JDK1.2
See Also:
Rectangle2D.OUT_LEFT, Rectangle2D.OUT_TOP, Rectangle2D.OUT_RIGHT, Rectangle2D.OUT_BOTTOM

createIntersection

public Rectangle2D createIntersection(Rectangle2D r)
Return a new Rectangle2D object representing the intersection of this rectangle with the given rectangle.
Parameters:
r - the rectangle to be intersected with
Returns:
the largest rectangle contained in both the specified rectangle and in this rectangle
Overrides:
createIntersection in class Rectangle2D
Since:
JDK1.2

createUnion

public Rectangle2D createUnion(Rectangle2D r)
Return a new Rectangle2D object representing the union of this rectangle with the given rectangle.
Parameters:
r - the rectangle to be combined with
Returns:
the smallest rectangle containing both the specified rectangle and this rectangle.
Overrides:
createUnion in class Rectangle2D
Since:
JDK1.2

toString

public String toString()
Returns the String representation of this Rectangle.
Overrides:
toString in class Object
Since:
JDK1.2

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.