java.awt.geom
Class RoundRectangle2D.Float

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.RoundRectangle2D
          extended by java.awt.geom.RoundRectangle2D.Float
All Implemented Interfaces:
Shape, Cloneable
Enclosing class:
RoundRectangle2D

public static class RoundRectangle2D.Float
extends RoundRectangle2D

A subclass of RoundRectangle which keeps its parameters as floats.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.RoundRectangle2D
RoundRectangle2D.Double, RoundRectangle2D.Float
 
Field Summary
 float archeight
          The height of the corner arc.
 float arcwidth
          The width of the corner arc.
 float height
          The height of this object.
 float width
          The width of this object.
 float x
          The x coordinate of this object.
 float y
          The y coordinate of this object.
 
Constructor Summary
RoundRectangle2D.Float()
          Construct a new instance, with all parameters set to 0.
RoundRectangle2D.Float(float x, float y, float w, float h, float arcWidth, float arcHeight)
          Construct a new instance with the given arguments.
 
Method Summary
 double getArcHeight()
          Return the arc height of this round rectangle.
 double getArcWidth()
          Return the arc width of this round rectangle.
 Rectangle2D getBounds2D()
          Returns a high precision bounding box of the shape.
 double getHeight()
          Get the height of the framing rectangle.
 double getWidth()
          Get the width of the framing rectangle.
 double getX()
          Get the x coordinate of the upper-left corner of the framing rectangle.
 double getY()
          Get the y coordinate of the upper-left corner of the framing rectangle.
 boolean isEmpty()
          Test if the shape is empty, meaning that no points are inside it.
 void setRoundRect(double x, double y, double w, double h, double arcWidth, double arcHeight)
          Set the values of this round rectangle.
 void setRoundRect(float x, float y, float w, float h, float arcWidth, float arcHeight)
          Sets the dimensions for this rounded rectangle.
 
Methods inherited from class java.awt.geom.RoundRectangle2D
contains, contains, getPathIterator, intersects, setFrame, setRoundRect
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

archeight

public float archeight
The height of the corner arc.


arcwidth

public float arcwidth
The width of the corner arc.


x

public float x
The x coordinate of this object.


y

public float y
The y coordinate of this object.


width

public float width
The width of this object.


height

public float height
The height of this object.

Constructor Detail

RoundRectangle2D.Float

public RoundRectangle2D.Float()
Construct a new instance, with all parameters set to 0.


RoundRectangle2D.Float

public RoundRectangle2D.Float(float x,
                              float y,
                              float w,
                              float h,
                              float arcWidth,
                              float arcHeight)
Construct a new instance with the given arguments.

Parameters:
x - The x coordinate
y - The y coordinate
w - The width
h - The height
arcWidth - The arc width
arcHeight - The arc height
Method Detail

getArcHeight

public double getArcHeight()
Description copied from class: RoundRectangle2D
Return the arc height of this round rectangle. The arc height and width control the roundness of the corners of the rectangle.

Specified by:
getArcHeight in class RoundRectangle2D
Returns:
The arc height.
See Also:
RoundRectangle2D.getArcWidth()

getArcWidth

public double getArcWidth()
Description copied from class: RoundRectangle2D
Return the arc width of this round rectangle. The arc width and height control the roundness of the corners of the rectangle.

Specified by:
getArcWidth in class RoundRectangle2D
Returns:
The arc width.
See Also:
RoundRectangle2D.getArcHeight()

getBounds2D

public Rectangle2D getBounds2D()
Description copied from interface: Shape
Returns a high precision bounding box of the shape. There is no guarantee that this is the minimum bounding box, but at least it never overflows.

Returns:
the shape's bounding box
See Also:
Shape.getBounds()

getX

public double getX()
Description copied from class: RectangularShape
Get the x coordinate of the upper-left corner of the framing rectangle.

Specified by:
getX in class RectangularShape
Returns:
the x coordinate

getY

public double getY()
Description copied from class: RectangularShape
Get the y coordinate of the upper-left corner of the framing rectangle.

Specified by:
getY in class RectangularShape
Returns:
the y coordinate

getWidth

public double getWidth()
Description copied from class: RectangularShape
Get the width of the framing rectangle.

Specified by:
getWidth in class RectangularShape
Returns:
the width

getHeight

public double getHeight()
Description copied from class: RectangularShape
Get the height of the framing rectangle.

Specified by:
getHeight in class RectangularShape
Returns:
the height

isEmpty

public boolean isEmpty()
Description copied from class: RectangularShape
Test if the shape is empty, meaning that no points are inside it.

Specified by:
isEmpty in class RectangularShape
Returns:
true if the shape is empty

setRoundRect

public void setRoundRect(float x,
                         float y,
                         float w,
                         float h,
                         float arcWidth,
                         float arcHeight)
Sets the dimensions for this rounded rectangle.

Parameters:
x - the x-coordinate of the top left corner.
y - the y-coordinate of the top left corner.
w - the width of the rectangle.
h - the height of the rectangle.
arcWidth - the arc width.
arcHeight - the arc height.
See Also:
setRoundRect(double, double, double, double, double, double)

setRoundRect

public void setRoundRect(double x,
                         double y,
                         double w,
                         double h,
                         double arcWidth,
                         double arcHeight)
Description copied from class: RoundRectangle2D
Set the values of this round rectangle.

Specified by:
setRoundRect in class RoundRectangle2D
Parameters:
x - The x coordinate
y - The y coordinate
w - The width
h - The height
arcWidth - The arc width
arcHeight - The arc height