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.
| 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 float | extent
The angular extent of the arc in degrees. |
| public float | height
The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents). |
| 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. |
| public float | start
The starting angle of the arc in degrees. |
| private int | |
| public float | width
The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents). |
| public float | x
The X coordinate of the upper-left corner of the framing rectangle of the arc. |
| public float | y
The Y coordinate of the upper-left corner of the framing rectangle of the arc. |
| Access | Constructor and Description |
|---|---|
| public | Arc2D()
Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0). |
| public | |
| public | Arc2D(float
The X coordinate of the upper-left corner of
the arc's framing rectangle. x, float The Y coordinate of the upper-left corner of
the arc's framing rectangle. y, float The overall width of the full ellipse of which
this arc is a partial section. w, float The overall height of the full ellipse of which this
arc is a partial section. h, float The starting angle of the arc in degrees. start, float The angular extent of the arc in degrees. extent, int type)Constructs a new arc, initialized to the specified location, size, angular extents, and closure type. |
| 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, float The Y coordinate of the point to test. y)Implements abstract com. 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, float The Y coordinate of the rectangle's upper-left corner. y, float The width of the rectangle. w, float The height of the rectangle. h)Implements abstract com. Determines whether or not the interior of the arc entirely contains the specified rectangle. |
| 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 Arc2D | copy()
Implements abstract com. Returns a new copy of this |
| 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 int | Returns: One of the integer constant closure types defined in this class.Returns the arc closure type of the arc: |
| public RectBounds | Returns: theRectBounds that represents the arc's
framing rectangle.Overrides com. Returns the high-precision framing rectangle of the arc. |
| 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 float | getHeight()
Implements abstract com. Returns the height of the framing rectangle
in |
| public PathIterator | Returns: APathIterator that defines the arc's boundary.an optional tx)BaseTransform to be applied
to the coordinates as they are returned in the iteration, or null
if the untransformed coordinates are desired.Implements abstract com. 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 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 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, float The Y coordinate of the rectangle's upper-left corner. y, float The width of the rectangle. w, float The height of the rectangle. h)Implements abstract com. Determines whether or not the interior of the arc intersects the interior of the specified rectangle. |
| public boolean | isEmpty()
Implements abstract com. Determines whether the |
| pack-priv static float | |
| public void | setAngles(float
The X coordinate of the arc's starting point. x1, float The Y coordinate of the arc's starting point. y1, float The X coordinate of the arc's ending point. x2, float 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 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 void | |
| public void | setArc(Point2D
The loc, Dimension2D Point2D representing the coordinates of
the upper-left corner of the arc.The size, float 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, float 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(float
The X coordinate of the center of the arc. x, float The Y coordinate of the center of the arc. y, float The radius of the arc. radius, float The starting angle of the arc in degrees. angSt, float 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, float 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(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
|
| CHORD | back to summary |
|---|---|
| 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. | |
| extent | back to summary |
|---|---|
| public float extent The angular extent of the arc in degrees. | |
| height | back to summary |
|---|---|
| public float height The overall height of the full ellipse of which this arc is a partial section (not considering the angular extents). | |
| OPEN | back to summary |
|---|---|
| public static final int OPEN The closure type for an open arc with no path segments connecting the two ends of the arc segment. | |
| PIE | back to summary |
|---|---|
| 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. | |
| start | back to summary |
|---|---|
| public float start The starting angle of the arc in degrees. | |
| type | back to summary |
|---|---|
| private int type | |
| width | back to summary |
|---|---|
| public float width The overall width of the full ellipse of which this arc is a partial section (not considering the angular extents). | |
| x | back to summary |
|---|---|
| public float x The X coordinate of the upper-left corner of the framing rectangle of the arc. | |
| y | back to summary |
|---|---|
| public float y The Y coordinate of the upper-left corner of the framing rectangle of the arc. | |
| Arc2D | back to summary |
|---|---|
| public Arc2D() Constructs a new OPEN arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0). | |
| Arc2D | back to summary |
|---|---|
| public Arc2D(int type) Constructs a new arc, initialized to location (0, 0), size (0, 0), angular extents (start = 0, extent = 0), and the specified closure type. | |
| Arc2D | back to summary |
|---|---|
| public Arc2D(float x, float y, float w, float h, float start, float extent, int type) Constructs a new arc, initialized to the specified location, size, angular extents, and closure type.
| |
| contains | back to summary |
|---|---|
| public boolean contains(float x, float y) Implements abstract com. Determines whether or not the specified point is inside the boundary of the arc.
| |
| contains | back to summary |
|---|---|
| public boolean contains(float x, float y, float w, float h) Implements abstract com. Determines whether or not the interior of the arc entirely contains the specified rectangle.
| |
| containsAngle | back to summary |
|---|---|
| public boolean containsAngle(float angle) Determines whether or not the specified angle is within the angular extents of the arc.
| |
| copy | back to summary |
|---|---|
| public Arc2D 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 | |
| getArcType | back to summary |
|---|---|
| public int getArcType() Returns the arc closure type of the arc:
| |
| getBounds | back to summary |
|---|---|
| public RectBounds getBounds() Overrides com. Returns the high-precision framing rectangle of the arc. The framing
rectangle contains only the part of this
This method differs from the
| |
| getEndPoint | back to summary |
|---|---|
| public Point2D getEndPoint() Returns the ending point of the arc. This point is the intersection of the ray from the center defined by the starting angle plus the angular extent of the arc and the elliptical boundary of the arc.
| |
| 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 the
arc.
This iterator is multithread safe.
| |
| getStartPoint | back to summary |
|---|---|
| public Point2D getStartPoint() Returns the starting point of the arc. This point is the intersection of the ray from the center defined by the starting angle and the elliptical boundary of the arc.
| |
| 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. Determines whether or not the interior of the arc intersects the interior of the specified rectangle.
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Implements abstract com. Doc from com. Determines whether the
| |
| normalizeDegrees | back to summary |
|---|---|
| pack-priv static float normalizeDegrees(double angle) | |
| setAngles | back to summary |
|---|---|
| public void setAngles(float x1, float y1, float x2, float y2) Sets the starting angle and angular extent of this arc using two sets of coordinates. The first set of coordinates is used to determine the angle of the starting point relative to the arc's center. The second set of coordinates is used to determine the angle of the end point relative to the arc's center. The arc will always be non-empty and extend counterclockwise from the first point around to the second point.
| |
| setAngles | back to summary |
|---|---|
| public void setAngles(Point2D p1, Point2D p2) Sets the starting angle and angular extent of this arc using two points. The first point is used to determine the angle of the starting point relative to the arc's center. The second point is used to determine the angle of the end point relative to the arc's center. The arc will always be non-empty and extend counterclockwise from the first point around to the second point. | |
| setAngleStart | back to summary |
|---|---|
| public void setAngleStart(Point2D p) Sets the starting angle of this arc to the angle that the specified point defines relative to the center of this arc. The angular extent of the arc will remain the same. | |
| setArc | back to summary |
|---|---|
| public void setArc(float x, float y, float w, float h, float angSt, float angExt, int closure) | |
| setArc | back to summary |
|---|---|
| public void setArc(Point2D loc, Dimension2D size, float angSt, float angExt, int closure) Sets the location, size, angular extents, and closure type of this arc to the specified values.
| |
| setArc | back to summary |
|---|---|
| public void setArc(Arc2D a) Sets this arc to be the same as the specified arc.
| |
| setArcByCenter | back to summary |
|---|---|
| public void setArcByCenter(float x, float y, float radius, float angSt, float angExt, int closure) Sets the position, bounds, angular extents, and closure type of this arc to the specified values. The arc is defined by a center point and a radius rather than a framing rectangle for the full ellipse.
| |
| setArcByTangent | back to summary |
|---|---|
| public void setArcByTangent(Point2D p1, Point2D p2, Point2D p3, float radius) Sets the position, bounds, and angular extents of this arc to the specified value. The starting angle of the arc is tangent to the line specified by points (p1, p2), the ending angle is tangent to the line specified by points (p2, p3), and the arc has the specified radius.
| |
| setArcType | back to summary |
|---|---|
| public void setArcType(int type) Sets the closure type of this arc to the specified value:
| |
| 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
| |