dsto.dfc.swing.controls
Class Gradient

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
      extended by dsto.dfc.swing.controls.Gradient
All Implemented Interfaces:
Copyable, JavaBean, PropertyEventSource, Serializable, Cloneable

public class Gradient
extends BasicPropertyEventSource

This class is used to represent a colour gradient. It is used by the GradientBar and the GradientPanel. When ever any of the gradients properties are changed, a PropertyChange is fired. If you want to know when certain props change you can simply add yourself as a PropertyChangeListener to the Gradient.

See Also:
Serialized Form

Constructor Summary
Gradient()
          This contructor sets all the paramaters to 0.0f.
Gradient(float initialHue, float colourSpan, float saturation, float brightness, boolean reverse)
           
 
Method Summary
 float getBrightness()
           
 float getColourSpan()
           
 float getInitialHue()
           
 float getSaturation()
           
 boolean isReverse()
           
 void setBrightness(float newBrightness)
           
 void setColourSpan(float newColourSpan)
           
 void setInitialHue(float newInitialHue)
           
 void setReverse(boolean newReverse)
           
 void setSaturation(float newSaturation)
           
 
Methods inherited from class dsto.dfc.util.BasicPropertyEventSource
addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener, setPropertyChangeSource
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gradient

public Gradient()
This contructor sets all the paramaters to 0.0f. Ie you shouldn't using this one. This is there where people prefer to use setter methods on the object.


Gradient

public Gradient(float initialHue,
                float colourSpan,
                float saturation,
                float brightness,
                boolean reverse)
Parameters:
initialHue - This is the starting colour. Where your spectrum ranges from 0.0f to 1.0f (going through the rainbow colours).
colourSpan - This is the width of the spectrum you want to use ranging from 0.0f to 1.0f.
saturation - This is the saturation of the colours.
brightness - This is the brightness of the colours.
Method Detail

getColourSpan

public float getColourSpan()

setColourSpan

public void setColourSpan(float newColourSpan)

getInitialHue

public float getInitialHue()

setInitialHue

public void setInitialHue(float newInitialHue)

getSaturation

public float getSaturation()

setSaturation

public void setSaturation(float newSaturation)

getBrightness

public float getBrightness()

setBrightness

public void setBrightness(float newBrightness)

isReverse

public boolean isReverse()

setReverse

public void setReverse(boolean newReverse)


Copyright © 2008 Commonwealth of Australia