java.awt.geom
public abstract class Arc2D extends RectangularShape
Since: 1.2
Nested Class Summary | |
---|---|
static class | Arc2D.Double
This class implements an arc in double precision.
|
static class | Arc2D.Float
This class implements an arc in float precision.
|
Field Summary | |
---|---|
static int | CHORD
A closed arc with a single segment connecting the endpoints (a chord). |
static int | OPEN
An open arc, with no segment connecting the endpoints. |
static int | PIE
A closed arc with two segments, one from each endpoint, meeting at the
center of the ellipse. |
Constructor Summary | |
---|---|
protected | Arc2D(int type)
Create a new arc, with the specified closure type.
|
Method Summary | |
---|---|
boolean | contains(double x, double y)
Determines if the arc contains the given point. |
boolean | contains(double x, double y, double w, double h)
Tests if a given rectangle is contained in the area of the arc.
|
boolean | contains(Rectangle2D r)
Tests if a given rectangle is contained in the area of the arc.
|
boolean | containsAngle(double a)
Tests if the given angle, in degrees, is included in the arc.
|
abstract double | getAngleExtent()
Get the extent angle of the arc in degrees.
|
abstract double | getAngleStart()
Get the starting angle of the arc in degrees.
|
int | getArcType()
Return the closure type of the arc.
|
Rectangle2D | getBounds2D()
Gets the bounds of the arc. |
Point2D | getEndPoint()
Returns the ending point of the arc.
|
PathIterator | getPathIterator(AffineTransform at)
Returns an iterator over this arc, with an optional transformation.
|
Point2D | getStartPoint()
Returns the starting point of the arc.
|
boolean | intersects(double x, double y, double w, double h)
Tests if a given rectangle intersects the area of the arc.
|
protected abstract Rectangle2D | makeBounds(double x, double y, double w, double h)
Construct a bounding box in a precision appropriate for the subclass.
|
abstract void | setAngleExtent(double extent)
Set the extent, in degrees.
|
void | setAngles(double x1, double y1, double x2, double y2)
Sets the starting and extent angles to those of the given points
relative to the center of the arc. |
void | setAngles(Point2D p1, Point2D p2)
Sets the starting and extent angles to those of the given points
relative to the center of the arc. |
abstract void | setAngleStart(double start)
Set the start, in degrees.
|
void | setAngleStart(Point2D p)
Sets the starting angle to the angle of the given point relative to
the center of the arc. |
abstract void | setArc(double x, double y, double w, double h, double start, double extent, int type)
Set the parameters of the arc. |
void | setArc(Point2D p, Dimension2D d, double start, double extent, int type)
Set the parameters of the arc. |
void | setArc(Rectangle2D r, double start, double extent, int type)
Set the parameters of the arc. |
void | setArc(Arc2D a)
Set the parameters of the arc from the given one.
|
void | setArcByCenter(double x, double y, double r, double start, double extent, int type)
Set the parameters of the arc. |
void | setArcByTangent(Point2D p1, Point2D p2, Point2D p3, double r)
Sets the parameters of the arc by finding the tangents of two lines, and
using the specified radius. |
void | setArcType(int type)
Set the closure type of this arc.
|
void | setFrame(double x, double y, double w, double h)
Sets the location and bounds of the ellipse of which this arc is a part.
|
Parameters: type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}.
Throws: IllegalArgumentException if type is invalid
Parameters: x the x coordinate to test y the y coordinate to test
Returns: true if the point is inside the arc
Parameters: x the x coordinate of the rectangle y the y coordinate of the rectangle w the width of the rectangle h the height of the rectangle
Returns: true if the arc contains the rectangle
Parameters: r the rectangle
Returns: true if the arc contains the rectangle
Parameters: a the angle to test
Returns: true if it is contained
Returns: the extent angle
See Also: Arc2D
Returns: the starting angle
See Also: Arc2D
getBounds
, as it takes into consideration the start and
end angles, and the center point of a pie wedge, rather than just the
overall ellipse.
Returns: the bounds of the arc
See Also: Arc2D
Returns: the end point
Parameters: at the transformation, or null
Returns: a path iterator
Returns: the start point
Parameters: x the x coordinate of the rectangle y the y coordinate of the rectangle w the width of the rectangle h the height of the rectangle
Returns: true if the two shapes share common points
Parameters: x the x coordinate y the y coordinate w the width h the height
Returns: the rectangle for use in getBounds2D
Parameters: extent the new extent angle
See Also: getAngleExtent
Parameters: x1 the first x coordinate y1 the first y coordinate x2 the second x coordinate y2 the second y coordinate
See Also: setAngleStart
Parameters: p1 the first point p2 the second point
Throws: NullPointerException if either point is null
See Also: setAngleStart
Parameters: start the new start angle
See Also: getAngleStart
Parameters: p the new start point
Throws: NullPointerException if p is null
See Also: getStartPoint getAngleStart
Parameters: x the new x coordinate of the upper left of the bounding box y the new y coordinate of the upper left of the bounding box w the new width of the bounding box h the new height of the bounding box start the start angle, in degrees extent the arc extent, in degrees type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
Throws: IllegalArgumentException if type is invalid
Parameters: p the upper left point of the bounding box d the dimensions of the bounding box start the start angle, in degrees extent the arc extent, in degrees type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
Throws: IllegalArgumentException if type is invalid NullPointerException if p or d is null
Parameters: r the new bounding box start the start angle, in degrees extent the arc extent, in degrees type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
Throws: IllegalArgumentException if type is invalid NullPointerException if r is null
Parameters: a the arc to copy
Throws: NullPointerException if a is null
Parameters: x the x coordinate of the center of the circle y the y coordinate of the center of the circle r the radius of the circle start the start angle, in degrees extent the arc extent, in degrees type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
Throws: IllegalArgumentException if type is invalid
Parameters: p1 the first point p2 the tangent line intersection point p3 the third point r the radius of the arc
Throws: NullPointerException if any point is null
Parameters: type one of {@link #OPEN}, {@link #CHORD}, or {@link #PIE}
Throws: IllegalArgumentException if type is invalid
See Also: getArcType
Parameters: x the new x coordinate y the new y coordinate w the new width h the new height
See Also: Arc2D