|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectobjectdraw.Drawable
objectdraw.Drawable2D
objectdraw.Resizable2D
objectdraw.Rectangular
objectdraw.Arc
abstract class Arc
Arc is an abstract class to be used as a superclass of FilledArc and FramedArc.
Field Summary | |
---|---|
protected double |
arcAngle
|
protected double |
startAngle
|
Fields inherited from class objectdraw.Rectangular |
---|
height, width, x, y |
Fields inherited from class objectdraw.Drawable |
---|
canvasContent, color, shown |
Constructor Summary | |
---|---|
Arc(double x,
double y,
double width,
double height,
double startAngle,
double arcAngle,
DrawingCanvas c)
Creates a new FilledArc object. |
|
Arc(Location origin,
double width,
double height,
double startAngle,
double arcAngle,
DrawingCanvas c)
|
|
Arc(Location p0,
Location p1,
double startAngle,
double arcAngle,
DrawingCanvas c)
Creates a new FilledArc object. |
Method Summary | |
---|---|
boolean |
contains(Location point)
Determines if a particular position on the DrawingCanvas is contained within the object. |
double |
getArcAngle()
Determine the angle spanned by this arc |
double |
getStartAngle()
Determine the starting angle for an arc |
void |
setArcAngle(double arcAngle)
Change the angle spanned by this arc |
void |
setStartAngle(double startAngle)
Change the starting position for this arc |
String |
toString()
Generates a string representation of the object. |
Methods inherited from class objectdraw.Rectangular |
---|
getBounds, getHeight, getWidth, setBounds, setHeight, setSize, setWidth |
Methods inherited from class objectdraw.Resizable2D |
---|
move, moveTo |
Methods inherited from class objectdraw.Drawable2D |
---|
draw, getLocation, getX, getY, overlaps |
Methods inherited from class objectdraw.Drawable |
---|
addToCanvas, clearCanvasContent, getCanvas, getColor, hide, isHidden, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setCanvasContent, setColor, setStateChanged, show |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface objectdraw.Drawable2DInterface |
---|
getLocation, getX, getY, overlaps |
Methods inherited from interface objectdraw.DrawableInterface |
---|
addToCanvas, getCanvas, getColor, hide, isHidden, move, moveTo, moveTo, removeFromCanvas, sendBackward, sendForward, sendToBack, sendToFront, setColor, show |
Field Detail |
---|
protected double arcAngle
protected double startAngle
Constructor Detail |
---|
public Arc(double x, double y, double width, double height, double startAngle, double arcAngle, DrawingCanvas c)
x
- coordinate of the upper left corner of the bounding rectangle.y
- coordinate of the upper left corner of the bounding rectangle.width
- the width of the bounding rectangle.height
- the height of the bounding rectangle.startAngle
- the starting angle of the arc.arcAngle
- the ending angle of the arc.c
- the canvas in which the object is created.public Arc(Location origin, double width, double height, double startAngle, double arcAngle, DrawingCanvas c)
public Arc(Location p0, Location p1, double startAngle, double arcAngle, DrawingCanvas c)
p0
- endpoint of a diagonal of the rectanglep1
- other diagonal endpointstartAngle
- the starting angle of the arc.arcAngle
- the ending angle of the arc.c
- the canvas in which the object is createdMethod Detail |
---|
public boolean contains(Location point)
DrawableInterface
contains
in interface DrawableInterface
contains
in class Drawable2D
point
- the position on the canvas.
public double getArcAngle()
public double getStartAngle()
public void setArcAngle(double arcAngle)
arcAngle
- - new total angle for this arc.public void setStartAngle(double startAngle)
startAngle
- - new starting angle for this arc.public String toString()
toString
in class Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |