public class DefaultColorSliderModel extends AbstractColorSlidersModel
Modifier and Type | Field and Description |
---|---|
protected java.awt.color.ColorSpace |
colorSpace |
protected javax.swing.DefaultBoundedRangeModel[] |
componentModels
Components of the color model.
|
protected java.util.LinkedList<javax.swing.JSlider> |
sliders
JSlider's associated to this model.
|
listeners
propertySupport
Constructor and Description |
---|
DefaultColorSliderModel()
Creates a color slider model with an ICC sRGB color space.
|
DefaultColorSliderModel(java.awt.color.ColorSpace sys)
Creates a color slider model with the specified color space.
|
Modifier and Type | Method and Description |
---|---|
void |
addColorSlider(javax.swing.JSlider slider) |
void |
configureSlider(int componentIndex,
javax.swing.JSlider slider)
Configures a JSlider for this model.
|
protected void |
fireColorChanged(int componentIndex) |
javax.swing.DefaultBoundedRangeModel |
getBoundedRangeModel(int componentIndex)
Returns the bounded range model of the specified color componentIndex.
|
java.awt.Color |
getColor()
Returns the color value of the model.
|
java.awt.color.ColorSpace |
getColorSpace()
Returns the ColorSpace used by this ColorSliderModel.
|
float |
getComponent(int i)
Gets a value of an individual component.
|
int |
getComponentCount()
Returns the number of components used by this ColorSliderModel.
|
float[] |
getComponents()
Gets all component values.
|
int |
getInterpolatedRGB(int i,
float componentValue)
Returns an RGB value based on the value of the specified component index
and value, based on the values of all other components of the model.
|
int |
getSliderValue(int componentIndex)
Returns the value of the specified color componentIndex.
|
void |
removeColorSlider(javax.swing.JSlider slider) |
void |
setColor(java.awt.Color newValue)
Sets the color value of the model.
|
void |
setColorSpace(java.awt.color.ColorSpace newValue)
Changes the ColorSpace used by this ColorSliderModel.
|
void |
setComponent(int i,
float newValue)
Sets a value for an individual component.
|
void |
setSliderValue(int componentIndex,
int value)
Sets the value of the specified color componentIndex.
|
void |
unconfigureSlider(javax.swing.JSlider slider)
Unconfigures a JSlider from this model.
|
addChangeListener, fireStateChanged, removeChangeListener
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
protected java.awt.color.ColorSpace colorSpace
protected java.util.LinkedList<javax.swing.JSlider> sliders
protected javax.swing.DefaultBoundedRangeModel[] componentModels
public DefaultColorSliderModel()
public DefaultColorSliderModel(java.awt.color.ColorSpace sys)
public void setColorSpace(java.awt.color.ColorSpace newValue)
ColorSliderModel
newValue
- ColorSpace.public void configureSlider(int componentIndex, javax.swing.JSlider slider)
public void unconfigureSlider(javax.swing.JSlider slider)
public javax.swing.DefaultBoundedRangeModel getBoundedRangeModel(int componentIndex)
componentIndex
- .public int getSliderValue(int componentIndex)
public void setSliderValue(int componentIndex, int value)
public void addColorSlider(javax.swing.JSlider slider)
public void removeColorSlider(javax.swing.JSlider slider)
protected void fireColorChanged(int componentIndex)
public java.awt.color.ColorSpace getColorSpace()
ColorSliderModel
public int getComponentCount()
ColorSliderModel
public java.awt.Color getColor()
ColorSliderModel
public int getInterpolatedRGB(int i, float componentValue)
ColorSliderModel
public void setComponent(int i, float newValue)
ColorSliderModel
public float getComponent(int i)
ColorSliderModel
public void setColor(java.awt.Color newValue)
ColorSliderModel
newValue
- .public float[] getComponents()
ColorSliderModel