edu.rit.draw.item
Class DottedOutline
- java.lang.Object
-
- edu.rit.draw.item.DottedOutline
-
- All Implemented Interfaces:
- Outline, java.io.Externalizable, java.io.Serializable
public class DottedOutline extends java.lang.Object implements Outline
Class DottedOutline provides an object that outlines an area in a DrawingItem with a round dotted stroke in a solid color.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static FillNORMAL_FILLThe normal dotted outline fill paint (black).static DottedOutlineNORMAL_OUTLINEThe normal dotted outline (width = 1, fill paint = black).static floatNORMAL_WIDTHThe normal dotted outline width (1).
-
Constructor Summary
Constructors Constructor and Description DottedOutline()Construct a new dotted outline object with the normal width (1) and the normal fill paint (black).DottedOutline(DottedOutline theOutline)Construct a new dotted outline object with the same width and fill paint as the given dotted outline object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Fillfill()Returns this dotted outline object's fill paint.DottedOutlinefill(Fill theFill)Set this dotted outline object's fill paint.floatgetStrokeWidth()Returns the stroke width of this outline.voidreadExternal(java.io.ObjectInput in)Read this dotted outline object from the given object input stream.voidsetGraphicsContext(java.awt.Graphics2D g2d)Set the given graphics context's stroke and paint attributes as specified by this outline object.floatwidth()Returns this dotted outline object's width.DottedOutlinewidth(float theWidth)Set this dotted outline object's width.voidwriteExternal(java.io.ObjectOutput out)Write this dotted outline object to the given object output stream.
-
-
-
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(DottedOutline theOutline)
Construct a new dotted outline object with the same width and fill paint as the given dotted outline object.- Parameters:
theOutline- Dotted outline object.- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theOutline is null.
-
-
Method Detail
-
width
public float width()
Returns this dotted outline object's width.- Returns:
- Width.
-
width
public DottedOutline width(float theWidth)
Set this dotted outline object's width.- Parameters:
theWidth- Width.- Returns:
- This dotted outline object.
- Throws:
java.lang.IllegalArgumentException- (unchecked exception) Thrown if theWidth is less than or equal to 0.
-
fill
public Fill fill()
Returns this dotted outline object's fill paint.- Returns:
- Fill paint.
-
fill
public DottedOutline fill(Fill theFill)
Set this dotted outline object's fill paint.- Parameters:
theFill- Fill paint.- Returns:
- This dotted outline object.
- Throws:
java.lang.NullPointerException- (unchecked exception) Thrown if theFill is null.
-
getStrokeWidth
public float getStrokeWidth()
Returns the stroke width of this outline.- Specified by:
getStrokeWidthin interfaceOutline- Returns:
- Stroke width.
-
setGraphicsContext
public void setGraphicsContext(java.awt.Graphics2D g2d)
Set the given graphics context's stroke and paint attributes as specified by this outline object.- Specified by:
setGraphicsContextin interfaceOutline- Parameters:
g2d- 2-D graphics context.
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this dotted outline object to the given object output stream.- Specified by:
writeExternalin interfacejava.io.Externalizable- Parameters:
out- Object output stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundExceptionRead this dotted outline object from the given object input stream.- Specified by:
readExternalin interfacejava.io.Externalizable- Parameters:
in- Object input stream.- Throws:
java.io.IOException- Thrown if an I/O error occurred.java.lang.ClassNotFoundException- Thrown if any class needed to deserialize this dotted outline object cannot be found.
-
-
DMelt 3.0 © DataMelt by jWork.ORG