|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Group
public class Group
The Group node object is a general-purpose grouping node. Group nodes have exactly one parent and an arbitrary number of children that are rendered in an unspecified order (or in parallel). Null children are allowed; no operation is performed on a null child node. Operations on Group node objects include adding, removing, and enumerating the children of the Group node. The subclasses of Group node add additional semantics.
Field Summary | |
---|---|
static int |
ALLOW_CHILDREN_EXTEND
Specifies that this Group node allows adding new children. |
static int |
ALLOW_CHILDREN_READ
Specifies that this Group node allows reading its children. |
static int |
ALLOW_CHILDREN_WRITE
Specifies that this Group node allows writing its children. |
static int |
ALLOW_COLLISION_BOUNDS_READ
Specifies that this Group node allows reading its collision Bounds |
static int |
ALLOW_COLLISION_BOUNDS_WRITE
Specifies that this Group node allows writing its collision Bounds |
private static int[] |
readCapabilities
|
Fields inherited from class javax.media.j3d.SceneGraphObject |
---|
nodeHashtable, retained |
Constructor Summary | |
---|---|
Group()
Constructs a Group node with default parameters. |
Method Summary | |
---|---|
void |
addChild(Node child)
Appends the specified child node to this group node's list of children. |
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
(package private) Node |
cloneTree(boolean forceDuplicate,
java.util.Hashtable nodeHashtable)
Duplicates all the nodes of the specified sub-graph. |
(package private) void |
createRetained()
Creates the retained mode GroupRetained object that this Group component object will point to. |
(package private) void |
duplicateAttributes(Node originalNode,
boolean forceDuplicate)
Copies all Node information from originalNode into
the current node. |
java.util.Enumeration |
getAllChildren()
Returns an Enumeration object of this group node's list of children. |
boolean |
getAlternateCollisionTarget()
Returns the collision target state. |
Node |
getChild(int index)
Retrieves the child node at the specified index in this group node's list of children. |
Bounds |
getCollisionBounds()
Returns the collision bounding object of this node. |
int |
indexOfChild(Node child)
Retrieves the index of the specified child node in this group node's list of children. |
void |
insertChild(Node child,
int index)
Inserts the specified child node in this group node's list of children at the specified index. |
void |
moveTo(BranchGroup branchGroup)
Moves the specified branch group node from its existing location to the end of this group node's list of children. |
int |
numChildren()
Returns a count of this group node's children. |
void |
removeAllChildren()
Removes all children from this Group node. |
void |
removeChild(int index)
Removes the child node at the specified index from this group node's list of children. |
void |
removeChild(Node child)
Removes the specified child node from this group node's list of children. |
void |
setAlternateCollisionTarget(boolean target)
Causes this Group node to be reported as the collision target when collision is being used and this node or any of its children is in a collision. |
void |
setChild(Node child,
int index)
Replaces the child node at the specified index in this group node's list of children with the specified child. |
void |
setCollisionBounds(Bounds bounds)
Sets the collision bounds of a node. |
Methods inherited from class javax.media.j3d.Node |
---|
checkDuplicateNode, checkForCycle, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALLOW_CHILDREN_READ
public static final int ALLOW_CHILDREN_WRITE
public static final int ALLOW_CHILDREN_EXTEND
public static final int ALLOW_COLLISION_BOUNDS_READ
public static final int ALLOW_COLLISION_BOUNDS_WRITE
private static final int[] readCapabilities
Constructor Detail |
---|
public Group()
Method Detail |
---|
void createRetained()
createRetained
in class SceneGraphObject
public void setCollisionBounds(Bounds bounds)
bounds
- the collision bounding object for a node
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Bounds getCollisionBounds()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setChild(Node child, int index)
child
- the new childindex
- which child to replace. The index
must
be a value
greater than or equal to 0 and less than numChildren()
.
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part of
live or compiled scene graph and the child node being set is not
a BranchGroup node
MultipleParentException
- if child
has already
been added as a child of another group node
java.lang.IndexOutOfBoundsException
- if index
is invalidpublic void insertChild(Node child, int index)
child
- the new childindex
- at which location to insert. The index
must be a value
greater than or equal to 0 and less than or equal to
numChildren()
.
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part of
live
or compiled scene graph and the child node being inserted is not
a BranchGroup node
MultipleParentException
- if child
has already
been added as a child of another group node.
java.lang.IndexOutOfBoundsException
- if index
is invalid.public void removeChild(int index)
index
- which child to remove. The index
must be a value
greater than or equal to 0 and less than numChildren()
.
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part of
live or compiled scene graph and the child node being removed is not
a BranchGroup node
java.lang.IndexOutOfBoundsException
- if index
is invalid.public Node getChild(int index)
index
- which child to return.
index
must be a value
greater than or equal to 0 and less than numChildren()
.
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graph
java.lang.IndexOutOfBoundsException
- if index
is invalid.public java.util.Enumeration getAllChildren()
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graphpublic void addChild(Node child)
child
- the child to add to this node's list of children
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part
of live
or compiled scene graph and the child node being added is not
a BranchGroup node
MultipleParentException
- if child
has already
been added as a child of another group node.public void moveTo(BranchGroup branchGroup)
branchGroup
- the branch group node to move to this node's list
of children
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graphpublic int numChildren()
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graphpublic int indexOfChild(Node child)
child
- the child node to be looked up.
CapabilityNotSetException
- if the appropriate capability is
not set and this group node is part of live or compiled scene graphpublic void removeChild(Node child)
child
- the child node to be removed.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part of
live or compiled scene graph and the child node being removed is not
a BranchGroup nodepublic void removeAllChildren()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if this group node is part of
live or compiled scene graph and any of the children being removed are
not BranchGroup nodespublic void setAlternateCollisionTarget(boolean target)
target
- Indicates whether this Group node can be the target
of a collision.WakeupOnCollisionEntry
,
WakeupOnCollisionMovement
,
WakeupOnCollisionExit
public boolean getAlternateCollisionTarget()
Node cloneTree(boolean forceDuplicate, java.util.Hashtable nodeHashtable)
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.
cloneTree
in class Node
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.nodeHashtable
- a hashtable used to map orignal node references to
their cloned counterpart.
NodeComponent.setDuplicateOnCloneTree(boolean)
void duplicateAttributes(Node originalNode, boolean forceDuplicate)
originalNode
into
the current node. This method is called from the
cloneNode
method which is, in turn, called by the
cloneTree
method.
duplicateAttributes
in class Node
originalNode
- the original node to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.
RestrictedAccessException
- if this object is part of a live
or compiled scenegraph.Node.duplicateNode(javax.media.j3d.Node, boolean)
,
Node.cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
public Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.
cloneNode
in class Node
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Node.cloneTree()
,
Node.cloneNode(boolean)
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |