pedviz.view.rules
Class GradientRule

java.lang.Object
  extended by pedviz.view.rules.Rule
      extended by pedviz.view.rules.GradientRule

public class GradientRule
extends Rule

This rule allow you to use the nodes color as an indicator for qualitative traits. You can define values like minimal value, maximal value and mean value and assign their to colors. The rule calculates the correct color based on a trait. It works with two or more values.

Author:
lukas forer

Field Summary
 
Fields inherited from class pedviz.view.rules.Rule
BOTH, ONLY_2D, ONLY_3D
 
Constructor Summary
GradientRule(java.lang.String userdata, java.util.HashMap<java.lang.Double,java.awt.Color> colors)
          Constructs a GradientRule with the given trait and the list of values.
 
Method Summary
 void applyRule(NodeView nodeview)
          Override this method, with it you get the NodeView and can adapt it.
 java.lang.String getUserdata()
          Returns the trait.
 void setUserdata(java.lang.String userdata)
          Sets the trait.
 
Methods inherited from class pedviz.view.rules.Rule
getMode, isEnabled, setEnabled, setMode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradientRule

public GradientRule(java.lang.String userdata,
                    java.util.HashMap<java.lang.Double,java.awt.Color> colors)
Constructs a GradientRule with the given trait and the list of values.

Parameters:
userdata -
colors -
Method Detail

getUserdata

public java.lang.String getUserdata()
Returns the trait.

Returns:
the trait.

setUserdata

public void setUserdata(java.lang.String userdata)
Sets the trait.

Parameters:
userdata -

applyRule

public void applyRule(NodeView nodeview)
Description copied from class: Rule
Override this method, with it you get the NodeView and can adapt it. The class NodeView provides the method getNode() for getting a reference to the Node. *

Specified by:
applyRule in class Rule