Package xj3d.browser
Class NodeEffects
java.lang.Object
xj3d.browser.NodeEffects
- All Implemented Interfaces:
Runnable,org.j3d.aviatrix3d.NodeUpdateListener,org.j3d.renderer.aviatrix3d.util.SceneGraphTraversalObserver
public class NodeEffects
extends Object
implements Runnable, org.j3d.renderer.aviatrix3d.util.SceneGraphTraversalObserver, org.j3d.aviatrix3d.NodeUpdateListener
Visual Effects on a node. Used to highlite or show a node and its
children.
- Author:
- Alan Hudson
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblink(org.j3d.aviatrix3d.Node n, int numFlashes, int flashLength) Blink a node and its children for a certain amount of time.voidobservedNode(org.j3d.aviatrix3d.SceneGraphObject parent, org.j3d.aviatrix3d.SceneGraphObject child, boolean shared, int depth) Notification of a scene graph object that has been traversed in the scene.voidrestoreAlternateAppearance(org.j3d.aviatrix3d.Node n) Restore the alternate appearance for a node.voidrestoreShowAllAppearance(org.j3d.aviatrix3d.Node n) Restore the alternate appearance for all nodes.voidrun()Flashes the node till the maximum is reached.voidsetAlternateAppearance(org.j3d.aviatrix3d.Node n, org.j3d.aviatrix3d.Appearance app) Set an alternate appearance to a node and its children.voidsetShowOnlyAppearance(org.j3d.aviatrix3d.Node n, org.j3d.aviatrix3d.Appearance hiddenAlternateAppearance) Set a show-only appearance to a node and its children.voidvoid
-
Constructor Details
-
NodeEffects
public NodeEffects()
-
-
Method Details
-
observedNode
public void observedNode(org.j3d.aviatrix3d.SceneGraphObject parent, org.j3d.aviatrix3d.SceneGraphObject child, boolean shared, int depth) Notification of a scene graph object that has been traversed in the scene.- Specified by:
observedNodein interfaceorg.j3d.renderer.aviatrix3d.util.SceneGraphTraversalObserver- Parameters:
parent- The parent node of this nodechild- The child node that is being observedshared- true if the object reference has already been traversed and this is beyond the first referencedepth- The depth of traversal from the top of the tree. Starts at 0 for top.
-
updateNodeBoundsChanges
- Specified by:
updateNodeBoundsChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener
-
updateNodeDataChanges
- Specified by:
updateNodeDataChangesin interfaceorg.j3d.aviatrix3d.NodeUpdateListener
-
run
-
setAlternateAppearance
public void setAlternateAppearance(org.j3d.aviatrix3d.Node n, org.j3d.aviatrix3d.Appearance app) Set an alternate appearance to a node and its children. This class has memory for one alternate appearance. Multiple calls to this method will overwrite the previous values.- Parameters:
n- The nodeapp- The new appearance
-
restoreAlternateAppearance
public void restoreAlternateAppearance(org.j3d.aviatrix3d.Node n) Restore the alternate appearance for a node.- Parameters:
n- The node
-
setShowOnlyAppearance
public void setShowOnlyAppearance(org.j3d.aviatrix3d.Node n, org.j3d.aviatrix3d.Appearance hiddenAlternateAppearance) Set a show-only appearance to a node and its children. This class has memory for one alternate appearance. Multiple calls to this method will overwrite the previous values. TODO need to add method to SceneGraphTraversal to turn off other nodes when rendering.- Parameters:
n- The nodehiddenAlternateAppearance- The new appearance
-
restoreShowAllAppearance
public void restoreShowAllAppearance(org.j3d.aviatrix3d.Node n) Restore the alternate appearance for all nodes. TODO need to add method to SceneGraphTraversal to restore other nodes when rendering.- Parameters:
n- The node
-
blink
public void blink(org.j3d.aviatrix3d.Node n, int numFlashes, int flashLength) Blink a node and its children for a certain amount of time. Blinking is implemented with an alternate transparent appearance.- Parameters:
n- The nodenumFlashes- The number of times to blink the node.flashLength- The length in ms of a flash
-