edu.rit.slides.items
Class ShapeItem

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

public abstract class ShapeItem
extends FilledItem

Class ShapeItem is the abstract base class for a SlideItem that consists of a single 2-D graphics shape with an outline and an interior.

See Also:
Serialized Form

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
ShapeItem()
          Construct a new empty shape item.
ShapeItem(Shape theShape, Outline theOutline, Fill theFill)
          Construct a new shape item.
 
Method Summary
 void draw(Graphics2D g2d)
          Draw this slide item in the given graphics context.
 
Methods inherited from class edu.rit.slides.items.FilledItem
readExternal, setDefaultFill, writeExternal
 
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

ShapeItem

public ShapeItem()
Construct a new empty shape item.


ShapeItem

public ShapeItem(Shape theShape,
                 Outline theOutline,
                 Fill theFill)
Construct a new shape item. The given outline is used. The given fill paint is used.

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

draw

public void draw(Graphics2D g2d)
Draw this slide item in the given graphics context. This method is allowed to change the graphics context's paint, stroke, and transform, and it doesn't have to change them back.

Specified by:
draw in class SlideItem
Parameters:
g2d - 2-D graphics context.


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