|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--element.Rect | +--element.Oval | +--element.Arc
An object that describes a portion of an oval.
Field Summary | |
protected int |
angle
The span of the arc, increasing counter-clockwize from the start angle. |
protected int |
start
The start angle of the arc. |
Fields inherited from class element.Rect |
height,
left,
top,
width |
Constructor Summary | |
Arc()
Construct a trivial arc located at the origin. |
|
Arc(Arc r)
Constructs a copy of an arc from another. |
|
Arc(int x,
int y,
int w,
int h)
Construct an oval bounded by the rectangle specified by (x,y,w,h). |
|
Arc(int x,
int y,
int w,
int h,
int strt,
int angl)
Construct an arc bounded by the rectangle specified by (x,y,w,h), starting at strt, and sweeping for angl degrees. |
|
Arc(Pt p,
Pt q)
Construct an oval determined by two points: p and q. |
|
Arc(Rect r,
int strt,
int angl)
Construct an arc bounded by rectangle r with specified start and sweep. |
Method Summary | |
int |
angle()
Return the span of the arc. |
void |
angle(int angl)
Set the span or sweep of the arc. |
protected static int |
canonical(int angle)
turn an angle into one that is between 0 and 359. |
void |
clearOn(DrawingWindow d)
Erase arc from the drawing window d. |
java.lang.Object |
clone()
return a distinct copy of this arc |
boolean |
contains(Pt p)
Determine if a point p is within an arc. |
void |
drawOn(DrawingWindow d)
Draw (in the current mode) the arc on the drawing window. |
boolean |
equals(java.lang.Object other)
Return true iff this arc equals the other |
void |
fillOn(DrawingWindow d)
Draw this arc on the specified drawing window. |
int |
hashCode()
Return an integer for use as a hash code. |
int |
start()
Return the starting angle of the arc. |
void |
start(int strt)
Set the starting angle of the arc. |
java.lang.String |
toString()
Construct a string representation of this arc |
Methods inherited from class element.Rect |
bottom,
bottom,
center,
center,
extend,
height,
height,
left,
left,
move,
moveTo,
moveTo,
Rectangle,
right,
right,
top,
top,
width,
width |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected int start
protected int angle
Constructor Detail |
public Arc()
public Arc(Pt p, Pt q)
p
- one of the two points determining the bounding rectangleq
- the other point determining the bounding rectanglepublic Arc(Rect r, int strt, int angl)
r
- the bounding rectanglestrt
- the starting angle of the arcangl
- the counter-clockwize sweep of the arc.public Arc(int x, int y, int w, int h, int strt, int angl)
x
- the left side of the bounding rectangle.y
- the top side of the bounding rectanglew
- the width of the bounding rectangleh
- the height of the bounding rectanglestrt
- the starting angle of the arc, with zero pointing due rightangl
- the size of counter-clockwize sweep of arc.public Arc(int x, int y, int w, int h)
x
- the left side of the bounding rectangle.y
- the top side of the bounding rectanglew
- the width of the bounding rectangleh
- the height of the bounding rectanglepublic Arc(Arc r)
r
- the source arc.Method Detail |
protected static int canonical(int angle)
angle
- the initial angle.public boolean contains(Pt p)
p
- the point to be checkedpublic int start()
public int angle()
public void start(int strt)
strt
- the new starting angle of the arc, in degrees.public void angle(int angl)
angl
- the sweep of the arc, in degrees, counter-clockwize from start.public void fillOn(DrawingWindow d)
d
- the target drawing window.DrawingWindow.fill(element.Drawable)
,
DrawingWindow.paintMode()
,
DrawingWindow.invertMode()
public void clearOn(DrawingWindow d)
d
- the target drawing windowDrawingWindow.clear(element.Drawable)
public void drawOn(DrawingWindow d)
d
- the target drawing windowDrawingWindow.paintMode()
,
DrawingWindow.invertMode()
,
DrawingWindow.draw(element.Drawable)
public int hashCode()
public boolean equals(java.lang.Object other)
other
- another valid arcpublic java.lang.Object clone()
public java.lang.String toString()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |