|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.byu.phun2d.DrawObj edu.byu.phun2d.Arc
public class Arc
This objec will draw an elliptical arc. If the arc has a fill color (setFillColor()) it will be drawn as a pie shape. If it has no fill color then just the curved edge is drawn.
An arc is a portion of an ellipse and the ellipse is specified by a bounding arc's ellipse as in Oval. To define the arc a starting angle is specified along with the extent of the arc angle.
Constructor Summary | |
---|---|
Arc(double centerX,
double centerY,
double width,
double height,
double startAngle,
double angle)
This creates a new Arc with the specified parameters. |
Method Summary | |
---|---|
double |
getCenterX()
The X coordinate of the center of the arc's ellipse. |
double |
getCenterY()
The Y coordinate of the center of the arc's ellipse. |
double |
getHeight()
The height of the arc's ellipse. |
double |
getWidth()
The width of the arc's ellipse. |
void |
setAngle(double newAngle)
Changes the angular width of the arc. |
void |
setCenter(double centerX,
double centerY)
Changes the center coordinates of the arc. |
void |
setHeight(double newHeight)
Changes the height of the ellipse that defines this arc. |
void |
setStart(double newStart)
Changes the starting angle for the arc. |
void |
setWidth(double newWidth)
Changes the width of the ellipse that defines this arc. |
Methods inherited from class edu.byu.phun2d.DrawObj |
---|
getFillColor, getLineColor, getLineWidth, getRotate, getScaleX, getScaleY, getTranslate, insideToOutside, outsideToInside, setFillColor, setLineColor, setLineWidth, setRotate, setScale, setTranslate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Arc(double centerX, double centerY, double width, double height, double startAngle, double angle)
centerX
- the X coordinate of the center of the ellipse from which
this arc is derived.centerY
- the Y coordinate of the center of the ellipse from which
this arc is derived.width
- the width of the ellipseheight
- the height of the ellipse.startAngle
- this is the angle at which the arc should start. This
angle is measure in degrees counterclockwise starting at the positive
X axis.angle
- this is the angular width of the arc. This is measured in
degrees counterclockwise.Method Detail |
---|
public void setCenter(double centerX, double centerY)
centerX
- the new X coordinate.centerY
- the new Y coordinate.public void setWidth(double newWidth)
newWidth
- the new width.public void setHeight(double newHeight)
newHeight
- the new height.public void setStart(double newStart)
newStart
- the new starting angle, measured in
degrees counterclockwise from the positive X axis.public void setAngle(double newAngle)
newAngle
- the new angle for the arc, measured
in degrees counterclockwise.public double getWidth()
public double getHeight()
public double getCenterX()
public double getCenterY()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |