net.sf.jtreemap.swing.provider
Class RedGreenColorProvider

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

public class RedGreenColorProvider
extends ColorProvider

ColorProvider who, with a max absolute value M, choose the color between values -M and M.

See Also:
Serialized Form
 

Constructor Summary
RedGreenColorProvider(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

RedGreenColorProvider

public RedGreenColorProvider(JTreeMap jTreeMap)
Constructor

Parameters:
jTreeMap - the 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