Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.geom.Rectangle2D.Float

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

public static class Rectangle2D.Float
extends Rectangle2D
A rectangle specified in float coordinates.

Since:
JDK1.2

Inner classes inherited from class java.awt.geom.Rectangle2D
 Rectangle2D.Double, Rectangle2D.Float
 

Field Summary
float  height
The height of the rectangle.
float  width
The width of the rectangle.
float  x
The x coordinate of the rectangle.
float  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.Float()
Constructs a new rectangle, initialized to location (0.0, 0.0) and size (0.0, 0.0).
 Rectangle2D.Float(float x, float y, float w, float h)
Constructs and initializes a rectangle from the specified float 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 float coordinates lie with respect to this Rectangle.
void  setRect(float x, float y, float w, float h)
Sets the location and size of this rectangle to the specified float values.
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, createIntersection, createUnion, equals, getBounds2D, getPathIterator, getPathIterator, intersect, intersects, intersectsLine, intersectsLine, outcode, outcode, setBounds, setRect, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
 clone, contains, contains, getBottom, getBounds, getCenterX, getCenterY, getHeight, getLeft, getPathIterator, getRight, getTop, getWidth, getX, getY, intersects, isEmpty, setBounds, setBounds, setBounds, setBoundsFromCenter, setBoundsFromCenter, setBoundsFromDiagonal, setBoundsFromDiagonal
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public float x
The x coordinate of the rectangle.

y

public float y
The y coordinate of the rectangle.

width

public float width
The width of the rectangle.

height

public float height
The height of the rectangle.
Constructor Detail

Rectangle2D.Float

public Rectangle2D.Float()
Constructs a new rectangle, initialized to location (0.0, 0.0) and size (0.0, 0.0).

Rectangle2D.Float

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

getX

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

getY

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

getWidth

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

getHeight

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

isEmpty

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

setRect

public void setRect(float x,
                    float y,
                    float w,
                    float h)
Sets the location and size of this rectangle to the specified float values.

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

setRect

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

outcode

public int outcode(double x,
                   double y)
Determines where the specified float 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

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

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

toString

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

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

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.