javax.media.j3d
Class BehaviorRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeRetained
              extended by javax.media.j3d.LeafRetained
                  extended by javax.media.j3d.BehaviorRetained
All Implemented Interfaces:
java.lang.Cloneable, NnuId

 class BehaviorRetained
extends LeafRetained

Behavior is an abstract class that contains the framework for all behavioral components in Java 3D.


Field Summary
(package private)  boolean active
          The current activation status for this behavior; this value is false until it comes into range of a view platform.
(package private) static int BEHAIVORS_IN_BS_LIST
           
(package private)  BoundingLeafRetained boundingLeaf
          The bounding leaf reference
(package private)  boolean conditionSet
          This is a flag that tells the behavior scheduler whether the user-programmed process stimulus called wakeupOn, if it did not, then the wakeupCondition will be set to null.
(package private)  boolean enable
          Flag indicating whether the behavior is enabled.
(package private)  boolean inCallback
          This is a flag that indicates whether we are in an initialize or processStimulus callback.
(package private)  boolean inInitCallback
          This is a flag that indicates whether we are in initialize callback.
(package private)  int isDirty
           
(package private)  WakeupCondition newWakeupCondition
          This is the new WakeupCondition to be set in initialize wakeupOn()
(package private) static int NUM_SCHEDULING_INTERVALS
          The number of scheduling intervals supported by this implementation.
(package private) static int NUM_WAKEUPS
           
(package private) static int SCHEDULE_IN_BS_LIST
           
(package private)  int schedulingInterval
          Current scheduling interval.
(package private)  Bounds schedulingRegion
          The Boundary object defining the behavior's scheduling region.
(package private)  java.lang.Object[] targets
           
(package private) static int TOTAL_INDEXED_UNORDER_SET_TYPES
           
(package private)  Bounds transformedRegion
          The transformed schedulingRegion
(package private)  ViewPlatformRetained vp
          The current view platform for this behavior; this value is false until it comes into range of a view platform.
(package private) static int WAKEUP_ACTIVATE
           
(package private) static int WAKEUP_ACTIVATE_INDEX
           
(package private) static int WAKEUP_DEACTIVATE
           
(package private) static int WAKEUP_DEACTIVATE_INDEX
           
(package private) static int WAKEUP_TIME
           
(package private) static int WAKEUP_TIME_INDEX
           
(package private) static int WAKEUP_VP_ENTRY
           
(package private) static int WAKEUP_VP_ENTRY_INDEX
           
(package private) static int WAKEUP_VP_EXIT
           
(package private) static int WAKEUP_VP_EXIT_INDEX
           
(package private)  int[] wakeupArray
          An array of ints that count how many of each wakup is present
(package private)  WakeupCondition wakeupCondition
          The current wakeup condition.
(package private)  int wakeupMask
          A bitmask that represents all conditions that this behavior is waiting on.
 
Fields inherited from class javax.media.j3d.LeafRetained
boundsDirty, switchState
 
Fields inherited from class javax.media.j3d.NodeRetained
ALTERNATEAPPEARANCE, AMBIENTLIGHT, apiBounds, BACKGROUND, BACKGROUNDSOUND, BEHAVIOR, BOUNDINGLEAF, boundsAutoCompute, BRANCHGROUP, branchGroupPaths, cachedBounds, childIndex, CLIP, collidable, CONESOUND, CONTAINS_VIEWPLATFORM, CURRENT_LOCAL_TO_VWORLD, DECALGROUP, DIRECTIONALLIGHT, EXPONENTIALFOG, geometryBackground, GROUP, inSharedGroup, LAST_LOCAL_TO_VWORLD, LINEARFOG, LINK, localBounds, locale, localToVworld, localToVworldIndex, localToVworldKeys, MODELCLIP, MORPH, nnuId, nodeId, nodeType, NUMNODES, ORDEREDGROUP, orderedId, ORIENTEDSHAPE3D, parent, parentSwitchLink, parentTransformLink, pickable, POINTLIGHT, POINTSOUND, refCount, SHAPE, SHAREDGROUP, SOUNDSCAPE, SPOTLIGHT, staticTransform, SWITCH, TRANSFORMGROUP, universe, validCachedBounds, VIEWPLATFORM, VIEWSPECIFICGROUP
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
BehaviorRetained()
           
 
Method Summary
(package private)  void addWakeupCondition()
           
(package private)  void clearLive(SetLiveState s)
          This clearLive routine first calls the superclass's method, then it deactivates all canvases that are associated with the attached view.
(package private)  void executeInitialize()
          This routine execute the user's initialize method
(package private)  boolean getEnable()
          Retrieves the state of the Behavior enable flag.
(package private)  BoundingLeaf getSchedulingBoundingLeaf()
          Get the Behavior's scheduling region
(package private)  Bounds getSchedulingBounds()
          Get the Behavior's scheduling region.
(package private)  int getSchedulingInterval()
          Retrieves the current scheduling interval of this Behavior node.
protected  View getView()
           
(package private)  WakeupCondition getWakeupCondition()
          Returns this behavior's wakeup criteria.
(package private)  void handleLastWakeupOn(WakeupCondition prevWakeupCond, BehaviorStructure bs)
           
(package private)  void mergeTransform(TransformGroupRetained xform)
           
(package private)  void postId(int postId)
          Post the specified Id.
(package private)  void sendMessage(int mtype)
           
(package private)  void sendMessage(int mtype, java.lang.Object arg)
           
(package private)  void setEnable(boolean state)
          Enables or disables this Behavior.
(package private)  void setLive(SetLiveState s)
          This setLive routine first calls the superclass's method, then it activates all canvases that are associated with the attached view.
(package private)  void setSchedulingBoundingLeaf(BoundingLeaf region)
          Set the Sound's scheduling region to the specified Leaf node.
(package private)  void setSchedulingBounds(Bounds region)
          Set the Behavior's scheduling region.
(package private)  void setSchedulingInterval(int schedulingInterval)
          Sets the scheduling interval of this Behavior node to the specified value.
(package private)  void updateBoundingLeaf(long refTime)
           
(package private)  void updateTransformRegion()
           
(package private)  void updateTransformRegion(Bounds bound)
           
(package private)  void wakeupOn(WakeupCondition criteria)
          Defines this behavior's wakeup criteria.
 
Methods inherited from class javax.media.j3d.LeafRetained
clone, getMirrorObjects, updateBoundingLeaf, updateBounds, updateMirrorObject, updateTransformChange
 
Methods inherited from class javax.media.j3d.NodeRetained
computeCombineBounds, computeNonLiveLocalToVworld, dirtyBoundsCache, doSetLive, equal, findCollidableFlags, findPickableFlags, findTransformLevels, getBounds, getBoundsAutoCompute, getCollidable, getCurrentLocalToVworld, getCurrentLocalToVworld, getCurrentLocalToVworld, getEffectiveBounds, getId, getLastLocalToVworld, getLastLocalToVworld, getLastLocalToVworld, getLocalBounds, getLocale, getLocalToVworld, getLocalToVworld, getLocalToVworld, getParent, getPickable, getVirtualUniverse, isStatic, merge, notifySceneGraphChanged, processViewSpecificInfo, recombineAbove, removeNodeData, searchGeometryAtoms, setAuxData, setBounds, setBoundsAutoCompute, setCollidable, setNodeData, setParent, setPickable, transformBounds, updateCollidable, updateLocalToVworld, updatePickable
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, clone, compile, doSetLive, getSource, handleFrequencyChange, isInSetLive, markAsLive, setCompiled, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAKEUP_ACTIVATE_INDEX

static final int WAKEUP_ACTIVATE_INDEX
See Also:
Constant Field Values

WAKEUP_DEACTIVATE_INDEX

static final int WAKEUP_DEACTIVATE_INDEX
See Also:
Constant Field Values

WAKEUP_VP_ENTRY_INDEX

static final int WAKEUP_VP_ENTRY_INDEX
See Also:
Constant Field Values

WAKEUP_VP_EXIT_INDEX

static final int WAKEUP_VP_EXIT_INDEX
See Also:
Constant Field Values

WAKEUP_TIME_INDEX

static final int WAKEUP_TIME_INDEX
See Also:
Constant Field Values

NUM_WAKEUPS

static final int NUM_WAKEUPS
See Also:
Constant Field Values

WAKEUP_ACTIVATE

static final int WAKEUP_ACTIVATE
See Also:
Constant Field Values

WAKEUP_DEACTIVATE

static final int WAKEUP_DEACTIVATE
See Also:
Constant Field Values

WAKEUP_VP_ENTRY

static final int WAKEUP_VP_ENTRY
See Also:
Constant Field Values

WAKEUP_VP_EXIT

static final int WAKEUP_VP_EXIT
See Also:
Constant Field Values

WAKEUP_TIME

static final int WAKEUP_TIME
See Also:
Constant Field Values

NUM_SCHEDULING_INTERVALS

static final int NUM_SCHEDULING_INTERVALS
The number of scheduling intervals supported by this implementation. This is fixed for a particular implementation and must be at least 10.

See Also:
Constant Field Values

BEHAIVORS_IN_BS_LIST

static final int BEHAIVORS_IN_BS_LIST
See Also:
Constant Field Values

SCHEDULE_IN_BS_LIST

static final int SCHEDULE_IN_BS_LIST
See Also:
Constant Field Values

TOTAL_INDEXED_UNORDER_SET_TYPES

static final int TOTAL_INDEXED_UNORDER_SET_TYPES
See Also:
Constant Field Values

schedulingRegion

Bounds schedulingRegion
The Boundary object defining the behavior's scheduling region.


boundingLeaf

BoundingLeafRetained boundingLeaf
The bounding leaf reference


wakeupCondition

WakeupCondition wakeupCondition
The current wakeup condition.


newWakeupCondition

WakeupCondition newWakeupCondition
This is the new WakeupCondition to be set in initialize wakeupOn()


vp

ViewPlatformRetained vp
The current view platform for this behavior; this value is false until it comes into range of a view platform.


active

boolean active
The current activation status for this behavior; this value is false until it comes into range of a view platform.


enable

boolean enable
Flag indicating whether the behavior is enabled.


schedulingInterval

int schedulingInterval
Current scheduling interval.


conditionSet

boolean conditionSet
This is a flag that tells the behavior scheduler whether the user-programmed process stimulus called wakeupOn, if it did not, then the wakeupCondition will be set to null.


inCallback

boolean inCallback
This is a flag that indicates whether we are in an initialize or processStimulus callback. If wakeupOn is called for this behavior when this flag is not set, an exception will be thrown.


inInitCallback

boolean inInitCallback
This is a flag that indicates whether we are in initialize callback. If wakeupOn is called for this behavior when this flag is true, then its buildTree() will delay until insert nodes message is get. This is because some localToVworld[] that wakeup depends may not initialize when this behavior setLive().


transformedRegion

Bounds transformedRegion
The transformed schedulingRegion


isDirty

int isDirty

wakeupMask

int wakeupMask
A bitmask that represents all conditions that this behavior is waiting on.


wakeupArray

int[] wakeupArray
An array of ints that count how many of each wakup is present


targets

java.lang.Object[] targets
Constructor Detail

BehaviorRetained

BehaviorRetained()
Method Detail

getSchedulingBounds

Bounds getSchedulingBounds()
Get the Behavior's scheduling region.

Returns:
this Behavior's scheduling region information

setSchedulingBounds

void setSchedulingBounds(Bounds region)
Set the Behavior's scheduling region.

Parameters:
region - a region that contains the Behavior's new scheduling bounds

setSchedulingBoundingLeaf

void setSchedulingBoundingLeaf(BoundingLeaf region)
Set the Sound's scheduling region to the specified Leaf node.


setEnable

void setEnable(boolean state)
Enables or disables this Behavior. The default state is enabled.

Parameters:
state - true or false to enable or disable this Behavior

getEnable

boolean getEnable()
Retrieves the state of the Behavior enable flag.

Returns:
the Behavior enable state

setSchedulingInterval

void setSchedulingInterval(int schedulingInterval)
Sets the scheduling interval of this Behavior node to the specified value.

Parameters:
schedulingInterval - the new scheduling interval

getSchedulingInterval

int getSchedulingInterval()
Retrieves the current scheduling interval of this Behavior node.

Returns:
the current scheduling interval

getSchedulingBoundingLeaf

BoundingLeaf getSchedulingBoundingLeaf()
Get the Behavior's scheduling region


setLive

void setLive(SetLiveState s)
This setLive routine first calls the superclass's method, then it activates all canvases that are associated with the attached view.

Overrides:
setLive in class NodeRetained

clearLive

void clearLive(SetLiveState s)
This clearLive routine first calls the superclass's method, then it deactivates all canvases that are associated with the attached view.

Overrides:
clearLive in class NodeRetained

executeInitialize

void executeInitialize()
This routine execute the user's initialize method


wakeupOn

void wakeupOn(WakeupCondition criteria)
Defines this behavior's wakeup criteria.

Parameters:
criteria - The wakeup criterion for this object

handleLastWakeupOn

void handleLastWakeupOn(WakeupCondition prevWakeupCond,
                        BehaviorStructure bs)

getWakeupCondition

WakeupCondition getWakeupCondition()
Returns this behavior's wakeup criteria.

Returns:
criteria The wakeup criteria of this object

postId

void postId(int postId)
Post the specified Id. Behaviors use this method to cause sequential scheduling of other behavior object.

Parameters:
postId - The Id being posted

getView

protected View getView()

updateTransformRegion

void updateTransformRegion(Bounds bound)

updateTransformRegion

void updateTransformRegion()

updateBoundingLeaf

void updateBoundingLeaf(long refTime)

addWakeupCondition

void addWakeupCondition()

sendMessage

final void sendMessage(int mtype,
                       java.lang.Object arg)

sendMessage

final void sendMessage(int mtype)

mergeTransform

void mergeTransform(TransformGroupRetained xform)
Overrides:
mergeTransform in class NodeRetained


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.