Arc2D is the abstract superclass for all objects that
store a 2D arc defined by a framing rectangle,
start angle, angular extent (length of the arc), and a closure type
(OPEN, CHORD, or PIE).
The arc is a partial section of a full ellipse which
inscribes the framing rectangle of its parent RectangularShape.
The angles are specified relative to the non-square
framing rectangle such that 45 degrees always falls on the line from
the center of the ellipse to the upper right corner of the framing
rectangle.
As a result, if the framing rectangle is noticeably longer along one
axis than the other, the angles to the start and end of the arc segment
will be skewed farther along the longer axis of the frame.
The actual storage representation of the coordinates is left to the subclass.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Arc2D.
This class defines an arc specified in |
| public static class | Arc2D.
This class defines an arc specified in |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | CHORD
The closure type for an arc closed by drawing a straight line segment from the start of the arc segment to the end of the arc segment. |
| public static final int | OPEN
The closure type for an open arc with no path segments connecting the two ends of the arc segment. |
| public static final int | PIE
The closure type for an arc closed by drawing straight line segments from the start of the arc segment to the center of the full ellipse and from that point to the end of the arc segment. |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the point lies within the bound of
the arc, false if the point lies outside of the
arc's bounds.The X coordinate of the point to test. x, double The Y coordinate of the point to test. y)Implements java. Determines whether or not the specified point is inside the boundary of the arc. |
| public boolean | Returns: true if the arc contains the rectangle,
false if the arc doesn't contain the rectangle.The X coordinate of the rectangle's upper-left corner. x, double The Y coordinate of the rectangle's upper-left corner. y, double The width of the rectangle. w, double The height of the rectangle. h)Implements java. Determines whether or not the interior of the arc entirely contains the specified rectangle. |
| public boolean | Returns: true if the arc contains the rectangle,
false if the arc doesn't contain the rectangle.The r)Rectangle2D to test.Overrides java. Implements java. Determines whether or not the interior of the arc entirely contains the specified rectangle. |
| private boolean | |
| public boolean | Returns: true if the arc contains the angle,
false if the arc doesn't contain the angle.The angle to test. angle)Determines whether or not the specified angle is within the angular extents of the arc. |
| public boolean | Returns: true if obj is an instance
of Arc2D and has the same values;
false otherwise.an obj)Object to be compared with this
Arc2D.Overrides java. Determines whether or not the specified |
| public abstract double | Returns: A double value that represents the angular extent of the arc in degrees.Returns the angular extent of the arc. |
| public abstract double | Returns: A double value that represents the starting angle of the arc in degrees.Returns the starting angle of the arc. |
| public int | Returns: One of the integer constant closure types defined in this class.Returns the arc closure type of the arc: |
| public Rectangle | getBounds()
Overrides java. Implements java. Returns an integer |
| public Rectangle2D | getBounds2D()
Implements java. Returns a high precision and more accurate bounding box of
the |
| public Point2D | Returns: APoint2D object representing the
x,y coordinates of the ending point of the arc.Returns the ending point of the arc. |
| public PathIterator | Returns: APathIterator that defines the arc's boundary.an optional at)AffineTransform to be applied
to the coordinates as they are returned in the iteration, or null
if the untransformed coordinates are desired.Implements java. Returns an iteration object that defines the boundary of the arc. |
| public Point2D | Returns: APoint2D object representing the
x,y coordinates of the starting point of the arc.Returns the starting point of the arc. |
| public int | Returns: the hashcode for thisArc2D.Overrides java. Returns the hashcode for this |
| public boolean | Returns: true if the arc intersects the rectangle,
false if the arc doesn't intersect the rectangle.The X coordinate of the rectangle's upper-left corner. x, double The Y coordinate of the rectangle's upper-left corner. y, double The width of the rectangle. w, double The height of the rectangle. h)Implements java. Determines whether or not the interior of the arc intersects the interior of the specified rectangle. |
| protected abstract Rectangle2D | Returns: aRectangle2D that is the framing rectangle
of this arc.The X coordinate of the upper-left corner of the
framing rectangle. x, double The Y coordinate of the upper-left corner of the
framing rectangle. y, double The width of the framing rectangle. w, double The height of the framing rectangle. h)Constructs a |
| pack-priv static double | |
| public abstract void | setAngleExtent(double
The angular extent of the arc in degrees. angExt)Sets the angular extent of this arc to the specified double value. |
| public void | setAngles(double
The X coordinate of the arc's starting point. x1, double The Y coordinate of the arc's starting point. y1, double The X coordinate of the arc's ending point. x2, double The Y coordinate of the arc's ending point. y2)Sets the starting angle and angular extent of this arc using two sets of coordinates. |
| public void | |
| public abstract void | setAngleStart(double
The starting angle of the arc in degrees. angSt)Sets the starting angle of this arc to the specified double value. |
| public void | setAngleStart(Point2D
The p)Point2D that defines the starting angle.Sets the starting angle of this arc to the angle that the specified point defines relative to the center of this arc. |
| public abstract void | setArc(double
The X coordinate of the upper-left corner of the arc. x, double The Y coordinate of the upper-left corner of the arc. y, double The overall width of the full ellipse of which
this arc is a partial section. w, double The overall height of the full ellipse of which
this arc is a partial section. h, double The starting angle of the arc in degrees. angSt, double The angular extent of the arc in degrees. angExt, int closure)Sets the location, size, angular extents, and closure type of this arc to the specified double values. |
| public void | setArc(Point2D
The loc, Dimension2D Point2D representing the coordinates of
the upper-left corner of the arc.The size, double Dimension2D representing the width
and height of the full ellipse of which this arc is
a partial section.The starting angle of the arc in degrees. angSt, double The angular extent of the arc in degrees. angExt, int closure)Sets the location, size, angular extents, and closure type of this arc to the specified values. |
| public void | setArc(Rectangle2D
The framing rectangle that defines the
outer boundary of the full ellipse of which this arc is a
partial section. rect, double The starting angle of the arc in degrees. angSt, double The angular extent of the arc in degrees. angExt, int closure)Sets the location, size, angular extents, and closure type of this arc to the specified values. |
| public void | |
| public void | setArcByCenter(double
The X coordinate of the center of the arc. x, double The Y coordinate of the center of the arc. y, double The radius of the arc. radius, double The starting angle of the arc in degrees. angSt, double The angular extent of the arc in degrees. angExt, int closure)Sets the position, bounds, angular extents, and closure type of this arc to the specified values. |
| public void | setArcByTangent(Point2D
The first point that defines the arc. The starting
angle of the arc is tangent to the line specified by points (p1, p2). p1, Point2D The second point that defines the arc. The starting
angle of the arc is tangent to the line specified by points (p1, p2).
The ending angle of the arc is tangent to the line specified by
points (p2, p3). p2, Point2D The third point that defines the arc. The ending angle
of the arc is tangent to the line specified by points (p2, p3). p3, double The radius of the arc. radius)Sets the position, bounds, and angular extents of this arc to the specified value. |
| public void | |
| 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
|