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.
This class is the abstract superclass for all objects that store a 2D rounded rectangle. The actual storage representation of the coordinates is left to the subclass.
| Modifier and Type | Class and Description |
|---|---|
| public static class | RoundRectangle2D.
The |
| public static class | RoundRectangle2D.
The |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private int | |
| public boolean | contains(double x, double y)
Implements java. Tests if the specified coordinates are inside the boundary of the
|
| public boolean | contains(double x, double y, double w, double h)
Implements java. Tests if the interior of the |
| 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 abstract double | Returns: the height of the arc that rounds off the corners of thisRoundRectangle2D.Gets the height of the arc that rounds off the corners. |
| public abstract double | Returns: the width of the arc that rounds off the corners of thisRoundRectangle2D.Gets the width of the arc that rounds off the corners. |
| public PathIterator | Returns: thePathIterator object that returns the
geometry of the outline of this
RoundRectangle2D, one segment at a time.an optional at)AffineTransform to be applied to
the coordinates as they are returned in the iteration, or
null if untransformed coordinates are desiredImplements java. Returns an iteration object that defines the boundary of this
|
| public int | Returns: the hashcode for thisRoundRectangle2D.Overrides java. Returns the hashcode for this |
| public boolean | intersects(double x, double y, double w, double h)
Implements java. Tests if the interior of the |
| public void | setFrame(double x, double y, double w, double h)
Implements abstract java. Sets the location and size of the framing rectangle of this
|
| public abstract void | setRoundRect(double
the X coordinate to which to set the
location of this x, double RoundRectangle2Dthe Y coordinate to which to set the
location of this y, double RoundRectangle2Dthe width to which to set this
w, double RoundRectangle2Dthe height to which to set this
h, double RoundRectangle2Dthe width to which to set the arc of this
arcWidth, double RoundRectangle2Dthe height to which to set the arc of this
arcHeight)RoundRectangle2DSets the location, size, and corner radii of this
|
| public void | setRoundRect(RoundRectangle2D
the specified rr)RoundRectangle2DSets this |
| RoundRectangle2D | back to summary |
|---|---|
| protected RoundRectangle2D() This is an abstract class that cannot be instantiated directly. Type-specific implementation subclasses are available for instantiation and provide a number of formats for storing the information necessary to satisfy the various accessor methods below.
| |
| classify | back to summary |
|---|---|
| private int classify(double coord, double left, double right, double arcsize) | |
| contains | back to summary |
|---|---|
| public boolean contains(double x, double y) Implements java. Doc from java. Tests if the specified coordinates are inside the boundary of the
| |
| contains | back to summary |
|---|---|
| public boolean contains(double x, double y, double w, double h) Implements java. Doc from java. 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.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Determines whether or not the specified
| |
| getArcHeight | back to summary |
|---|---|
| public abstract double getArcHeight() Gets the height of the arc that rounds off the corners.
| |
| getArcWidth | back to summary |
|---|---|
| public abstract double getArcWidth() Gets the width of the arc that rounds off the corners.
| |
| getPathIterator | back to summary |
|---|---|
| public PathIterator getPathIterator(AffineTransform at) Implements java. Returns an iteration object that defines the boundary of this
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns the hashcode for this
| |
| intersects | back to summary |
|---|---|
| public boolean intersects(double x, double y, double w, double h) Implements java. Doc from java. 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.
| |
| setFrame | back to summary |
|---|---|
| public void setFrame(double x, double y, double w, double h) Implements abstract java. Doc from java. Sets the location and size of the framing rectangle of this
| |
| setRoundRect | back to summary |
|---|---|
| public abstract void setRoundRect(double x, double y, double w, double h, double arcWidth, double arcHeight) Sets the location, size, and corner radii of this
| |
| setRoundRect | back to summary |
|---|---|
| public void setRoundRect(RoundRectangle2D rr) Sets this
| |
Double class defines a rectangle with rounded
corners all specified in double coordinates.
| Modifier and Type | Field and Description |
|---|---|
| public double | archeight
The height of the arc that rounds off the corners. |
| public double | arcwidth
The width of the arc that rounds off the corners. |
| public double | height
The height of this |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.6 for interoperability. |
| public double | width
The width of this |
| public double | x
The X coordinate of this |
| public double | y
The Y coordinate of this |
| Access | Constructor and Description |
|---|---|
| public | Double()
Constructs a new |
| public | Double(double
the X coordinate of the newly
constructed x, double RoundRectangle2Dthe Y coordinate of the newly
constructed y, double RoundRectangle2Dthe width to which to set the newly
constructed w, double RoundRectangle2Dthe height to which to set the newly
constructed h, double RoundRectangle2Dthe width of the arc to use to round off the
corners of the newly constructed
arcw, double RoundRectangle2Dthe height of the arc to use to round off the
corners of the newly constructed
arch)RoundRectangle2DConstructs and initializes a |
| Modifier and Type | Method and Description |
|---|---|
| public double | getArcHeight()
Implements abstract java. Gets the height of the arc that rounds off the corners. |
| public double | getArcWidth()
Implements abstract java. Gets the width of the arc that rounds off the corners. |
| public Rectangle2D | getBounds2D()
Implements java. Returns a high precision and more accurate bounding box of
the |
| public double | getHeight()
Implements abstract java. Returns the height of the framing rectangle
in |
| public double | getWidth()
Implements abstract java. Returns the width of the framing rectangle in
|
| public double | getX()
Implements abstract java. Returns the X coordinate of the upper-left corner of
the framing rectangle in |
| public double | getY()
Implements abstract java. Returns the Y coordinate of the upper-left corner of
the framing rectangle in |
| public boolean | isEmpty()
Implements abstract java. Determines whether the |
| public void | setRoundRect(double x, double y, double w, double h, double arcw, double arch)
Implements abstract java. Sets the location, size, and corner radii of this
|
| public void | setRoundRect(RoundRectangle2D rr)
Overrides java. Sets this |
| archeight | back to summary |
|---|---|
| public double archeight The height of the arc that rounds off the corners.
| |
| arcwidth | back to summary |
|---|---|
| public double arcwidth The width of the arc that rounds off the corners.
| |
| height | back to summary |
|---|---|
| public double height The height of this
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.6 for interoperability. | |
| width | back to summary |
|---|---|
| public double width The width of this
| |
| x | back to summary |
|---|---|
| public double x The X coordinate of this
| |
| y | back to summary |
|---|---|
| public double y The Y coordinate of this
| |
| Double | back to summary |
|---|---|
| public Double() Constructs a new
| |
| Double | back to summary |
|---|---|
| public Double(double x, double y, double w, double h, double arcw, double arch) Constructs and initializes a
| |
| getArcHeight | back to summary |
|---|---|
| public double getArcHeight() Implements abstract java. Doc from java. Gets the height of the arc that rounds off the corners.
| |
| getArcWidth | back to summary |
|---|---|
| public double getArcWidth() Implements abstract java. Doc from java. Gets the width of the arc that rounds off the corners.
| |
| getBounds2D | back to summary |
|---|---|
| public Rectangle2D getBounds2D() Implements java. Doc from java. Returns a high precision and more accurate bounding box of
the
Note that the
definition of insideness can lead to situations where points
on the defining outline of the
If a
If a
| |
| getHeight | back to summary |
|---|---|
| public double getHeight() Implements abstract java. Doc from java. Returns the height of the framing rectangle
in
| |
| getWidth | back to summary |
|---|---|
| public double getWidth() Implements abstract java. Doc from java. Returns the width of the framing rectangle in
| |
| getX | back to summary |
|---|---|
| public double getX() Implements abstract java. Doc from java. Returns the X coordinate of the upper-left corner of
the framing rectangle in
| |
| getY | back to summary |
|---|---|
| public double getY() Implements abstract java. Doc from java. Returns the Y coordinate of the upper-left corner of
the framing rectangle in
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements abstract java. Doc from java. Determines whether the
| |
| setRoundRect | back to summary |
|---|---|
| public void setRoundRect(double x, double y, double w, double h, double arcw, double arch) Implements abstract java. Doc from java. Sets the location, size, and corner radii of this
| |
| setRoundRect | back to summary |
|---|---|
| public void setRoundRect(RoundRectangle2D rr) Overrides java. Doc from java. Sets this
| |
Float class defines a rectangle with rounded
corners all specified in float coordinates.
| 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 |
| private static final long | serialVersionUID
Use serialVersionUID from JDK 1.6 for interoperability. |
| 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 | Float()
Constructs a new |
| public | Float(float
the X coordinate of the newly
constructed x, float RoundRectangle2Dthe Y coordinate of the newly
constructed y, float RoundRectangle2Dthe width to which to set the newly
constructed w, float RoundRectangle2Dthe height to which to set the newly
constructed h, float RoundRectangle2Dthe width of the arc to use to round off the
corners of the newly constructed
arcw, float RoundRectangle2Dthe height of the arc to use to round off the
corners of the newly constructed
arch)RoundRectangle2DConstructs and initializes a |
| Modifier and Type | Method and Description |
|---|---|
| public double | getArcHeight()
Implements abstract java. Gets the height of the arc that rounds off the corners. |
| public double | getArcWidth()
Implements abstract java. Gets the width of the arc that rounds off the corners. |
| public Rectangle2D | getBounds2D()
Implements java. Returns a high precision and more accurate bounding box of
the |
| public double | getHeight()
Implements abstract java. Returns the height of the framing rectangle
in |
| public double | getWidth()
Implements abstract java. Returns the width of the framing rectangle in
|
| public double | getX()
Implements abstract java. Returns the X coordinate of the upper-left corner of
the framing rectangle in |
| public double | getY()
Implements abstract java. Returns the Y coordinate of the upper-left corner of
the framing rectangle in |
| public boolean | isEmpty()
Implements abstract java. Determines whether the |
| public void | setRoundRect(float
the X coordinate to which to set the
location of this x, float RoundRectangle2Dthe Y coordinate to which to set the
location of this y, float RoundRectangle2Dthe width to which to set this
w, float RoundRectangle2Dthe height to which to set this
h, float RoundRectangle2Dthe width to which to set the arc of this
arcw, float RoundRectangle2Dthe height to which to set the arc of this
arch)RoundRectangle2DSets the location, size, and corner radii of this
|
| public void | setRoundRect(double x, double y, double w, double h, double arcw, double arch)
Implements abstract java. Sets the location, size, and corner radii of this
|
| public void | setRoundRect(RoundRectangle2D rr)
Overrides java. 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
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Use serialVersionUID from JDK 1.6 for interoperability. | |
| 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
| |
| Float | back to summary |
|---|---|
| public Float() Constructs a new
| |
| Float | back to summary |
|---|---|
| public Float(float x, float y, float w, float h, float arcw, float arch) Constructs and initializes a
| |
| getArcHeight | back to summary |
|---|---|
| public double getArcHeight() Implements abstract java. Doc from java. Gets the height of the arc that rounds off the corners.
| |
| getArcWidth | back to summary |
|---|---|
| public double getArcWidth() Implements abstract java. Doc from java. Gets the width of the arc that rounds off the corners.
| |
| getBounds2D | back to summary |
|---|---|
| public Rectangle2D getBounds2D() Implements java. Doc from java. Returns a high precision and more accurate bounding box of
the
Note that the
definition of insideness can lead to situations where points
on the defining outline of the
If a
If a
| |
| getHeight | back to summary |
|---|---|
| public double getHeight() Implements abstract java. Doc from java. Returns the height of the framing rectangle
in
| |
| getWidth | back to summary |
|---|---|
| public double getWidth() Implements abstract java. Doc from java. Returns the width of the framing rectangle in
| |
| getX | back to summary |
|---|---|
| public double getX() Implements abstract java. Doc from java. Returns the X coordinate of the upper-left corner of
the framing rectangle in
| |
| getY | back to summary |
|---|---|
| public double getY() Implements abstract java. Doc from java. Returns the Y coordinate of the upper-left corner of
the framing rectangle in
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements abstract java. Doc from java. Determines whether the
| |
| 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(double x, double y, double w, double h, double arcw, double arch) Implements abstract java. Doc from java. Sets the location, size, and corner radii of this
| |
| setRoundRect | back to summary |
|---|---|
| public void setRoundRect(RoundRectangle2D rr) Overrides java. Doc from java. Sets this
| |