pedviz.view.rules
Class ShapeRule

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

public class ShapeRule
extends Rule

With this rule you can set a symbol, dependent on the given trait (UserData). You can use it mainly for illustrating the sex and other traits.

Author:
lukas forer

Field Summary
 
Fields inherited from class pedviz.view.rules.Rule
BOTH, ONLY_2D, ONLY_3D
 
Constructor Summary
ShapeRule(java.lang.String userData, java.lang.Object value, Symbol shape)
          Constructs a ShapeRule with given trait id, trait value and the symbol.
ShapeRule(Symbol shape)
          Constructs a ShapeRule with the symbol.
 
Method Summary
 void applyRule(NodeView nodeview)
          Override this method, with it you get the NodeView and can adapt it.
 Symbol getShape()
          Returns the symbol.
 void setShape(Symbol shape)
          Sets the symbol.
 
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

ShapeRule

public ShapeRule(java.lang.String userData,
                 java.lang.Object value,
                 Symbol shape)
Constructs a ShapeRule with given trait id, trait value and the symbol.

Parameters:
userData - trait id
value - trait value
shape - symbol

ShapeRule

public ShapeRule(Symbol shape)
Constructs a ShapeRule with the symbol.

Parameters:
userData - trait id
value - trait value
shape - symbol
Method Detail

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

getShape

public Symbol getShape()
Returns the symbol.

Returns:
the symbol.

setShape

public void setShape(Symbol shape)
Sets the symbol.

Parameters:
shape - the symbol.