com.mindfusion.diagramming
Class Pen

java.lang.Object
  extended by com.mindfusion.diagramming.Pen
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class Pen
extends java.lang.Object
implements java.io.Externalizable

Pen objects are used to draw the borders and decoration lines of boxes, the frame lines of tables and cells and the segments of arrows. A pen is assigned to an item via the DiagramItem.setPen(com.mindfusion.diagramming.Pen) method.

See Also:
Serialized Form

Constructor Summary
Pen()
          Initializes a new Pen instance.
Pen(float width, java.awt.Color color)
          Initializes a new Pen instance.
Pen(float width, java.awt.Color color, DashStyle dashStyle)
          Initializes a new Pen instance.
 
Method Summary
 java.lang.Object clone()
          Creates a copy of this pen.
 java.awt.Color getColor()
          Gets the color of this pen.
 DashStyle getDashStyle()
          Gets the dash style of this pen.
 float getWidth()
          Gets the width of the lines drawn with this pen.
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
 void setColor(java.awt.Color value)
          Sets the color of this pen.
 void setDashStyle(DashStyle value)
          Sets the dash style of this pen.
 void setWidth(float value)
          Sets what the width of the lines drawn with this pen should be.
 void writeExternal(java.io.ObjectOutput out)
          Implements Externalizable.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Pen

public Pen()
Initializes a new Pen instance.


Pen

public Pen(float width,
           java.awt.Color color)
Initializes a new Pen instance.

Parameters:
width - A float value representing the pen width.
color - A Color object representing the pen color.

Pen

public Pen(float width,
           java.awt.Color color,
           DashStyle dashStyle)
Initializes a new Pen instance.

Parameters:
width - A float value representing the pen width.
color - A Color object representing the pen color.
dashStyle - A DashStyle object representing the pen's dash pattern.
Method Detail

clone

public java.lang.Object clone()
Creates a copy of this pen.

Overrides:
clone in class java.lang.Object
Returns:
The new Pen object.

getColor

public java.awt.Color getColor()
Gets the color of this pen.

Returns:
A Color object representing the pen color.

setColor

public void setColor(java.awt.Color value)
Sets the color of this pen.

Parameters:
value - A Color object representing the pen color.

getWidth

public float getWidth()
Gets the width of the lines drawn with this pen.

Returns:
A float value representing the pen width.

setWidth

public void setWidth(float value)
Sets what the width of the lines drawn with this pen should be.

Parameters:
value - A float value representing the pen width.

getDashStyle

public DashStyle getDashStyle()
Gets the dash style of this pen.

Returns:
A DashStyle object representing the pen's dash pattern.

setDashStyle

public void setDashStyle(DashStyle value)
Sets the dash style of this pen.

Parameters:
value - A DashStyle object representing the pen's dash pattern.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Implements Externalizable.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Implements Externalizable.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException