AWT Arc2D Class

Introduction

The Arc2D class is the 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).

Class declaration

Following is the declaration for java.awt.Arc2D class:

public abstract class Arc2D
extends RectangularShape

Field

Following are the fields for java.awt.geom.Arc2D class:

static 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.

static int OPEN -- The closure type for an open arc with no path segments connecting the two ends of the arc segment.

static 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.

Class constructors

S.N.

Constructor & Description

1

protected Arc2D(int type) This is an abstract class that cannot be instantiated directly.

Class methods

S.N.

Method & Description

1

boolean contains(double x, double y) Determines whether or not the specified point is inside the boundary of the arc.

Rectangle2D getBounds2D() Returns the high-precision framing rectangle of the arc.

10

Point2D getEndPoint() Returns the ending point of the arc.

11

PathIterator getPathIterator(AffineTransform at) Returns an iteration object that defines the boundary of the arc.

12

Point2D getStartPoint() Returns the starting point of the arc.

13

int hashCode() Returns the hashcode for this Arc2D.

14

boolean intersects(double x, double y, double w, double h) Determines whether or not the interior of the arc intersects the interior of the specified rectangle.

15

protected abstract Rectangle2D makeBounds(double x, double y, double w, double h) Constructs a Rectangle2D of the appropriate precision to hold the parameters calculated to be the framing rectangle of this arc.

16

abstract void setAngleExtent(double angExt) Sets the angular extent of this arc to the specified double value.