Class DefaultColorProvider<N>
java.lang.Object
de.engehausen.treemap.swing.impl.DefaultColorProvider<N>
- Type Parameters:
N- type of node
- All Implemented Interfaces:
IColorProvider<N,,Color> Serializable
public class DefaultColorProvider<N>
extends Object
implements IColorProvider<N,Color>, Serializable
The default color provider uses a set of colors mapped to nodes
by their hash code (this may appear a little random, but makes them
distinguishable a bit better). It is thread-safe and stateless.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a color provider with blue pastel colors.DefaultColorProvider(Color[] colorArray) Creates the color provider with the given colors. -
Method Summary
Modifier and TypeMethodDescriptiongetColor(ITreeModel<IRectangle<N>> model, IRectangle<N> rectangle)
-
Field Details
-
COLORS
-
colors
-
-
Constructor Details
-
DefaultColorProvider
public DefaultColorProvider()Create a color provider with blue pastel colors. -
DefaultColorProvider
Creates the color provider with the given colors.- Parameters:
colorArray- the colors to use, must not benull.
-
-
Method Details
-
getColor
- Specified by:
getColorin interfaceIColorProvider<N,Color>
-