pedviz.view.rules
Class GradientRule
java.lang.Object
pedviz.view.rules.Rule
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
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
-
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