Interface ColorSetManager


public interface ColorSetManager
Manage a set of consistent colors.
  • Field Details

    • PROP_REF_COLOR_CHANGED

      static final String PROP_REF_COLOR_CHANGED
      oldValue=old color, newValue=new color
      See Also:
  • Method Details

    • getDefault

      static ColorSetManager getDefault()
    • getReferenceColor

      Color getReferenceColor(int index)
      Get a specific reference color.
      Parameters:
      index - The index of the reference color.
      Returns:
    • getReferenceColors

      List<Color> getReferenceColors()
      Get all the reference colors present in this color set.
      Returns:
      A list of all the reference colors.
    • isReferenceColor

      boolean isReferenceColor(Color c)
      Check if c is one of the reference colors.
      Parameters:
      c -
      Returns:
    • setReferenceColor

      void setReferenceColor(int index, Color c)
      Set the reference color at specified index.

      Fire a PROP_REF_COLOR_CHANGED change event.

      Parameters:
      index - Must be in the reference colors bounds.
      c -
    • getColor

      default Color getColor(Object o)
      Convenience method which calls getColor(System.identityHashCode(o)).
      Parameters:
      o -
      Returns:
    • getColor

      Color getColor(String id)
      Return a color associated to an identifier.

      If identifier does not already exist in the set, it automatically associates a new reference color to it and return it.

      Parameters:
      id - Upper/lower case is ignored.
      Returns:
    • resetColor

      void resetColor(String id)
      Reset the color associated to the specified identifier. So next call to getColor(id) will return a (possibly) new color.
      Parameters:
      id - An identifier which has been already used with getColor(id)
    • resetColor

      default void resetColor(Object o)
      Convenience method which calls resetColor(System.identityHashCode(o)).
      Parameters:
      o -
    • addPropertyChangeListener

      void addPropertyChangeListener(PropertyChangeListener listener)
    • removePropertyChangeListener

      void removePropertyChangeListener(PropertyChangeListener listener)