net.sf.jtreemap.swing.provider
Class RandomColorProvider

java.lang.Object
  extended by net.sf.jtreemap.swing.ColorProvider
      extended by net.sf.jtreemap.swing.provider.RandomColorProvider
All Implemented Interfaces:
java.io.Serializable

public class RandomColorProvider
extends ColorProvider

ColorProvider who choose the color between 13 predefined COLOURS.

Each value is associated to a color. If all the COLOURS are already associated the new value is associated to the first color (and so on...)

See Also:
Serialized Form
 

Nested Class Summary
protected  class RandomColorProvider.Legend
          Panel with the legend
 
Constructor Summary
RandomColorProvider(JTreeMap jTreeMap)
          Constructor
 
Method Summary
 java.awt.Color getColor(Value value)
          get the associated color to the value.
 javax.swing.JPanel getLegendPanel()
          get a legend JPanel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomColorProvider

public RandomColorProvider(JTreeMap jTreeMap)
Constructor

Parameters:
jTreeMap - jTreeMap to color
Method Detail

getColor

public java.awt.Color getColor(Value value)
Description copied from class: ColorProvider
get the associated color to the value.

Specified by:
getColor in class ColorProvider
Parameters:
value - double value
Returns:
the associated color to the value

getLegendPanel

public javax.swing.JPanel getLegendPanel()
Description copied from class: ColorProvider
get a legend JPanel.

Specified by:
getLegendPanel in class ColorProvider
Returns:
a legend JPanel