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, Brush brush)
          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
 void applyTo(java.awt.Graphics2D g)
          Sets the pen as the current pen for the specified Graphics2D object.
 void applyTo(java.awt.Graphics2D g, java.awt.geom.Rectangle2D bounds)
          Sets the pen as the current pen for the specified Graphics2D object.
 java.lang.Object clone()
          Creates a copy of this pen.
 Brush getBrush()
          Gets the color of this pen.
 java.awt.Color getColor()
          Gets the color of this pen.
 DashStyle getDashStyle()
          Gets the dash style of this pen.
 int getLineJoin()
           
 float getWidth()
          Gets the width of the lines drawn with this pen.
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
 void setBrush(Brush value)
          Gets the color of this pen.
 void setColor(java.awt.Color value)
          Sets the color of this pen.
 void setDashStyle(DashStyle value)
          Sets the dash style of this pen.
 void setLineJoin(int value)
           
 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,
           Brush brush)
Initializes a new Pen instance. Instances of the Pen class created using this constructor are currently not serialized.

Parameters:
width - A float value representing the pen width.
color - A Brush 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

applyTo

public void applyTo(java.awt.Graphics2D g)
Sets the pen as the current pen for the specified Graphics2D object.


applyTo

public void applyTo(java.awt.Graphics2D g,
                    java.awt.geom.Rectangle2D bounds)
Sets the pen as the current pen for the specified Graphics2D object.


clone

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

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

getBrush

public Brush getBrush()
Gets the color of this pen.

Returns:
A Brush object representing the pen color.

setBrush

public void setBrush(Brush value)
Gets the color of this pen.

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

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.

getLineJoin

public int getLineJoin()

setLineJoin

public void setLineJoin(int value)

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