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