public class javax.swing.colorchooser
DefaultColorSelectionModel


Show All Login
Java SE 6
  
Implements: ColorSelectionModel, Serializable
Details
A generic implementation of ColorSelectionModel.
version1.16 11/17/05
See also java.awt.Color

Fields
protected 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

Constructors
public DefaultColorSelectionModel()
Creates a DefaultColorSelectionModel with the current color set to Color.white. This is the default constructor.
public DefaultColorSelectionModel(Color color) Details
Creates a DefaultColorSelectionModel with the current color set to color, which should be non-null. Note that setting the color to null is undefined and may have unpredictable results.
colorthe new Color

Methods
public void addChangeListener(ChangeListener l) Details
Adds a ChangeListener to the model.
lthe ChangeListener to be added
protected void fireStateChanged() Details
Runs each ChangeListener's stateChanged method.
See also javax.swing.event.EventListenerList
public void removeChangeListener(ChangeListener l) Details
Removes a ChangeListener from the model.
lthe ChangeListener to be removed

Properties
public ChangeListener[] getChangeListeners() Details
Returns an array of all the ChangeListeners added to this DefaultColorSelectionModel with addChangeListener.
returnall of the ChangeListeners added, or an empty array if no listeners have been added
since1.4
public void setSelectedColor(Color color) Details
Sets the selected color to color. Note that setting the color to null is undefined and may have unpredictable results. This method fires a state changed event if it sets the current color to a new non-null color; if the new color is the same as the current color, no event is fired.
colorthe new Color
public Color getSelectedColor() Details
Returns the selected Color which should be non-null.
returnthe selected Color