| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Group javax.media.j3d.OrderedGroup
All known Subclasses: javax.media.j3d.DecalGroup,
OrderedGroup | public class OrderedGroup extends Group (Code) | | The OrderedGroup node is a Group that ensures its children render
in a specified order. In addition to the list of children
inherited from the base Group class, OrderedGroup defines an
integer array of child indices that specify the order in which its
children are rendered. This provides a level of indirection in
determining the rendering order of its children. By default, the
child index order array is null, and the children are rendered in
increasing index order.
When the child index order array is non-null, it must be the same
length as the number of children. Every entry in the array must
have a unique value between 0 and numChildren-1 (i.e.,
there must be no duplicate values and no missing indices). The
order that the child indices appear in the child index order array
determines the order in which the children are rendered. The child
at childIndexOrder[0] is rendered first, followed by
childIndexOrder[1] , and so on, with the child at
childIndexOrder[numChildren-1] rendered
last.
The child index order array only affects rendering. List
operations that refer to a child by index, such as getChild(index),
will not be altered by the entries in this array. They will get,
enumerate, add, remove, etc., the children based on the actual
index in the group node. However, some of the list operations,
such as addChild, removeChild, etc., will update the child index
order array as a result of their operation. For example,
removeChild will remove the entry in the child index order array
corresponding to the removed child's index and adjust the remaining
entries accordingly. See the documentation for these methods for
more details.
|
Field Summary | |
final public static int | ALLOW_CHILD_INDEX_ORDER_READ Specifies that this OrderedGroup node
allows reading its child index order information. | final public static int | ALLOW_CHILD_INDEX_ORDER_WRITE Specifies that this OrderedGroup node
allows writing its child index order information. |
Constructor Summary | |
public | OrderedGroup() Constructs and initializes a new OrderedGroup node object. |
Method Summary | |
public void | addChild(Node child, int[] childIndexOrder) Appends the specified child node to this group node's list of
children, and sets the child index order array to the specified
array. | public void | addChild(Node child) Appends the specified child node to this group node's list of children.
If the current child index order array is non-null, the array
is increased in size by one element, and a new element
containing the index of the new child is added to the end of
the array. | public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | createRetained() Creates the retained mode OrderedGroupRetained object that this
OrderedGroup component object will point to. | public int[] | getChildIndexOrder() Retrieves the current childIndexOrder array. | public void | insertChild(Node child, int index) Inserts the specified child node in this group node's list of
children at the specified index.
This method is only supported when the child index order array
is null.
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.
If the current child index order array is non-null, the array
is increased in size by one element, and a new element
containing the index of the new child is added to the end of
the array. | public void | removeAllChildren() Removes all children from this Group node.
If the current child index order array is non-null, then it is set to
a zero-length array (the empty set). | public void | removeChild(int index) Removes the child node at the specified index from this group node's
list of children.
If the current child index order array is non-null, the element
containing the removed child's index will be removed from the
child index order array, and the array will be reduced in size
by one element. | public void | removeChild(Node child) 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.
If the current child index order array is non-null, the element
containing the removed child's index will be removed from the
child index order array, and the array will be reduced in size
by one element. | public void | setChildIndexOrder(int[] childIndexOrder) Sets the childIndexOrder array. | void | verifyAddStates(Node child) | void | verifyChildIndexOrderArray(int[] cIOArr, int plus) |
ALLOW_CHILD_INDEX_ORDER_READ | final public static int ALLOW_CHILD_INDEX_ORDER_READ(Code) | | Specifies that this OrderedGroup node
allows reading its child index order information.
since: Java 3D 1.3 |
ALLOW_CHILD_INDEX_ORDER_WRITE | final public static int ALLOW_CHILD_INDEX_ORDER_WRITE(Code) | | Specifies that this OrderedGroup node
allows writing its child index order information.
since: Java 3D 1.3 |
OrderedGroup | public OrderedGroup()(Code) | | Constructs and initializes a new OrderedGroup node object.
The childIndexOrder array is initialized to null, meaning
that its children are rendered in increasing index order.
|
addChild | public void addChild(Node child, int[] childIndexOrder)(Code) | | Appends the specified child node to this group node's list of
children, and sets the child index order array to the specified
array. If the specified array is null, this node's
childIndexOrder array is set to null. Its children will then
be rendered in increasing index order. If the specified array
is not null, the entire array is copied to this node's
childIndexOrder array. In this case, the length of the array
must be equal to the number of children in this group after the
new child has been added, and every entry in the array must
have a unique value between 0 and numChildren-1
(i.e., there must be no duplicate values and no missing
indices).
Parameters: child - the child to add to this node's list of children Parameters: childIndexOrder - the array that is copied into thisnode's child index order array; this can be null 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. exception: IllegalArgumentException - if the specified array isnon-null and any of the following are true:childIndexOrder.length != numChildren ;childIndexOrder[ i] < 0 ,for i in [0, numChildren-1] ;childIndexOrder[ i] >= numChildren ,for i in [0, numChildren-1] ;childIndexOrder[ i] ==childIndexOrder[ j] ,for i,j in [0, numChildren-1] ,i != j;
since: Java 3D 1.3 |
addChild | public void addChild(Node child)(Code) | | Appends the specified child node to this group node's list of children.
If the current child index order array is non-null, the array
is increased in size by one element, and a new element
containing the index of the new child is added to the end of
the array. Thus, this new child will be rendered last.
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. since: Java 3D 1.3 |
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 |
createRetained | void createRetained()(Code) | | Creates the retained mode OrderedGroupRetained object that this
OrderedGroup component object will point to.
|
getChildIndexOrder | public int[] getChildIndexOrder()(Code) | | Retrieves the current childIndexOrder array.
a copy of this node's childIndexOrder array; thiscan be null. exception: CapabilityNotSetException - if appropriate capability isnot set and this object 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.
This method is only supported when the child index order array
is null.
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. exception: IllegalStateException - if the childIndexOrder array isnot null. since: Java 3D 1.3 |
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.
If the current child index order array is non-null, the array
is increased in size by one element, and a new element
containing the index of the new child is added to the end of
the array. Thus, this new child will be rendered last.
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 since: Java 3D 1.3 |
removeAllChildren | public void removeAllChildren()(Code) | | Removes all children from this Group node.
If the current child index order array is non-null, then it is set to
a zero-length array (the empty set). Note that a zero-length
child index order array is not the same as a null array in that
as new elements are added, the child index order array will grow
and will be used instead of the Group's natural child order.
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.
If the current child index order array is non-null, the element
containing the removed child's index will be removed from the
child index order array, and the array will be reduced in size
by one element. If the child removed was not the last child in
the Group, the values of the child index order array will be
updated to reflect the indices that were renumbered. More
formally, each child whose index in the Group node was greater
than the removed element (before removal) will have its index
decremented by one.
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. since: Java 3D 1.3 |
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.
If the current child index order array is non-null, the element
containing the removed child's index will be removed from the
child index order array, and the array will be reduced in size
by one element. If the child removed was not the last child in
the Group, the values of the child index order array will be
updated to reflect the indices that were renumbered. More
formally, each child whose index in the Group node was greater
than the removed element (before removal) will have its index
decremented by one.
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 |
setChildIndexOrder | public void setChildIndexOrder(int[] childIndexOrder)(Code) | | Sets the childIndexOrder array. If the specified array is
null, this node's childIndexOrder array is set to null. Its
children will then be rendered in increasing index order. If
the specified array is not null, the entire array is copied to
this node's childIndexOrder array. In this case, the length of
the array must be equal to the number of children in this
group, and every entry in the array must have a unique value
between 0 and numChildren-1 (i.e., there must be
no duplicate values and no missing indices).
Parameters: childIndexOrder - the array that is copied into thisnode's child index order array; this can be null exception: IllegalArgumentException - if the specified array isnon-null and any of the following are true:childIndexOrder.length != numChildren ;childIndexOrder[ i] < 0 ,for i in [0, numChildren-1] ;childIndexOrder[ i] >= numChildren ,for i in [0, numChildren-1] ;childIndexOrder[ i] ==childIndexOrder[ j] ,for i,j in [0, numChildren-1] ,i != j;
exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph since: Java 3D 1.3 |
verifyAddStates | void verifyAddStates(Node child)(Code) | | |
verifyChildIndexOrderArray | void verifyChildIndexOrderArray(int[] cIOArr, int plus)(Code) | | |
|
|