CubeTwister 2.0alpha141 2011-10-13

idx3d
Class idx3d_Group

java.lang.Object
  extended by idx3d.idx3d_CoreObject
      extended by idx3d.idx3d_Node
          extended by idx3d.idx3d_Group
Direct Known Subclasses:
idx3d_Scene

public class idx3d_Group
extends idx3d_Node

The idx3d_Group node object is a general-purpose grouping node. Group nodes have exactly one parent and an arbitrary number of children. Operations on idx3d_Group node objects include adding, removing and enumerating the children of the idx3d_Group node. The subclasses of idx3d_Group node add additional semantics.

Version:
1.0 August 29, 2004 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class idx3d.idx3d_Node
EMPTY_ENUMERATION, parent
 
Fields inherited from class idx3d.idx3d_CoreObject
matrix, normalmatrix
 
Constructor Summary
idx3d_Group()
          Creates a new instance.
 
Method Summary
 void addChild(idx3d_Node child)
          Add a new child as the last child in the group.
 java.util.Enumeration children()
          Return an enumeration of all children.
 idx3d_Node getChild(int index)
          Returns the child at the specified index.
 int getChildCount()
          Returns a count of the number of children.
 void insertChild(idx3d_Node child, int index)
          Insert a new child before the specified index.
 java.util.Enumeration preorderEnumeration()
          Creates and returns an enumeration that traverses the subtree rooted at this node in preorder.
 void removeAllChildren()
          Remove all children.
 void removeChild(idx3d_Node child)
          Returns the specified child.
 void removeChild(int index)
          Remove the child at the specified index.
 void setChild(idx3d_Node child, int index)
          Replace the child at the specified index.
 void validate()
          Validates this node and all its children.
 
Methods inherited from class idx3d.idx3d_Node
getParent, invalidate, isValid
 
Methods inherited from class idx3d.idx3d_CoreObject
getPos, resetTransform, rotate, rotate, rotateSelf, rotateSelf, scale, scale, scaleSelf, scaleSelf, setPos, setPos, setTransform, shift, shift, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

idx3d_Group

public idx3d_Group()
Creates a new instance.

Method Detail

getChildCount

public final int getChildCount()
Returns a count of the number of children.


getChild

public final idx3d_Node getChild(int index)
Returns the child at the specified index.


setChild

public final void setChild(idx3d_Node child,
                           int index)
Replace the child at the specified index.


insertChild

public final void insertChild(idx3d_Node child,
                              int index)
Insert a new child before the specified index.


removeChild

public final void removeChild(int index)
Remove the child at the specified index.


removeChild

public final void removeChild(idx3d_Node child)
Returns the specified child.


children

public final java.util.Enumeration children()
Return an enumeration of all children.

Overrides:
children in class idx3d_Node

removeAllChildren

public void removeAllChildren()
Remove all children.


addChild

public final void addChild(idx3d_Node child)
Add a new child as the last child in the group.


preorderEnumeration

public java.util.Enumeration preorderEnumeration()
Creates and returns an enumeration that traverses the subtree rooted at this node in preorder. The first node returned by the enumeration's nextElement() method is this node.

Modifying the tree by inserting, removing, or moving a node invalidates any enumerations created before the modification.

Returns:
an enumeration for traversing the tree in preorder

validate

public void validate()
Validates this node and all its children.

Overrides:
validate in class idx3d_Node

(c) Werner Randelshofer.
All rights reserved.