com.mindfusion.diagramming
Class GradientBrush

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

public class GradientBrush
extends Brush

Represents a gradient brush which paints the interior of objects starting with one color and gradually changing to another color by interpolating the RGB values of the two colors.

See Also:
Serialized Form

Constructor Summary
GradientBrush()
          Initializes a new instance of the GradientBrush class.
GradientBrush(java.awt.Color color1, java.awt.Color color2, int angle)
          Initializes a new instance of the GradientBrush class.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of the brush.
 int getAngle()
          Gets the gradient orientation angle.
 java.awt.Color getColor1()
          Gets the first gradient color.
 java.awt.Color getColor2()
          Gets the second gradient color.
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
 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

GradientBrush

public GradientBrush(java.awt.Color color1,
                     java.awt.Color color2,
                     int angle)
Initializes a new instance of the GradientBrush class.

Parameters:
color1 - A Color object representing the start color of the gradient.
color2 - A Color object representing the end color of the gradient.
angle - An integer value specifying the gradient orientation.

GradientBrush

public GradientBrush()
Initializes a new instance of the GradientBrush class.

Method Detail

clone

public java.lang.Object clone()
Creates a clone of the brush.

Overrides:
clone in class Brush
Returns:
A GradientBrush instance.

writeExternal

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

Throws:
java.io.IOException

readExternal

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

Throws:
java.io.IOException
java.lang.ClassNotFoundException

getColor1

public java.awt.Color getColor1()
Gets the first gradient color.

Returns:
A Color object representing the fill color.

getColor2

public java.awt.Color getColor2()
Gets the second gradient color.

Returns:
A Color object representing the fill color.

getAngle

public int getAngle()
Gets the gradient orientation angle.

Returns:
A float value specifying the gradient angle.