is new.
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.RoundRectangle2D
java.awt.geom.RoundRectangle2D.Double
,
Serializable
,
Cloneable
public static class RoundRectangle2D.Double
implements
SerializableThe Double class defines a rectangle with rounded corners all specified in double coordinates.
Since:
1.2
See Also:
Serialized Form
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom. RoundRectangle2D |
|---|
| RoundRectangle2D.Double , RoundRectangle2D.Float |
| Field Summary | |
|---|---|
| double |
archeight
The height of the arc that rounds off the corners. |
| double |
arcwidth
The width of the arc that rounds off the corners. |
| double |
height
The height of this RoundRectangle2D. |
| double |
width
The width of this RoundRectangle2D. |
| double |
x
The X coordinate of this RoundRectangle2D. |
| double |
y
The Y coordinate of this RoundRectangle2D. |
| Constructor Summary | |
|---|---|
|
RoundRectangle2D.Double
() Constructs a new RoundRectangle2D, initialized to location (0.0, 0), size (0.0, 0.0), and corner arcs of radius 0.0. |
|
|
RoundRectangle2D.Double
(double x, double y, double w, double h, double arcw, double arch) Constructs and initializes a RoundRectangle2D from the specified
double
coordinates. |
|
| Method Summary | |
|---|---|
| double |
getArcHeight
()
Gets
|
| double |
getArcWidth
()
Gets
|
| Rectangle2D |
getBounds2D
() Returns
a
and more accurate
bounding box of
the Shape than the getBounds method.
|
| double |
getHeight
() Returns the height of
the framing rectangle
|
| double |
getWidth
() Returns the width of
the framing rectangle
|
| double |
getX
() Returns the X coordinate of
the upper-left corner of the framing rectangle
|
| double |
getY
() Returns the Y coordinate of
the upper-left corner of the framing rectangle
|
| boolean |
isEmpty
() Determines whether
the RectangularShape
|
| void |
setRoundRect
(double x, double y, double w, double h, double arcw, double arch) Sets the location, size, and
corner
|
| void |
setRoundRect
(
RoundRectangle2D
rr) Sets this RoundRectangle2D to be the same as the specified RoundRectangle2D. |
| Methods inherited from class java.awt.geom. RoundRectangle2D |
|---|
| contains , contains , equals , getPathIterator , hashCode , intersects , setFrame |
| 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 |
|---|
| finalize , getClass , notify , notifyAll , toString , wait , wait , wait |
| Field Detail |
|---|
public double x
Since:
1.2
public double y
Since:
1.2
public double width
Since:
1.2
public double height
Since:
1.2
public double arcwidth
Since:
1.2
public double archeight
Since:
1.2
| Constructor Detail |
|---|
public RoundRectangle2D.Double()
Since:
1.2
public RoundRectangle2D.Double(double x,
double y,
double w,
double h,
double arcw,
double arch)
double
coordinates.
x
X coordinate of
y
Y coordinate of
w
width
h
height
which
set
arcw - the width of the arc to use to round off the corners of the newly constructed RoundRectangle2D
Since:
1.2
| Method Detail |
|---|
public double getX()
the upper-left corner of the framing rectangle
the X coordinate of the upper-left corner of the framing rectangle.
Since:
1.2
public double getY()
the upper-left corner of the framing rectangle
the Y coordinate of the upper-left corner of the framing rectangle.
Since:
1.2
public double getWidth()
the framing rectangle
the width of the framing rectangle.
Since:
1.2
public double getHeight()
the framing rectangle
the height of the framing rectangle.
Since:
1.2
public double getArcWidth()
Gets
Since:
1.2
public double getArcHeight()
Gets
Since:
1.2
public boolean isEmpty()
Determines whether the RectangularShape is empty. When the RectangularShape is empty, it encloses no area.
true if the RectangularShape is empty; false otherwise.
Since:
1.2
public void setRoundRect(double x,
double y,
double w,
double h,
double arcw,
double arch)
corner
x
X coordinate
y
Y coordinate
the location of
this RoundRectangle2D
w
width
h
height
arcw - the width to which to set the arc of this RoundRectangle2D
Since:
1.2
public void setRoundRect(RoundRectangle2D rr)
Since:
1.2
public Rectangle2D getBounds2D()
Returns a high precision and more accurate bounding box of the Shape than the getBounds method. Note that there is no guarantee that the returned
Rectangle2D
is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated Rectangle2D. The bounding box returned by this method is usually tighter than that returned by the getBounds method and never fails due to overflow problems since the return value can be an instance of the Rectangle2D that uses double precision values to store the dimensions.
Specified by:
getBounds2D
in interface
Shape
Returns:
an instance of Rectangle2D that is a high-precision bounding box of the Shape.
Since:
1.2