com.mindfusion.diagramming
Class RadialGradientBrush

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

public class RadialGradientBrush
extends Brush

Represents a radial gradient brush.

See Also:
Serialized Form

Constructor Summary
RadialGradientBrush()
          Initializes a new instance of the RadialGradientBrush class.
RadialGradientBrush(java.awt.Color centerColor, java.awt.Color surroundingColor)
          Initializes a new instance of the RadialGradientBrush class.
RadialGradientBrush(java.awt.Color centerColor, java.awt.Color surroundingColor, double x, double y)
          Initializes a new instance of the RadialGradientBrush class.
 
Method Summary
 void applyTo(java.awt.Graphics2D g, java.awt.geom.Rectangle2D bounds)
           
 java.lang.Object clone()
          Creates a clone of the brush.
 java.awt.Color getCenterColor()
          Gets the center color.
 java.awt.Color getSurroundingColor()
          Gets the surrounding color.
 double getX()
          Gets the relative x-coordinate of the center point.
 double getY()
          Gets the relative y-coordinate of the center point.
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
 void setCenterColor(java.awt.Color value)
          Sets the center color.
 void setSurroundingColor(java.awt.Color value)
          Sets the surrounding color.
 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

RadialGradientBrush

public RadialGradientBrush(java.awt.Color centerColor,
                           java.awt.Color surroundingColor)
Initializes a new instance of the RadialGradientBrush class.

Parameters:
color1 - A Color object representing the color at the center point.
color2 - A Color object representing the surrounding color.

RadialGradientBrush

public RadialGradientBrush(java.awt.Color centerColor,
                           java.awt.Color surroundingColor,
                           double x,
                           double y)
Initializes a new instance of the RadialGradientBrush class.

Parameters:
color1 - A Color object representing the color at the center point.
color2 - A Color object representing the surrounding color.
x - The relative x-coordinate of the center point. Value 0.5 indicates the middle of the destiation rectangle.
x - The relative y-coordinate of the center point. Value 0.5 indicates the middle of the destiation rectangle.

RadialGradientBrush

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

Method Detail

applyTo

public void applyTo(java.awt.Graphics2D g,
                    java.awt.geom.Rectangle2D bounds)
Specified by:
applyTo in class Brush

clone

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

Overrides:
clone in class Brush
Returns:
A RadialGradientBrush 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

getCenterColor

public java.awt.Color getCenterColor()
Gets the center color.

Returns:
A Color object representing the center color.

setCenterColor

public void setCenterColor(java.awt.Color value)
Sets the center color.


getSurroundingColor

public java.awt.Color getSurroundingColor()
Gets the surrounding color.

Returns:
A Color object representing the surrounding color.

setSurroundingColor

public void setSurroundingColor(java.awt.Color value)
Sets the surrounding color.


getX

public double getX()
Gets the relative x-coordinate of the center point.

Returns:
A double value specifying the relative x-coordinate.

getY

public double getY()
Gets the relative y-coordinate of the center point.

Returns:
A double value specifying the relative x-coordinate.