/**
  * Sets the selected color to <code>color</code>. Note that setting the color to <code>null</code>
  * is undefined and may have unpredictable results. This method fires a state changed event if it
  * sets the current color to a new non-<code>null</code> color; if the new color is the same as
  * the current color, no event is fired.
  *
  * @param color the new <code>Color</code>
  */
 public void setSelectedColor(Color color) {
   if (color != null && !selectedColor.equals(color)) {
     selectedColor = color;
     fireStateChanged();
   }
 }