ij2x.plugin.color
Interface ColorSliderModel


public interface ColorSliderModel

ColorSliderModel.

Colors are represented as arrays of color components represented as BoundedRangeModel's. Each BoundedRangeModel can be visualized using a JSlider having a ColorSliderUI.


Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
           
 void configureSlider(int componentIndex, javax.swing.JSlider slider)
          Configures a JSlider.
 javax.swing.BoundedRangeModel getBoundedRangeModel(int componentIndex)
          Returns the BoundedRangeModel used for the specified component index.
 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 componentIndex)
          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 componentIndex, 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.
 void removeChangeListener(javax.swing.event.ChangeListener l)
           
 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 componentIndex, float newValue)
          Sets a value for an individual component.
 void unconfigureSlider(javax.swing.JSlider slider)
          Unconfigures a JSlider.
 

Method Detail

getColorSpace

java.awt.color.ColorSpace getColorSpace()
Returns the ColorSpace used by this ColorSliderModel.

Returns:
ColorSpace.

setColorSpace

void setColorSpace(java.awt.color.ColorSpace newValue)
Changes the ColorSpace used by this ColorSliderModel.

Parameters:
newValue - ColorSpace.

getComponentCount

int getComponentCount()
Returns the number of components used by this ColorSliderModel.

Returns:
Component count.

getBoundedRangeModel

javax.swing.BoundedRangeModel getBoundedRangeModel(int componentIndex)
Returns the BoundedRangeModel used for the specified component index.

Parameters:
componentIndex - .
Returns:
BoundedRangeModel.

getInterpolatedRGB

int getInterpolatedRGB(int componentIndex,
                       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.

Parameters:
componentIndex -
componentValue -
Returns:
RGB value.

setComponent

void setComponent(int componentIndex,
                  float newValue)
Sets a value for an individual component.

Parameters:
componentIndex -
newValue -

getComponent

float getComponent(int componentIndex)
Gets a value of an individual component.

Parameters:
componentIndex -
Returns:
Value

getComponents

float[] getComponents()
Gets all component values.

Returns:
Values.

addChangeListener

void addChangeListener(javax.swing.event.ChangeListener l)

removeChangeListener

void removeChangeListener(javax.swing.event.ChangeListener l)

configureSlider

void configureSlider(int componentIndex,
                     javax.swing.JSlider slider)
Configures a JSlider.


unconfigureSlider

void unconfigureSlider(javax.swing.JSlider slider)
Unconfigures a JSlider.


getColor

java.awt.Color getColor()
Returns the color value of the model. This is a convenience method for calling getCompositeColor().getColor().

Returns:
color.

setColor

void setColor(java.awt.Color newValue)
Sets the color value of the model. This is a convenience method for calling setCompositeColor(new CompositeColor(getColorSpace(), color.getRGB());

Parameters:
newValue - .