Java Platform 1.2

Class DefaultColorSelectionModel


public class DefaultColorSelectionModel
extends Object
implements ColorSelectionModel, Serializable

A generic implementation of ColorSelectionModel.

See Also:
Color, Serialized Form

Field Summary
protected  ChangeEvent changeEvent
          Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property.
protected  EventListenerList listenerList
Constructor Summary
          Default constructor.
DefaultColorSelectionModel(Color color)
          Initializes selectedColor to color
Method Summary
 void addChangeListener(ChangeListener l)
          Adds a ChangeListener to the model.
protected  void fireStateChanged()
          Run each ChangeListeners stateChanged() method.
 Color getSelectedColor()
 void removeChangeListener(ChangeListener l)
          Removes a ChangeListener from the model.
 void setSelectedColor(Color color)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected transient ChangeEvent changeEvent
Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".


protected EventListenerList listenerList
Constructor Detail


public DefaultColorSelectionModel()
Default constructor. Initializes selectedColor to Color.white


public DefaultColorSelectionModel(Color color)
Initializes selectedColor to color
Method Detail


public Color getSelectedColor()
Specified by:
getSelectedColor in interface ColorSelectionModel


public void setSelectedColor(Color color)
Specified by:
setSelectedColor in interface ColorSelectionModel


public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the model.
Specified by:
addChangeListener in interface ColorSelectionModel


public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model.
Specified by:
removeChangeListener in interface ColorSelectionModel


protected void fireStateChanged()
Run each ChangeListeners stateChanged() method.
See Also:
#setRangeProperties, EventListenerList

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.