Drawing an Arc
by, 03-06-2012 at 07:54 PM (645 Views)
A piece of ellipse is drawn by Arc2D. Following present an arc class.
- A bounding rectangle
- An angular extent
- A start angle
- A closure type
An ellipse in float & double precision are specified.
Arc2D class defines 3 types of arcs:
The parameters and size of the arc are set by applying these different methods:
- By supplied Dimension2D and Point2D.
- Directly by coordinates.
- By copying Arc2D that is already existing.
An arc creation is explained by this code given below.
Java Code:// draw Arc2D.Double g2.draw(new Arc2D.Double(x, y, rectwidth, rectheight, 90, 135, Arc2D.OPEN));