net.sf.jtreemap.swing.provider
Class HSBTreeMapColorProvider

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

public class HSBTreeMapColorProvider
extends ColorProvider

An HSB color space color provider for JTreeMap. Uses a specified function to map the values onto the HSB color space. The default is a linear function, but in my experience one of the logarithmic ones works best for this color space.

See Also:
Serialized Form
 

Nested Class Summary
static class HSBTreeMapColorProvider.ColorDistributionTypes
           
 
Constructor Summary
HSBTreeMapColorProvider(JTreeMap treeMap, java.awt.Color color)
           
HSBTreeMapColorProvider(JTreeMap treeMap, java.awt.Color positiveColor, java.awt.Color negativeColor)
           
HSBTreeMapColorProvider(JTreeMap treeMap, float hue, float saturation)
           
HSBTreeMapColorProvider(JTreeMap treeMap, float positiveHue, float positiveSaturation, float negativeHue, float negativeSaturation)
           
HSBTreeMapColorProvider(JTreeMap treeMap, HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution, java.awt.Color color)
           
HSBTreeMapColorProvider(JTreeMap treeMap, HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution, java.awt.Color positiveColor, java.awt.Color negativeColor)
           
HSBTreeMapColorProvider(JTreeMap treeMap, HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution, float hue, float saturation)
           
HSBTreeMapColorProvider(JTreeMap treeMap, HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution, float positiveHue, float positiveSaturation, float negativeHue, float negativeSaturation)
           
 
Method Summary
 void adjustColor(java.awt.Color color)
           
 void adjustColor(java.awt.Color positiveColor, java.awt.Color negativeColor)
           
 void adjustColor(float hue, float saturation)
           
 void adjustColor(float posHue, float posSaturation, float negHue, float negSaturation)
           
 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

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               java.awt.Color color)
Parameters:
treeMap -
color -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution,
                               java.awt.Color color)
Parameters:
treeMap -
colorDistribution -
color -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               java.awt.Color positiveColor,
                               java.awt.Color negativeColor)
Parameters:
treeMap -
positiveColor -
negativeColor -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution,
                               java.awt.Color positiveColor,
                               java.awt.Color negativeColor)
Parameters:
treeMap -
colorDistribution -
positiveColor -
negativeColor -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               float hue,
                               float saturation)
Parameters:
treeMap -
hue -
saturation -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution,
                               float hue,
                               float saturation)
Parameters:
treeMap -
colorDistribution -
hue -
saturation -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               float positiveHue,
                               float positiveSaturation,
                               float negativeHue,
                               float negativeSaturation)
Parameters:
treeMap -
positiveHue -
positiveSaturation -
negativeHue -
negativeSaturation -

HSBTreeMapColorProvider

public HSBTreeMapColorProvider(JTreeMap treeMap,
                               HSBTreeMapColorProvider.ColorDistributionTypes colorDistribution,
                               float positiveHue,
                               float positiveSaturation,
                               float negativeHue,
                               float negativeSaturation)
Parameters:
treeMap -
colorDistribution -
positiveHue -
positiveSaturation -
negativeHue -
negativeSaturation -
Method Detail

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

adjustColor

public void adjustColor(java.awt.Color color)
Parameters:
color -

adjustColor

public void adjustColor(java.awt.Color positiveColor,
                        java.awt.Color negativeColor)
Parameters:
positiveColor -
negativeColor -

adjustColor

public void adjustColor(float hue,
                        float saturation)
Parameters:
hue -
saturation -

adjustColor

public void adjustColor(float posHue,
                        float posSaturation,
                        float negHue,
                        float negSaturation)
Parameters:
posHue -
posSaturation -
negHue -
negSaturation -

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