org.jhotdraw.color
Interface ColorSliderModel
-
- All Known Implementing Classes:
- AbstractColorSlidersModel, DefaultColorSliderModel, PaletteColorSliderModel
public interface ColorSliderModelColorSliderModel.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
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddChangeListener(javax.swing.event.ChangeListener l)voidconfigureSlider(int componentIndex, javax.swing.JSlider slider)Configures a JSlider.javax.swing.BoundedRangeModelgetBoundedRangeModel(int componentIndex)Returns the BoundedRangeModel used for the specified component index.java.awt.ColorgetColor()Returns the color value of the model.java.awt.color.ColorSpacegetColorSpace()Returns the ColorSpace used by this ColorSliderModel.floatgetComponent(int componentIndex)Gets a value of an individual component.intgetComponentCount()Returns the number of components used by this ColorSliderModel.float[]getComponents()Gets all component values.intgetInterpolatedRGB(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.voidremoveChangeListener(javax.swing.event.ChangeListener l)voidsetColor(java.awt.Color newValue)Sets the color value of the model.voidsetColorSpace(java.awt.color.ColorSpace newValue)Changes the ColorSpace used by this ColorSliderModel.voidsetComponent(int componentIndex, float newValue)Sets a value for an individual component.voidunconfigureSlider(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- .
-
-
DataMelt 3.0 © DataMelt by jWork.ORG