All Packages Class Hierarchy This Package Previous Next Index
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.
height- The height of the rectangle.
width- The width of the rectangle.
x- The x coordinate of the rectangle.
y- The y coordinate of the rectangle.
Rectangle2D.Float()
- Constructs a new rectangle, initialized to location (0.0, 0.0) and
size (0.0, 0.0).
Rectangle2D.Float(float, float, float, float)
- Constructs and initializes a rectangle from the specified coordinates.
getHeight()
- Returns the height of the rectangle in double precision.
getWidth()
- Returns the width of the rectangle in double precision.
getX()
- Returns the X coordinate of the rectangle in double precision.
getY()
- Returns the Y coordinate of the rectangle in double precision.
isEmpty()
- Determines whether the rectangle is empty.
outcode(double, double)
- Determines where the specified float coordinates lie with respect
to this Rectangle.
setRect(double, double, double, double)
- Sets the location and size of this rectangle to the specified
double values.
setRect(float, float, float, float)
- Sets the location and size of this rectangle to the specified
float values.
setRect(Rectangle2D)
- Sets this rectangle to be the same as the specified Rectangle.
toString()
- Returns the String representation of this Rectangle.
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.
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 coordinates.
- Parameters:
- x - the x coordinate
- y - the y coordinate
- width - the width of the rectangle
- height - the height of the rectangle
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
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