All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Leaf

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.Node
                   |
                   +----java.media.j3d.Leaf

public abstract class Leaf
extends Node
Leaf Node.


Constructor Index

 o Leaf()
Construct and initialize the Leaf object

Method Index

 o cloneTree(boolean, boolean)
Duplicates all the nodes of the specified sub-graph.
 o updateNodeReferences(NodeReferenceTable)
Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree.

Constructors

 o Leaf
 public Leaf()
Construct and initialize the Leaf object

Methods

 o cloneTree
 public Node cloneTree(boolean forceDuplicate,
                       boolean allowDanglingReferences)
Duplicates all the nodes of the specified sub-graph. For Group Nodes the group node is duplicated via a call to cloneNode and then cloneTree is called for each child node. For Leaf Nodes, component data can either be duplicated or be made a reference to the original data. Leaf Node cloneTree behavior is determined by the duplicateOnCloneTree flag found in every Leaf Node's component data class and by the forceDuplicate paramter.

Parameters:
forceDuplicate - when set to true, causes the duplicateOnCloneTree flag to be ignored. When false, the value of each node's duplicateOnCloneTree determines whether data is duplicated or copied.
allowDanglingReferences - when set to true allows the cloneTree method to complete even whan a dangling reference is discovered. When this parameter is false a DanglingReferenceException is generated as soon as cloneTree detects this situation.
Returns:
a reference to the cloned scene graph.
Throws: DanglingReferenceException
When a dangling reference is discovered during the cloneTree operation and the allowDanglingReference parameter is false.
Overrides:
cloneTree in class Node
See Also:
setDuplicateOnCloneTree
 o updateNodeReferences
 public void updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree. This method is called by cloneTree after all nodes in the sub-graph have been duplicated. The cloned Leaf node's method will be called and the Leaf node can then look up any node references by using the getNewNodeReference method found in the NodeReferenceTable object. If a match is found, a reference to the corresponding Node in the newly cloned sub-graph is returned. If no corresponding reference is found, either a DanglingReferenceException is thrown or a reference to the original node is returned depending on the value of the allowDanglingReferences parameter passed in the cloneTree call.

Parameters:
referenceTable - a NodeReferenceTableObject that contains the getNewNodeReference method needed to search for new object instances.
See Also:
NodeReferenceTable, cloneTree, DanglingReferenceException

All Packages  Class Hierarchy  This Package  Previous  Next  Index