lt.monarch.chart.style
Class GradientStyle<Tag extends AbstractPaintTags>

java.lang.Object
  extended by lt.monarch.chart.style.AbstractStyle<Tag>
      extended by lt.monarch.chart.style.GradientStyle<Tag>
All Implemented Interfaces:
java.io.Serializable

public class GradientStyle<Tag extends AbstractPaintTags>
extends AbstractStyle<Tag>

Object for setting gradient for the

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Style style
           
protected  java.lang.String tag
          Paint tags
 
Fields inherited from class lt.monarch.chart.style.AbstractStyle
dirty
 
Constructor Summary
Constructor and Description
GradientStyle(Style style, java.lang.String tag)
          Default gradient constructor
 
Method Summary
Modifier and Type Method and Description
 void dispose()
          Disposes style object
 boolean equals(GradientStyle<? extends AbstractPaintTags> style2)
          Compares colors, starting and ending positions.
 java.awt.Color[] getColors()
          Gets start and end colors
 float[] getGradientEnd()
          Gets gradient end horizontal and vertical alignments
 float getGradientFactor()
          Sets gradient factor
 float[] getGradientStart()
          Gets gradient start horizontal and vertical alignments respectively
 boolean isCyclic()
          Gets if the gradient is cyclic
 void setColors(java.awt.Color color1, java.awt.Color color2)
          Sets the gradient colors
 void setCyclic(boolean cyclic)
          Sets if the gradient is cyclic
 void setGradientEnd(float halign, float valign)
          Sets the gradient start vertical and horizontal alignment respectively
 void setGradientFactor(float factor)
          Gets gradient factor
 void setGradientStart(float halign, float valign)
          Sets the gradient start vertical and horizontal alignment
 
Methods inherited from class lt.monarch.chart.style.AbstractStyle
finalize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

style

protected Style style

tag

protected java.lang.String tag
Paint tags

Constructor Detail

GradientStyle

public GradientStyle(Style style,
                     java.lang.String tag)
Default gradient constructor

Parameters:
style - stylesheet object
tag - gradient paint tag
Method Detail

setGradientStart

public void setGradientStart(float halign,
                             float valign)
Sets the gradient start vertical and horizontal alignment

Parameters:
halign - horizontal alignment of the gradient start
valign - vertical alignment of the gradient start

getGradientStart

public float[] getGradientStart()
Gets gradient start horizontal and vertical alignments respectively

Returns:
vertical and horizontal alignments of the gradient start

setGradientEnd

public void setGradientEnd(float halign,
                           float valign)
Sets the gradient start vertical and horizontal alignment respectively

Parameters:
halign - horizontal alignment of the gradient start
valign - vertical alignment of the gradient start

getGradientEnd

public float[] getGradientEnd()
Gets gradient end horizontal and vertical alignments

Returns:
vertical and horizontal alignments of the gradient end

setGradientFactor

public void setGradientFactor(float factor)
Gets gradient factor

Parameters:
factor - gradient factor

getGradientFactor

public float getGradientFactor()
Sets gradient factor

Returns:
gradient factor

setCyclic

public void setCyclic(boolean cyclic)
Sets if the gradient is cyclic

Parameters:
cyclic - true if cyclic

isCyclic

public boolean isCyclic()
Gets if the gradient is cyclic

Returns:
true if cyclic

equals

public boolean equals(GradientStyle<? extends AbstractPaintTags> style2)
Compares colors, starting and ending positions.

Parameters:
style2 - style to compare to
Returns:
true if the are the same.

setColors

public void setColors(java.awt.Color color1,
                      java.awt.Color color2)
Sets the gradient colors

Parameters:
color1 - 1st gradient color
color2 - 2nd gradient color

getColors

public java.awt.Color[] getColors()
Gets start and end colors

Returns:
start and end color array

dispose

public void dispose()
Description copied from class: AbstractStyle
Disposes style object

Overrides:
dispose in class AbstractStyle<Tag extends AbstractPaintTags>