JHotDraw 7.4.1

org.jhotdraw.color
Interface ColorSliderModel

All Known Implementing Classes:
AbstractColorSlidersModel, DefaultColorSliderModel

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.

Author:
Werner Randelshofer  @version $Id: ColorSliderModel.java 527 2009-06-07 14:28:19Z rawcoder $

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.
 ColorSystem getColorSystem()
          Returns the ColorSystem used by this ColorSliderModel.
 int getComponentCount()
          Returns the number of components used by this ColorSliderModel.
 float getComponentValue(int componentIndex)
          Gets a value of an individual component.
 CompositeColor getCompositeColor()
          Returns a CompositeColor representing the current value of the ColorSliderModel.
 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 setColorSystem(ColorSystem newValue)
          Changes the ColorSystem used by this ColorSliderModel.
 void setComponentValue(int componentIndex, float newValue)
          Sets a value for an individual component.
 void setCompositeColor(CompositeColor newValue)
          Sets the composite color value of the model.
 void unconfigureSlider(javax.swing.JSlider slider)
          Unconfigures a JSlider.
 

Method Detail

getColorSystem

ColorSystem getColorSystem()
Returns the ColorSystem used by this ColorSliderModel.

Returns:
ColorSystem.

setColorSystem

void setColorSystem(ColorSystem newValue)
Changes the ColorSystem used by this ColorSliderModel.

Parameters:
newValue - ColorSystem.

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.

getCompositeColor

CompositeColor getCompositeColor()
Returns a CompositeColor representing the current value of the ColorSliderModel.

Returns:
CompositeColor.

setCompositeColor

void setCompositeColor(CompositeColor newValue)
Sets the composite color value of the model.

Parameters:
newValue - .

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.

setComponentValue

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

Parameters:
componentIndex -
newValue -

getComponentValue

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

Parameters:
componentIndex -
Returns:
Value

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(getColorSystem(), color.getRGB());

Parameters:
newValue - .

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.