Java Platform 1.2

javax.swing.colorchooser
Class DefaultColorSelectionModel

java.lang.Object
  |
  +--javax.swing.colorchooser.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
DefaultColorSelectionModel()
          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

changeEvent

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".

listenerList

protected EventListenerList listenerList
Constructor Detail

DefaultColorSelectionModel

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

DefaultColorSelectionModel

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

getSelectedColor

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

setSelectedColor

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

addChangeListener

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

removeChangeListener

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

fireStateChanged

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.