be.saltwater.jaqel.scheduler
Class ScheduledBehavior

java.lang.Object
  extended byjavax.media.j3d.SceneGraphObject
      extended byjavax.media.j3d.Node
          extended byjavax.media.j3d.Leaf
              extended byjavax.media.j3d.Behavior
                  extended bybe.saltwater.jaqel.scheduler.ScheduledBehavior
Direct Known Subclasses:
KeyFrameBehavior, MoveBehavior

public abstract class ScheduledBehavior
extends javax.media.j3d.Behavior

A behavior that can notify a CreatureActionScheduler when it's finished. Don't add this Behavior to the scene graph, instead, add it's parent BranchGroup. You can get it with getBranchGroup(). This is needed because a ScheduledBehavior needs to be detached from the scene graph when it has finished.

Author:
Bruno Windels
See Also:
CreatureActionScheduler

Field Summary
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
ScheduledBehavior(CreatureActionScheduler scheduler, javax.media.j3d.Alpha duration)
          Constructor for subclasses.
 
Method Summary
protected  void finishAction()
          Should be called by subclasses when they want to finish this action (all animations in this action).
protected  void finishAnimation()
          Should be called by subclasses when they want to finish this animation.
protected  javax.media.j3d.Alpha getAlpha()
           
 javax.media.j3d.BranchGroup getBranchGroup()
          Returns the BranchGroup you can add to the scene graph.
 void initialize()
          Reset the alpha value and call internalInitialize().
abstract  void internalInitialize()
          Called when this behavior becomes active.
 
Methods inherited from class javax.media.j3d.Behavior
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, processStimulus, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
 
Methods inherited from class javax.media.j3d.Node
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledBehavior

public ScheduledBehavior(CreatureActionScheduler scheduler,
                         javax.media.j3d.Alpha duration)
Constructor for subclasses.

Parameters:
scheduler - The scheduler that must be notified when this animation wants to finish itself or the action.
duration - The alpha value for the time. Is reset when initialize is called. That is why subclasses don't use initialize() but internalInitialize().
Method Detail

initialize

public final void initialize()
Reset the alpha value and call internalInitialize().


internalInitialize

public abstract void internalInitialize()
Called when this behavior becomes active.


finishAnimation

protected final void finishAnimation()
Should be called by subclasses when they want to finish this animation.


finishAction

protected final void finishAction()
Should be called by subclasses when they want to finish this action (all animations in this action).


getBranchGroup

public javax.media.j3d.BranchGroup getBranchGroup()
Returns the BranchGroup you can add to the scene graph. This behavior is a child of this BranchGroup. This is needed because a ScheduledBehavior needs to be detached from the scene graph when it is finished.


getAlpha

protected javax.media.j3d.Alpha getAlpha()