|
||||||||||
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.FilledItem
edu.rit.slides.items.ShapeItem
edu.rit.slides.items.RectangleItem
public class RectangleItem
Class RectangleItem provides a rectangle SlideItem
.
Class RectangleItem keeps track of the "last rectangle item." The static RectangleItem.last() method returns a reference to the last created rectangle item.
When a RectangleItem is created, the "last point" (returned by the Point.last() method) is set to the point where the rectangle item was located.
Field Summary |
---|
Fields inherited from class edu.rit.slides.items.FilledItem |
---|
NORMAL_FILL |
Fields inherited from class edu.rit.slides.items.OutlinedItem |
---|
NORMAL_OUTLINE |
Constructor Summary | |
---|---|
RectangleItem()
Construct a new empty rectangle item. |
|
RectangleItem(Point theLocation,
Size theSize)
Construct a new rectangle item. |
|
RectangleItem(Point theLocation,
Size theSize,
Fill theFill)
Construct a new rectangle item. |
|
RectangleItem(Point theLocation,
Size theSize,
Outline theOutline)
Construct a new rectangle item. |
|
RectangleItem(Point theLocation,
Size theSize,
Outline theOutline,
Fill theFill)
Construct a new rectangle item. |
Method Summary | |
---|---|
Point |
c()
Returns the center point of this rectangle item. |
Point |
e()
Returns the east middle point of this rectangle item. |
static RectangleItem |
last()
Returns the last rectangle item created. |
Point |
location()
Returns this rectangle item's upper left corner location. |
Point |
n()
Returns the north middle point of this rectangle item. |
Point |
ne()
Returns the northeast corner point of this rectangle item. |
Point |
nw()
Returns the northwest corner point of this rectangle item. |
void |
readExternal(ObjectInput in)
Read this rectangle from the given object input stream. |
Point |
s()
Returns the south middle point of this rectangle item. |
Point |
se()
Returns the southeast corner point of this rectangle item. |
Size |
size()
Returns this rectangle item's size. |
Point |
sw()
Returns the southwest corner point of this rectangle item. |
Point |
w()
Returns the west middle point of this rectangle item. |
void |
writeExternal(ObjectOutput out)
Write this rectangle item to the given object output stream. |
Methods inherited from class edu.rit.slides.items.ShapeItem |
---|
draw |
Methods inherited from class edu.rit.slides.items.FilledItem |
---|
setDefaultFill |
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 RectangleItem()
public RectangleItem(Point theLocation, Size theSize)
theLocation
- Upper left corner location.theSize
- Size.
NullPointerException
- (unchecked exception) Thrown if theLocation is null or
theSize is null.
IllegalArgumentException
- (unchecked exception) Thrown if both the default outline is
Outline.NONE (null) and the default fill paint is
Fill.NONE (null).public RectangleItem(Point theLocation, Size theSize, Fill theFill)
theLocation
- Upper left corner location.theSize
- Size.theFill
- Fill paint, or Fill.NONE.
NullPointerException
- (unchecked exception) Thrown if theLocation is null or
theSize is null.
IllegalArgumentException
- (unchecked exception) Thrown if both the default outline is
Outline.NONE (null) and theFill is
Fill.NONE (null).public RectangleItem(Point theLocation, Size theSize, Outline theOutline)
theLocation
- Upper left corner location.theSize
- Size.theOutline
- Outline, or Outline.NONE.
NullPointerException
- (unchecked exception) Thrown if theLocation is null or
theSize is null.
IllegalArgumentException
- (unchecked exception) Thrown if both theOutline is
Outline.NONE (null) and the default fill paint is
Fill.NONE (null).public RectangleItem(Point theLocation, Size theSize, Outline theOutline, Fill theFill)
theLocation
- Upper left corner location.theSize
- Size.theOutline
- Outline, or Outline.NONE.theFill
- Fill paint, or Fill.NONE.
NullPointerException
- (unchecked exception) Thrown if theLocation is null or
theSize is null.
IllegalArgumentException
- (unchecked exception) Thrown if both theOutline is
Outline.NONE (null) and theFill is
Fill.NONE (null).Method Detail |
---|
public static RectangleItem last()
public Point location()
public Size size()
public 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 void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class FilledItem
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 FilledItem
in
- Object input stream.
IOException
- Thrown if an I/O error occurred.
ClassNotFoundException
- Thrown if any class needed to deserialize this rectangle cannot be
found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |