dsto.dfc.swing.controls
Class Gradient
java.lang.Object
dsto.dfc.util.BasicPropertyEventSource
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)
|
Methods inherited from class dsto.dfc.util.BasicPropertyEventSource |
addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener, setPropertyChangeSource |
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.
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