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 Details

    • COLORS

      protected static final Color[] COLORS
    • colors

      protected final Color[] colors
  • Constructor Details

    • DefaultColorProvider

      public DefaultColorProvider()
      Create a color provider with blue pastel colors.
    • DefaultColorProvider

      public DefaultColorProvider(Color[] colorArray)
      Creates the color provider with the given colors.
      Parameters:
      colorArray - the colors to use, must not be null.
  • Method Details