|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rit.draw.item.DrawingItem
public abstract class DrawingItem
Class DrawingItem is the abstract base class for each item on a Drawing. Subclasses provide different kinds of drawing items, such as text, lines, and shapes.
Each drawing item is contained within a rectangular bounding box. Class DrawingItem's methods return the location and dimensions of the bounding box.
| Constructor Summary | |
|---|---|
DrawingItem()
Construct a new drawing item. |
|
DrawingItem(DrawingItem theItem)
Construct a new drawing item that is the same as the given drawing item. |
|
| Method Summary | |
|---|---|
DrawingItem |
add()
Add this drawing item to the end of the default drawing's sequence of drawing items. |
DrawingItem |
add(Drawing theDrawing)
Add this drawing item to the end of the given drawing's sequence of drawing items. |
DrawingItem |
addFirst()
Add this drawing item to the beginning of the default drawing's sequence of drawing items. |
DrawingItem |
addFirst(Drawing theDrawing)
Add this drawing item to the beginning of the given drawing's sequence of drawing items. |
Rectangle2D |
boundingBox()
Returns the rectangular region this drawing item occupies. |
Point |
c()
Returns the center point of this drawing item's bounding box. |
void |
draw(Graphics2D g2d)
Draw this drawing item in the given graphics context. |
Point |
e()
Returns the east middle point of this drawing item's bounding box. |
abstract double |
height()
Returns the height of this drawing item's bounding box. |
Point |
n()
Returns the north middle point of this drawing item's bounding box. |
Point |
ne()
Returns the northeast corner point of this drawing item's bounding box. |
abstract Point |
nw()
Returns the northwest corner point of this drawing item's bounding box. |
void |
readExternal(ObjectInput in)
Read this drawing item from the given object input stream. |
Point |
s()
Returns the south middle point of this drawing item's bounding box. |
Point |
se()
Returns the southeast corner point of this drawing item's bounding box. |
Size |
size()
Returns the size of this drawing item's bounding box. |
Point |
sw()
Returns the southwest corner point of this drawing item's bounding box. |
Point |
w()
Returns the west middle point of this drawing item's bounding box. |
abstract double |
width()
Returns the width of this drawing item's bounding box. |
void |
writeExternal(ObjectOutput out)
Write this drawing item to the given object output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DrawingItem()
public DrawingItem(DrawingItem theItem)
theItem - Drawing item.
NullPointerException - (unchecked exception) Thrown if theItem is null.| Method Detail |
|---|
public Size size()
public abstract double width()
public abstract double height()
public abstract Point nw()
public Point n()
public Point ne()
public Point w()
public Point c()
public Point e()
public Point sw()
public Point s()
public Point se()
public DrawingItem add()
NullPointerException - (unchecked exception) Thrown if there is no default drawing.Drawing.defaultDrawing()public DrawingItem add(Drawing theDrawing)
theDrawing - Drawing.
NullPointerException - (unchecked exception) Thrown if theDrawing is null.public DrawingItem addFirst()
NullPointerException - (unchecked exception) Thrown if there is no default drawing.Drawing.defaultDrawing()public DrawingItem addFirst(Drawing theDrawing)
theDrawing - Drawing.
NullPointerException - (unchecked exception) Thrown if theDrawing is null.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - Object output stream.
IOException - Thrown if an I/O error occurred.
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface Externalizablein - Object input stream.
IOException - Thrown if an I/O error occurred.
ClassNotFoundException - Thrown if any class needed to deserialize this drawing item cannot be
found.public void draw(Graphics2D g2d)
g2d - 2-D graphics context.public Rectangle2D boundingBox()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||