java.lang.Object | |
↳ | javax.swing.colorchooser.DefaultColorSelectionModel |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
changeEvent | Only one ChangeEvent is needed per model instance
since the event's only (read-only) state is the source property. |
||||||||||
listenerList |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a
ChangeListener to the model. | |||||||||||
Returns an array of all the
ChangeListener s added
to this DefaultColorSelectionModel with
addChangeListener . | |||||||||||
Returns the selected
Color which should be
non-null . | |||||||||||
Removes a
ChangeListener from the model. | |||||||||||
Sets the selected color to
color . |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Runs each
ChangeListener 's
stateChanged method. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
javax.swing.colorchooser.ColorSelectionModel
|
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".
Creates a DefaultColorSelectionModel
with the
current color set to Color.white
. This is
the default constructor.
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.
color | the new Color
|
---|
Adds a ChangeListener
to the model.
l | the ChangeListener to be added
|
---|
Returns an array of all the ChangeListener
s added
to this DefaultColorSelectionModel
with
addChangeListener
.
ChangeListener
s added, or an empty
array if no listeners have been addedReturns the selected Color
which should be
non-null
.
Color
Removes a ChangeListener
from the model.
l | the ChangeListener to be removed
|
---|
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.
color | the new Color
|
---|
Runs each ChangeListener
's
stateChanged
method.