This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.colorchooser
class DefaultColorSelectionModel

java.lang.Object extended by javax.swing.colorchooser.DefaultColorSelectionModel
All Implemented Interfaces:
Serializable, ColorSelectionModel

public class DefaultColorSelectionModel
extends Object
implements ColorSelectionModel, Serializable

A generic implementation of ColorSelectionModel.


Field Summary
protected transient 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

          Creates a DefaultColorSelectionModel with the current color set to Color.white.

          Creates a DefaultColorSelectionModel with the current color set to color, which should be non-null.
 
Method Summary
 void

          Adds a ChangeListener to the model.
protected void

          Runs each ChangeListener's stateChanged method.
 ChangeListener[]

          Returns an array of all the ChangeListeners added to this DefaultColorSelectionModel with addChangeListener.
 Color

          Returns the selected Color which should be non-null.
 void

          Removes a ChangeListener from the model.
 void

          Sets the selected color to 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()
Creates a DefaultColorSelectionModel with the current color set to Color.white. This is the default constructor.


DefaultColorSelectionModel

public DefaultColorSelectionModel(Color color)
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.

Parameters:
color - the new Color
Method Detail

addChangeListener

public void addChangeListener(ChangeListener l)
Adds a ChangeListener to the model.

Parameters:
l - the ChangeListener to be added

fireStateChanged

protected void fireStateChanged()
Runs each ChangeListener's stateChanged method.


getChangeListeners

public ChangeListener[] getChangeListeners()
Returns an array of all the ChangeListeners added to this DefaultColorSelectionModel with addChangeListener.

Returns:
all of the ChangeListeners added, or an empty array if no listeners have been added

getSelectedColor

public Color getSelectedColor()
Returns the selected Color which should be non-null.

Returns:
the selected Color

removeChangeListener

public void removeChangeListener(ChangeListener l)
Removes a ChangeListener from the model.

Parameters:
l - the ChangeListener to be removed

setSelectedColor

public void setSelectedColor(Color color)
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.

Parameters:
color - the new Color


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.