public static class

RoundRectangle2D.Float

extends RoundRectangle2D
implements Serializable
java.lang.Object
   ↳ java.awt.geom.RectangularShape
     ↳ java.awt.geom.RoundRectangle2D
       ↳ java.awt.geom.RoundRectangle2D.Float

Class Overview

The Float class defines a rectangle with rounded corners all specified in float coordinates.

Summary

Fields
public float archeight The height of the arc that rounds off the corners.
public float arcwidth The width of the arc that rounds off the corners.
public float height The height of this RoundRectangle2D.
public float width The width of this RoundRectangle2D.
public float x The X coordinate of this RoundRectangle2D.
public float y The Y coordinate of this RoundRectangle2D.
Public Constructors
RoundRectangle2D.Float()
Constructs a new RoundRectangle2D, initialized to location (0.0, 0.0), size (0.0, 0.0), and corner arcs of radius 0.0.
RoundRectangle2D.Float(float x, float y, float w, float h, float arcw, float arch)
Constructs and initializes a RoundRectangle2D from the specified float coordinates.
Public Methods
double getArcHeight()
Gets the height of the arc that rounds off the corners.
double getArcWidth()
Gets the width of the arc that rounds off the corners.
Rectangle2D getBounds2D()
double getHeight()
Returns the height of the framing rectangle in double precision.
double getWidth()
Returns the width of the framing rectangle in double precision.
double getX()
Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.
double getY()
Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.
boolean isEmpty()
Determines whether the RectangularShape is empty.
void setRoundRect(float x, float y, float w, float h, float arcw, float arch)
Sets the location, size, and corner radii of this RoundRectangle2D to the specified float values.
void setRoundRect(RoundRectangle2D rr)
Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.
void setRoundRect(double x, double y, double w, double h, double arcw, double arch)
Sets the location, size, and corner radii of this RoundRectangle2D to the specified double values.
[Expand]
Inherited Methods
From class java.awt.geom.RoundRectangle2D
From class java.awt.geom.RectangularShape
From class java.lang.Object
From interface java.awt.Shape

Fields

public float archeight

The height of the arc that rounds off the corners.

public float arcwidth

The width of the arc that rounds off the corners.

public float height

The height of this RoundRectangle2D.

public float width

The width of this RoundRectangle2D.

public float x

The X coordinate of this RoundRectangle2D.

public float y

The Y coordinate of this RoundRectangle2D.

Public Constructors

public RoundRectangle2D.Float ()

Constructs a new RoundRectangle2D, initialized to location (0.0, 0.0), size (0.0, 0.0), and corner arcs of radius 0.0.

public RoundRectangle2D.Float (float x, float y, float w, float h, float arcw, float arch)

Constructs and initializes a RoundRectangle2D from the specified float coordinates.

Parameters
x the X coordinate of the newly constructed RoundRectangle2D
y the Y coordinate of the newly constructed RoundRectangle2D
w the width to which to set the newly constructed RoundRectangle2D
h the height to which to set the newly constructed RoundRectangle2D
arcw the width of the arc to use to round off the corners of the newly constructed RoundRectangle2D
arch the height of the arc to use to round off the corners of the newly constructed RoundRectangle2D

Public Methods

public double getArcHeight ()

Gets the height of the arc that rounds off the corners.

Returns
  • the height of the arc that rounds off the corners of this RoundRectangle2D.

public double getArcWidth ()

Gets the width of the arc that rounds off the corners.

Returns
  • the width of the arc that rounds off the corners of this RoundRectangle2D.

public Rectangle2D getBounds2D ()

public double getHeight ()

Returns the height of the framing rectangle in double precision.

Returns
  • the height of the framing rectangle.

public double getWidth ()

Returns the width of the framing rectangle in double precision.

Returns
  • the width of the framing rectangle.

public double getX ()

Returns the X coordinate of the upper-left corner of the framing rectangle in double precision.

Returns
  • the X coordinate of the upper-left corner of the framing rectangle.

public double getY ()

Returns the Y coordinate of the upper-left corner of the framing rectangle in double precision.

Returns
  • the Y coordinate of the upper-left corner of the framing rectangle.

public boolean isEmpty ()

Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.

Returns
  • true if the RectangularShape is empty; false otherwise.

public void setRoundRect (float x, float y, float w, float h, float arcw, float arch)

Sets the location, size, and corner radii of this RoundRectangle2D to the specified float values.

Parameters
x the X coordinate to which to set the location of this RoundRectangle2D
y the Y coordinate to which to set the location of this RoundRectangle2D
w the width to which to set this RoundRectangle2D
h the height to which to set this RoundRectangle2D
arcw the width to which to set the arc of this RoundRectangle2D
arch the height to which to set the arc of this RoundRectangle2D

public void setRoundRect (RoundRectangle2D rr)

Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D.

Parameters
rr the specified RoundRectangle2D

public void setRoundRect (double x, double y, double w, double h, double arcw, double arch)

Sets the location, size, and corner radii of this RoundRectangle2D to the specified double values.

Parameters
x the X coordinate to which to set the location of this RoundRectangle2D
y the Y coordinate to which to set the location of this RoundRectangle2D
w the width to which to set this RoundRectangle2D
h the height to which to set this RoundRectangle2D
arcw the width to which to set the arc of this RoundRectangle2D
arch the height to which to set the arc of this RoundRectangle2D