public class RandomColorProvider<T> extends java.lang.Object implements IColorProvider<T>
Constructor and Description |
---|
RandomColorProvider() |
Modifier and Type | Method and Description |
---|---|
protected java.awt.Color |
generateColor()
Generates a new color.
|
java.awt.Color |
getColor(T t)
Returns the color to be used for a given element.
|
protected java.lang.Object |
getKey(T t)
Returns the key which is used for color generation.
|
public RandomColorProvider()
public java.awt.Color getColor(T t)
getColor
in interface IColorProvider<T>
protected java.awt.Color generateColor()
protected java.lang.Object getKey(T t)
Object.equals(Object)
and Object.hashCode()
as this key
is used for color caching as well. The default implementation just uses
the element from getColor(Object)
(i.e. identity).