|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.slides.items.SlideItem
edu.rit.slides.items.OutlinedItem
edu.rit.slides.items.ArcItem
public class ArcItem
Class ArcItem provides a slide item that consists of a circular arc. The arc item has an outline but has no interior.
Class ArcItem keeps track of the "last arc item." The static ArcItem.last() method returns a reference to the last created arc item.
When an ArcItem is created, the "last point" (returned by the Point.last() method) is set to the arc item's center point.
Field Summary |
---|
Fields inherited from class edu.rit.slides.items.OutlinedItem |
---|
NORMAL_OUTLINE |
Constructor Summary | |
---|---|
ArcItem()
Construct a new empty arc item. |
|
ArcItem(Point center,
double radius,
double start,
double extent)
Construct a new arc item. |
|
ArcItem(Point center,
double radius,
double start,
double extent,
Outline theOutline)
Construct a new arc item with the given outline. |
Method Summary | |
---|---|
void |
draw(Graphics2D g2d)
Draw this arc item in the given graphics context. |
static ArcItem |
last()
Returns the last arc item created. |
Point |
location()
Returns this arc item's location, namely its center point. |
void |
readExternal(ObjectInput in)
Read this arc item from the given object input stream. |
void |
writeExternal(ObjectOutput out)
Write this arc item to the given object output stream. |
Methods inherited from class edu.rit.slides.items.OutlinedItem |
---|
setDefaultOutline |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArcItem()
public ArcItem(Point center, double radius, double start, double extent)
center
- Center point.radius
- Radius.start
- Starting angle in radians. (0 degrees is the positive X
axis; angles increase clockwise.)extent
- Angular extent in radians. (Angles increase clockwise.)
NullPointerException
- (unchecked exception) Thrown if center is null.
Thrown if the default outline is Outline.NONE (null).
IllegalArgumentException
- (unchecked exception) Thrown if radius <= 0.public ArcItem(Point center, double radius, double start, double extent, Outline theOutline)
center
- Center point.radius
- Radius.start
- Starting angle in radians. (0 degrees is the positive
X axis; angles increase clockwise.)extent
- Angular extent in radians. (Angles increase
clockwise.)theOutline
- Outline.
NullPointerException
- (unchecked exception) Thrown if center is null.
Thrown if theOutline is Outline.NONE (null).
IllegalArgumentException
- (unchecked exception) Thrown if radius <= 0.Method Detail |
---|
public static ArcItem last()
public Point location()
public void draw(Graphics2D g2d)
draw
in class SlideItem
g2d
- 2-D graphics context.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class OutlinedItem
out
- Object output stream.
IOException
- Thrown if an I/O error occurred.public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class OutlinedItem
in
- Object input stream.
IOException
- Thrown if an I/O error occurred.
ClassNotFoundException
- Thrown if any class needed to deserialize this outlined item cannot
be found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |