Package org.jjazz.colorsetmanager.api
Interface ColorSetManager
public interface ColorSetManager
Manage a set of consistent colors.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddefault ColorConvenience method which calls getColor(System.identityHashCode(o)).Return a color associated to an identifier.static ColorSetManagergetReferenceColor(int index) Get a specific reference color.Get all the reference colors present in this color set.booleanCheck if c is one of the reference colors.voiddefault voidresetColor(Object o) Convenience method which calls resetColor(System.identityHashCode(o)).voidresetColor(String id) Reset the color associated to the specified identifier.voidsetReferenceColor(int index, Color c) Set the reference color at specified index.
-
Field Details
-
PROP_REF_COLOR_CHANGED
oldValue=old color, newValue=new color- See Also:
-
-
Method Details
-
getDefault
-
getReferenceColor
Get a specific reference color.- Parameters:
index- The index of the reference color.- Returns:
-
getReferenceColors
Get all the reference colors present in this color set.- Returns:
- A list of all the reference colors.
-
isReferenceColor
Check if c is one of the reference colors.- Parameters:
c-- Returns:
-
setReferenceColor
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
Convenience method which calls getColor(System.identityHashCode(o)).- Parameters:
o-- Returns:
-
getColor
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
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
Convenience method which calls resetColor(System.identityHashCode(o)).- Parameters:
o-
-
addPropertyChangeListener
-
removePropertyChangeListener
-