KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > colorchooser > ColorSelectionModel


1 /*
2  * @(#)ColorSelectionModel.java 1.11 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.colorchooser;
9
10 import javax.swing.*;
11 import javax.swing.event.*;
12 import java.awt.Color JavaDoc;
13
14 /**
15  * A model that supports selecting a <code>Color</code>.
16  *
17  * @version 1.11 12/19/03
18  * @author Steve Wilson
19  *
20  * @see java.awt.Color
21  */

22 public interface ColorSelectionModel {
23     /**
24      * Returns the selected <code>Color</code> which should be
25      * non-<code>null</code>.
26      *
27      * @return the selected <code>Color</code>
28      * @see #setSelectedColor
29      */

30     Color JavaDoc getSelectedColor();
31
32     /**
33      * Sets the selected color to <code>color</code>.
34      * Note that setting the color to <code>null</code>
35      * is undefined and may have unpredictable results.
36      * This method fires a state changed event if it sets the
37      * current color to a new non-<code>null</code> color.
38      *
39      * @param color the new <code>Color</code>
40      * @see #getSelectedColor
41      * @see #addChangeListener
42      */

43     void setSelectedColor(Color JavaDoc color);
44
45     /**
46      * Adds <code>listener</code> as a listener to changes in the model.
47      * @param listener the <code>ChangeListener</code> to be added
48      */

49     void addChangeListener(ChangeListener listener);
50
51     /**
52      * Removes <code>listener</code> as a listener to changes in the model.
53      * @param listener the <code>ChangeListener</code> to be removed
54      */

55     void removeChangeListener(ChangeListener listener);
56 }
57
Popular Tags