| |
|
| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Group
All known Subclasses: javax.media.j3d.Switch, javax.media.j3d.SharedGroup, javax.media.j3d.BranchGroup, javax.media.j3d.ViewSpecificGroup, org.jdesktop.j3d.examples.alternate_appearance.SphereGroup, com.sun.j3d.utils.geometry.Primitive, org.jdesktop.j3dfly.utils.environment.geometry.Primitive, javax.media.j3d.OrderedGroup, javax.media.j3d.TransformGroup,
Group | public class Group extends Node (Code) | | 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.
|
Constructor Summary | |
public | Group() Constructs a Group node with default parameters. |
Method Summary | |
public void | addChild(Node child) Appends the specified child node to this group node's list of children. | public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | Node | cloneTree(boolean forceDuplicate, Hashtable nodeHashtable) Duplicates all the nodes of the specified sub-graph. | void | createRetained() Creates the retained mode GroupRetained object that this
Group component object will point to. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all Node information from
originalNode into
the current node. | public Enumeration | getAllChildren() Returns an Enumeration object of this group node's list of children. | public boolean | getAlternateCollisionTarget() Returns the collision target state. | public Node | getChild(int index) Retrieves the child node at the specified index in
this group node's list of children.
Parameters: index - which child to return. | public Bounds | getCollisionBounds() Returns the collision bounding object of this node. | public int | indexOfChild(Node child) Retrieves the index of the specified child node in
this group node's list of children.
Parameters: child - the child node to be looked up. | public void | insertChild(Node child, int index) Inserts the specified child node in this group node's list of
children at the specified index.
Parameters: child - the new child Parameters: index - at which location to insert. | public 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. | public int | numChildren() Returns a count of this group node's children. | public void | removeAllChildren() Removes all children from this Group node. | public void | removeChild(int index) Removes the child node at the specified index from this group node's
list of children.
Parameters: index - which child to remove. | public void | removeChild(Node child) Removes the specified child node from this group node's
list of children. | public 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. | public 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.
Parameters: child - the new child Parameters: index - which child to replace. | public void | setCollisionBounds(Bounds bounds) Sets the collision bounds of a node. |
ALLOW_CHILDREN_EXTEND | final public static int ALLOW_CHILDREN_EXTEND(Code) | | Specifies that this Group node allows adding new children.
|
ALLOW_CHILDREN_READ | final public static int ALLOW_CHILDREN_READ(Code) | | Specifies that this Group node allows reading its children.
|
ALLOW_CHILDREN_WRITE | final public static int ALLOW_CHILDREN_WRITE(Code) | | Specifies that this Group node allows writing its children.
|
ALLOW_COLLISION_BOUNDS_READ | final public static int ALLOW_COLLISION_BOUNDS_READ(Code) | | Specifies that this Group node allows reading its collision Bounds
|
ALLOW_COLLISION_BOUNDS_WRITE | final public static int ALLOW_COLLISION_BOUNDS_WRITE(Code) | | Specifies that this Group node allows writing its collision Bounds
|
Group | public Group()(Code) | | Constructs a Group node with default parameters. The default
values are as follows:
collision bounds : null
alternate collision target : false
|
addChild | public void addChild(Node child)(Code) | | Appends the specified child node to this group node's list of children.
Parameters: child - the child to add to this node's list of children exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is partof liveor compiled scene graph and the child node being added is nota BranchGroup node exception: MultipleParentException - if child has alreadybeen added as a child of another group node. |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
cloneTree | Node cloneTree(boolean forceDuplicate, Hashtable nodeHashtable)(Code) | | 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 theduplicateOnCloneTree flag to be ignored. When false , the value of eachnode'sduplicateOnCloneTree determines whether data isduplicated or copied. a reference to the cloned scene graph. See Also: NodeComponent.setDuplicateOnCloneTree |
createRetained | void createRetained()(Code) | | Creates the retained mode GroupRetained object that this
Group component object will point to.
|
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all Node information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getAllChildren | public Enumeration getAllChildren()(Code) | | Returns an Enumeration object of this group node's list of children.
an Enumeration object of all the children exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph |
getAlternateCollisionTarget | public boolean getAlternateCollisionTarget()(Code) | | Returns the collision target state.
Indicates whether this Group node can be the target of acollision. |
getChild | public Node getChild(int index)(Code) | | Retrieves the child node at the specified index in
this group node's list of children.
Parameters: index - which child to return. the children at location index. The index must be a valuegreater than or equal to 0 and less than numChildren() . exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph exception: IndexOutOfBoundsException - if index is invalid. |
getCollisionBounds | public Bounds getCollisionBounds()(Code) | | Returns the collision bounding object of this node.
the node's collision bounding object exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
indexOfChild | public int indexOfChild(Node child)(Code) | | Retrieves the index of the specified child node in
this group node's list of children.
Parameters: child - the child node to be looked up. the index of the specified child node;returns -1 if the object is not in the list. exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph since: Java 3D 1.3 |
insertChild | public void insertChild(Node child, int index)(Code) | | Inserts the specified child node in this group node's list of
children at the specified index.
Parameters: child - the new child Parameters: index - at which location to insert. The index must be a valuegreater than or equal to 0 and less than or equal tonumChildren() . exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is part ofliveor compiled scene graph and the child node being inserted is nota BranchGroup node exception: MultipleParentException - if child has alreadybeen added as a child of another group node. exception: IndexOutOfBoundsException - if index is invalid. |
moveTo | public void moveTo(BranchGroup branchGroup)(Code) | | Moves the specified branch group node from its existing location to
the end of this group node's list of children.
Parameters: branchGroup - the branch group node to move to this node's listof children exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph |
numChildren | public int numChildren()(Code) | | Returns a count of this group node's children.
the number of children descendant from this node. exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph |
removeAllChildren | public void removeAllChildren()(Code) | | Removes all children from this Group node.
exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is part oflive or compiled scene graph and any of the children being removed arenot BranchGroup nodes since: Java 3D 1.3 |
removeChild | public void removeChild(int index)(Code) | | Removes the child node at the specified index from this group node's
list of children.
Parameters: index - which child to remove. The index must be a valuegreater than or equal to 0 and less than numChildren() . exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is part oflive or compiled scene graph and the child node being removed is nota BranchGroup node exception: IndexOutOfBoundsException - if index is invalid. |
removeChild | public void removeChild(Node child)(Code) | | Removes the specified child node from this group node's
list of children.
If the specified object is not in the list, the list is not modified.
Parameters: child - the child node to be removed. exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is part oflive or compiled scene graph and the child node being removed is nota BranchGroup node since: Java 3D 1.3 |
setAlternateCollisionTarget | public void setAlternateCollisionTarget(boolean target)(Code) | | 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. The default value is false. For collision with
USE_GEOMETRY set, the collision traverser will check the geometry
of all the Group node's leaf descendants; for collision with
USE_BOUNDS set, the collision traverser will only check the bounds
at this Group node. In both cases, if there is a collision, this
Group node will be reported as the colliding object in the
SceneGraphPath. This reporting is done regardless of whether
ENABLE_COLLISION_REPORTING
is set for this group node (setting alternate collision target to
true implies collision reporting).
Parameters: target - Indicates whether this Group node can be the targetof a collision. See Also: WakeupOnCollisionEntry See Also: WakeupOnCollisionMovement See Also: WakeupOnCollisionExit |
setChild | public void setChild(Node child, int index)(Code) | | Replaces the child node at the specified index in this
group node's list of children with the specified child.
Parameters: child - the new child Parameters: index - which child to replace. The index mustbe a valuegreater than or equal to 0 and less than numChildren() . exception: CapabilityNotSetException - if the appropriate capability isnot set and this group node is part of live or compiled scene graph exception: RestrictedAccessException - if this group node is part oflive or compiled scene graph and the child node being set is nota BranchGroup node exception: MultipleParentException - if child has alreadybeen added as a child of another group node exception: IndexOutOfBoundsException - if index is invalid |
setCollisionBounds | public void setCollisionBounds(Bounds bounds)(Code) | | Sets the collision bounds of a node.
Parameters: bounds - the collision bounding object for a node exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
|
|
|