net.java.joglutils.msg.actions
Class Action

java.lang.Object
  extended by net.java.joglutils.msg.actions.Action
Direct Known Subclasses:
GLRenderAction, GLResetAction, RayPickAction

public abstract class Action
extends Object

The base class of all actions, which are applied to nodes in the scene graph to implement operations such as rendering.

Subclasses of Action should define, by convention, a method

  public static State getDefaultState()
returning a State object, which is used to enable the elements in the state which should be updated by the action's traversal of nodes. Each Action instance maintains a State object internally which is initialized from this default. Note that different actions may enable different elements of the global state.

Subclasses of Action should also define, by convention, a method

  public static void addActionMethod(Class<? extends Node> nodeType, Method m)
which is used to add action methods to the particular Action class. This may be used by developers to attach new functionality to the Action for new node types they define.


Constructor Summary
Action()
           
 
Method Summary
protected  void apply(ActionTable table, Node node)
          Invokes the appropriate action method for the given Node.
abstract  void apply(Node node)
          Applies this Action to a particular node.
 Path getPath()
          Returns the path to the node currently being traversed.
abstract  State getState()
          Returns the global state this action encompasses, which is altered by the nodes the action traverses.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Method Detail

apply

public abstract void apply(Node node)
Applies this Action to a particular node. This is how operations such as rendering are initiated.


getState

public abstract State getState()
Returns the global state this action encompasses, which is altered by the nodes the action traverses.


getPath

public Path getPath()
Returns the path to the node currently being traversed. The caller should make a copy of this path if it is desired to keep it around.


apply

protected void apply(ActionTable table,
                     Node node)
Invokes the appropriate action method for the given Node.