edu.rit.slides.items
Class DottedOutline

java.lang.Object
  extended by edu.rit.slides.items.DottedOutline
All Implemented Interfaces:
Outline, Externalizable, Serializable

public class DottedOutline
extends Object
implements Outline

Class DottedOutline provides an object that outlines an area in a SlideItem with a square-cornered dotted stroke in a solid color.

See Also:
Serialized Form

Field Summary
static Fill NORMAL_FILL
          The normal dotted outline fill paint (black).
static DottedOutline NORMAL_OUTLINE
          The normal dotted outline (width = 1, fill paint = black).
static float NORMAL_WIDTH
          The normal dotted outline width (1).
 
Fields inherited from interface edu.rit.slides.items.Outline
NONE
 
Constructor Summary
DottedOutline()
          Construct a new dotted outline object with the normal width (1) and the normal fill paint (black).
DottedOutline(Fill theFill)
          Construct a new dotted outline object with the normal width (1) and the given fill paint.
DottedOutline(float theWidth)
          Construct a new dotted outline object with the given width and the normal fill paint (black).
DottedOutline(float theWidth, Fill theFill)
          Construct a new dotted outline object with the given width and the given fill paint.
 
Method Summary
 float getStrokeWidth()
          Returns the stroke width of this outline.
 void readExternal(ObjectInput in)
          Read this dotted outline object from the given object input stream.
 void setGraphicsContext(Graphics2D g2d)
          Set the given graphics context's stroke and paint attributes as specified by this outline object.
 void writeExternal(ObjectOutput out)
          Write this dotted outline object to the given object output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL_WIDTH

public static final float NORMAL_WIDTH
The normal dotted outline width (1).

See Also:
Constant Field Values

NORMAL_FILL

public static final Fill NORMAL_FILL
The normal dotted outline fill paint (black).


NORMAL_OUTLINE

public static final DottedOutline NORMAL_OUTLINE
The normal dotted outline (width = 1, fill paint = black).

Constructor Detail

DottedOutline

public DottedOutline()
Construct a new dotted outline object with the normal width (1) and the normal fill paint (black).


DottedOutline

public DottedOutline(float theWidth)
Construct a new dotted outline object with the given width and the normal fill paint (black).

Parameters:
theWidth - Width.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if theWidth is less than or equal to 0.

DottedOutline

public DottedOutline(Fill theFill)
Construct a new dotted outline object with the normal width (1) and the given fill paint.

Parameters:
theFill - Fill paint.
Throws:
NullPointerException - (unchecked exception) Thrown if theFill is null.

DottedOutline

public DottedOutline(float theWidth,
                     Fill theFill)
Construct a new dotted outline object with the given width and the given fill paint.

Parameters:
theWidth - Width.
theFill - Fill paint.
Throws:
IllegalArgumentException - (unchecked exception) Thrown if theWidth is less than or equal to 0.
NullPointerException - (unchecked exception) Thrown if theFill is null.
Method Detail

getStrokeWidth

public float getStrokeWidth()
Returns the stroke width of this outline.

Specified by:
getStrokeWidth in interface Outline

setGraphicsContext

public void setGraphicsContext(Graphics2D g2d)
Set the given graphics context's stroke and paint attributes as specified by this outline object.

Specified by:
setGraphicsContext in interface Outline
Parameters:
g2d - 2-D graphics context.

writeExternal

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

Specified by:
writeExternal in interface Externalizable
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 dotted outline object from the given object input stream.

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


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