org.jdrawing.graphics
Class DrawArc

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsOperation
      extended byorg.jdrawing.graphics.ArcOperation
          extended byorg.jdrawing.graphics.DrawArc
All Implemented Interfaces:
DrawingElement

public class DrawArc
extends ArcOperation

Graphics element which corresponds to Graphics.drawArc(int, int, int, int, int, int)


Constructor Summary
DrawArc(int x, int y, int width, int height, int startAngle, int arcAngle)
          Returns DrawArc for a circular or elliptical arc covering the specified rectangle.
DrawArc(int x, int y, int width, int height, int startAngle, int arcAngle, Style style)
          Returns DrawArc for a circular or elliptical arc covering the specified rectangle.
 
Method Summary
 java.awt.Shape getShapeOfOperation()
          Returns shape of the area updated by this operation.
 void paintOperation(java.awt.Graphics2D graphics)
          Performs drawing operation.
 
Methods inherited from class org.jdrawing.graphics.ArcOperation
getArcAngle, getHeight, getStartAngle, getWidth, getX, getY, setArc, setArcAngle, setHeight, setStartAngle, setWidth, setX, setY
 
Methods inherited from class org.jdrawing.graphics.GraphicsOperation
contains, getBounds, getBounds2D, getPosition, getStyle, intersects, paint, setPosition, setStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawArc

public DrawArc(int x,
               int y,
               int width,
               int height,
               int startAngle,
               int arcAngle)
Returns DrawArc for a circular or elliptical arc covering the specified rectangle.

The resulting arc begins at startAngle and extends for arcAngle degrees. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

The center of the arc is the center of the rectangle whose origin is (xy) and whose size is specified by the width and height arguments.

The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall.

The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle. As a result, if the bounding rectangle is noticeably longer in 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 bounds.

Parameters:
x - the x coordinate of the upper-left corner of the arc.
y - the y coordinate of the upper-left corner of the arc.
width - the width of the arc.
height - the height of the arc.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.

DrawArc

public DrawArc(int x,
               int y,
               int width,
               int height,
               int startAngle,
               int arcAngle,
               Style style)
Returns DrawArc for a circular or elliptical arc covering the specified rectangle.

The resulting arc begins at startAngle and extends for arcAngle degrees. Angles are interpreted such that 0 degrees is at the 3 o'clock position. A positive value indicates a counter-clockwise rotation while a negative value indicates a clockwise rotation.

The center of the arc is the center of the rectangle whose origin is (xy) and whose size is specified by the width and height arguments.

The resulting arc covers an area width + 1 pixels wide by height + 1 pixels tall.

The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle. As a result, if the bounding rectangle is noticeably longer in 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 bounds.

Parameters:
x - the x coordinate of the upper-left corner of the arc.
y - the y coordinate of the upper-left corner of the arc.
width - the width of the arc.
height - the height of the arc.
startAngle - the beginning angle.
arcAngle - the angular extent of the arc, relative to the start angle.
style - the style for this graphics operation
Method Detail

paintOperation

public void paintOperation(java.awt.Graphics2D graphics)
Performs drawing operation. This implementation performs drawArc operation.

Specified by:
paintOperation in class GraphicsOperation
Parameters:
graphics - graphics context to use for painting

getShapeOfOperation

public java.awt.Shape getShapeOfOperation()
Returns shape of the area updated by this operation.

Specified by:
getShapeOfOperation in class GraphicsOperation
Returns:
the shape of updated area