RoundRectangle2D
class defines a rectangle with
rounded corners defined by a location (x,y)
, a
dimension (w x h)
, and the width and height of an arc
with which to round the corners.
Modifier and Type | Field and Description |
---|---|
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 |
public float | width
The width of this |
public float | x
The X coordinate of this |
public float | y
The Y coordinate of this |
Access | Constructor and Description |
---|---|
public | RoundRectangle2D()
Constructs a new |
public | RoundRectangle2D(float
the X coordinate of the newly
constructed x, float RoundRectangle2D the Y coordinate of the newly
constructed y, float RoundRectangle2D the width to which to set the newly
constructed w, float RoundRectangle2D the height to which to set the newly
constructed h, float RoundRectangle2D the width of the arc to use to round off the
corners of the newly constructed
arcw, float RoundRectangle2D the height of the arc to use to round off the
corners of the newly constructed
arch)RoundRectangle2D Constructs and initializes a |
Modifier and Type | Method and Description |
---|---|
private int | |
public boolean | contains(float
the specified X coordinate to be tested x, float the specified Y coordinate to be tested y)Implements abstract com. Tests if the specified coordinates are inside the boundary of the
|
public boolean | contains(float
the X coordinate of the upper-left corner
of the specified rectangular area x, float the Y coordinate of the upper-left corner
of the specified rectangular area y, float the width of the specified rectangular area w, float the height of the specified rectangular area h)Implements abstract com. Tests if the interior of the |
public RoundRectangle2D | copy()
Implements abstract com. Returns a new copy of this |
public boolean | Returns: true if obj is an instance
of RoundRectangle2D and has the same values;
false otherwise.an obj)Object to be compared with this
RoundRectangle2D .Overrides java. Determines whether or not the specified |
public RectBounds | getBounds()
Overrides com. Note that there is no guarantee that the returned
|
public float | getHeight()
Implements abstract com. Returns the height of the framing rectangle
in |
public PathIterator | Returns: thePathIterator object that returns the
geometry of the outline of this
RoundRectangle2D , one segment at a time.an optional tx)BaseTransform to be applied to
the coordinates as they are returned in the iteration, or
null if untransformed coordinates are desiredImplements abstract com. Returns an iteration object that defines the boundary of this
|
public float | getWidth()
Implements abstract com. Returns the width of the framing rectangle in
|
public float | getX()
Implements abstract com. Returns the X coordinate of the upper-left corner of
the framing rectangle in |
public float | getY()
Implements abstract com. Returns the Y coordinate of the upper-left corner of
the framing rectangle in |
public int | Returns: the hashcode for thisRoundRectangle2D .Overrides java. Returns the hashcode for this |
public boolean | intersects(float
the X coordinate of the upper-left corner
of the specified rectangular area x, float the Y coordinate of the upper-left corner
of the specified rectangular area y, float the width of the specified rectangular area w, float the height of the specified rectangular area h)Implements abstract com. Tests if the interior of the |
public boolean | isEmpty()
Implements abstract com. Determines whether the |
public void | setFrame(float
the X coordinate of the upper-left corner of the
specified rectangular shape x, float the Y coordinate of the upper-left corner of the
specified rectangular shape y, float the width of the specified rectangular shape w, float the height of the specified rectangular shape h)Implements abstract com. Sets the location and size of the framing rectangle of this
|
public void | setRoundRect(float
the X coordinate to which to set the
location of this x, float RoundRectangle2D the Y coordinate to which to set the
location of this y, float RoundRectangle2D the width to which to set this
w, float RoundRectangle2D the height to which to set this
h, float RoundRectangle2D the width to which to set the arc of this
arcw, float RoundRectangle2D the height to which to set the arc of this
arch)RoundRectangle2D Sets the location, size, and corner radii of this
|
public void | setRoundRect(RoundRectangle2D
the specified rr)RoundRectangle2D Sets this |
arcHeight | back to summary |
---|---|
public float arcHeight The height of the arc that rounds off the corners. |
arcWidth | back to summary |
---|---|
public float arcWidth The width of the arc that rounds off the corners. |
height | back to summary |
---|---|
public float height The height of this |
width | back to summary |
---|---|
public float width The width of this |
x | back to summary |
---|---|
public float x The X coordinate of this |
y | back to summary |
---|---|
public float y The Y coordinate of this |
RoundRectangle2D | back to summary |
---|---|
public RoundRectangle2D() Constructs a new |
RoundRectangle2D | back to summary |
---|---|
public RoundRectangle2D(float x, float y, float w, float h, float arcw, float arch) Constructs and initializes a
|
classify | back to summary |
---|---|
private int classify(float coord, float left, float right, float arcsize) |
contains | back to summary |
---|---|
public boolean contains(float x, float y) Implements abstract com. Doc from com. Tests if the specified coordinates are inside the boundary of the
|
contains | back to summary |
---|---|
public boolean contains(float x, float y, float w, float h) Implements abstract com. Doc from com. Tests if the interior of the
The
Shapes this method might
return false even though the Shape contains
the rectangular area.
The Area class performs
more accurate geometric computations than most
Shape objects and therefore can be used if a more precise
answer is required.
|
copy | back to summary |
---|---|
public RoundRectangle2D copy() Implements abstract com. Doc from com. Returns a new copy of this
|
equals | back to summary |
---|---|
public boolean equals(Object obj) Overrides java. Determines whether or not the specified |
getBounds | back to summary |
---|---|
public RectBounds getBounds() Overrides com. Doc from com. Note that there is no guarantee that the returned
|
getHeight | back to summary |
---|---|
public float getHeight() Implements abstract com. Doc from com. Returns the height of the framing rectangle
in
|
getPathIterator | back to summary |
---|---|
public PathIterator getPathIterator(BaseTransform tx) Implements abstract com. Returns an iteration object that defines the boundary of this
|
getWidth | back to summary |
---|---|
public float getWidth() Implements abstract com. Doc from com. Returns the width of the framing rectangle in
|
getX | back to summary |
---|---|
public float getX() Implements abstract com. Doc from com. Returns the X coordinate of the upper-left corner of
the framing rectangle in
|
getY | back to summary |
---|---|
public float getY() Implements abstract com. Doc from com. Returns the Y coordinate of the upper-left corner of
the framing rectangle in
|
hashCode | back to summary |
---|---|
public int hashCode() Overrides java. Returns the hashcode for this
|
intersects | back to summary |
---|---|
public boolean intersects(float x, float y, float w, float h) Implements abstract com. Doc from com. Tests if the interior of the
The
Shapes this method might
return true even though the rectangular area does not
intersect the Shape .
The Area class performs
more accurate computations of geometric intersection than most
Shape objects and therefore can be used if a more precise
answer is required.
|
isEmpty | back to summary |
---|---|
public boolean isEmpty() Implements abstract com. Doc from com. Determines whether the
|
setFrame | back to summary |
---|---|
public void setFrame(float x, float y, float w, float h) Implements abstract com. Doc from com. Sets the location and size of the framing rectangle of this
|
setRoundRect | back to summary |
---|---|
public void setRoundRect(float x, float y, float w, float h, float arcw, float arch) Sets the location, size, and corner radii of this
|
setRoundRect | back to summary |
---|---|
public void setRoundRect(RoundRectangle2D rr) Sets this
|