1. /*
  2. * @(#)ColorSelectionModel.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.colorchooser;
  8. import javax.swing.*;
  9. import javax.swing.event.*;
  10. import java.awt.Color;
  11. /**
  12. * A model that supports selecting a Color.
  13. *
  14. * @version 1.6 11/29/01
  15. * @author Steve Wilson
  16. *
  17. * @see java.awt.Color
  18. */
  19. public interface ColorSelectionModel {
  20. /**
  21. * @return the model's selection.
  22. * @see #setSelectedColor
  23. */
  24. Color getSelectedColor();
  25. /**
  26. * Sets the model's selected color to <I>color</I>.
  27. *
  28. * Notifies any listeners if the model changes
  29. *
  30. * @see #getSelectedColor
  31. * @see #addChangeListener
  32. */
  33. void setSelectedColor(Color color);
  34. /**
  35. * Adds <I>listener</I> as a listener to changes in the model.
  36. */
  37. void addChangeListener(ChangeListener listener);
  38. /**
  39. * Removes <I>listener</I> as a listener to changes in the model.
  40. */
  41. void removeChangeListener(ChangeListener listener);
  42. }