pedviz.view.rules
Class Rule

java.lang.Object
  extended by pedviz.view.rules.Rule
Direct Known Subclasses:
AbstractionRule, AbstractionRule3d, ColorRule, GradientRule, HighlightedColorRule, HintRule, PositionZRule, SelectedColorRule, ShapeRule

public abstract class Rule
extends java.lang.Object

This abstract class is the super class for all rules. You must override the method applyRule, with it can adapt the NodeView. More informations about writing your own rules, you will find in the tutorial section.

Author:
Lukas Forer

Field Summary
static int BOTH
          can be used in GraphView2D and GraphView3D.
static int ONLY_2D
          can be used only in GraphView2D.
static int ONLY_3D
          can be used only in GraphView3D.
 
Constructor Summary
Rule()
           
 
Method Summary
abstract  void applyRule(NodeView nodeview)
          Override this method, with it you get the NodeView and can adapt it.
 int getMode()
          Returns the mode.
 boolean isEnabled()
          Returns true, if the rule is enabled.
 void setEnabled(boolean enabled)
          Enables or disables the rule.
 void setMode(int _mode)
          Sets the mode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOTH

public static final int BOTH
can be used in GraphView2D and GraphView3D.

See Also:
Constant Field Values

ONLY_2D

public static final int ONLY_2D
can be used only in GraphView2D.

See Also:
Constant Field Values

ONLY_3D

public static final int ONLY_3D
can be used only in GraphView3D.

See Also:
Constant Field Values
Constructor Detail

Rule

public Rule()
Method Detail

applyRule

public abstract void applyRule(NodeView nodeview)
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. *

Parameters:
nodeview -

isEnabled

public boolean isEnabled()
Returns true, if the rule is enabled.

Returns:
true, if the rule is enabled.

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the rule.

Parameters:
enabled -

setMode

public void setMode(int _mode)
Sets the mode. (BOTH, ONLY_2D, ONLY_3D)

Parameters:
_mode - the mode.

getMode

public int getMode()
Returns the mode. (BOTH, ONLY_2D, ONLY_3D)

Returns:
the mode.