edu.rit.slides.items
Class FilledItem

java.lang.Object
  extended by edu.rit.slides.items.SlideItem
      extended by edu.rit.slides.items.OutlinedItem
          extended by edu.rit.slides.items.FilledItem
All Implemented Interfaces:
Externalizable, Serializable
Direct Known Subclasses:
ShapeItem

public abstract class FilledItem
extends OutlinedItem
implements Externalizable

Class FilledItem is the abstract base class for a SlideItem that has an outline and is filled with a paint. Specify Fill.NONE for the fill paint to omit filling a slide item's interior.

The static setDefaultFill() method is provided to set the default fill paint. If the fill paint is not specified when constructing a filled item, the current default fill paint is used.

See Also:
Serialized Form

Field Summary
static Fill NORMAL_FILL
          The normal fill paint: White.
 
Fields inherited from class edu.rit.slides.items.OutlinedItem
NORMAL_OUTLINE
 
Constructor Summary
FilledItem()
          Construct a new empty filled item.
FilledItem(Outline theOutline, Fill theFill)
          Construct a new filled item.
 
Method Summary
 void readExternal(ObjectInput in)
          Read this filled item from the given object input stream.
static void setDefaultFill(Fill theFill)
          Set the default fill paint.
 void writeExternal(ObjectOutput out)
          Write this filled item to the given object output stream.
 
Methods inherited from class edu.rit.slides.items.OutlinedItem
setDefaultOutline
 
Methods inherited from class edu.rit.slides.items.SlideItem
draw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL_FILL

public static final Fill NORMAL_FILL
The normal fill paint: White.

Constructor Detail

FilledItem

public FilledItem()
Construct a new empty filled item.


FilledItem

public FilledItem(Outline theOutline,
                  Fill theFill)
Construct a new filled item. The given outline is used. The given fill paint is used.

Parameters:
theOutline - Outline, or Outline.NONE.
theFill - Fill paint, or Fill.NONE.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if both theOutline is Outline.NONE (null) and theFill is Fill.NONE (null).
Method Detail

setDefaultFill

public static void setDefaultFill(Fill theFill)
Set the default fill paint. Before calling this method the first time, the default fill paint is white.

Parameters:
theFill - Fill paint, or Fill.NONE.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Write this filled item to the given object output stream.

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class OutlinedItem
Parameters:
out - Object output stream.
Throws:
IOException - Thrown if an I/O error occurred.

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Read this filled item from the given object input stream.

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class OutlinedItem
Parameters:
in - Object input stream.
Throws:
IOException - Thrown if an I/O error occurred.
ClassNotFoundException - Thrown if any class needed to deserialize this filled outlined item cannot be found.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.