⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orderedgroup.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    }    /**     * 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.     *     * @param child the new child     * @param index at which location to insert. The <code>index</code>     * must be a value     * greater than or equal to 0 and less than or equal to     * <code>numChildren()</code>.     * @exception CapabilityNotSetException if the appropriate capability is     * not set and this group node is part of live or compiled scene graph     * @exception RestrictedAccessException if this group node is part of     * live     * or compiled scene graph and the child node being inserted is not     * a BranchGroup node     * @exception MultipleParentException if <code>child</code> has already     * been added as a child of another group node.     * @exception IndexOutOfBoundsException if <code>index</code> is invalid.     * @exception IllegalStateException if the childIndexOrder array is     * not null.     *     * @since Java 3D 1.3     */    public void insertChild(Node child, int index) {	if (((OrderedGroupRetained)retained).userChildIndexOrder != null) {	    throw new IllegalStateException(J3dI18N.getString("OrderedGroup6"));	}	// Just call super -- the extra work is done by the retained class	super.insertChild(child, index);    }    /**     * Removes the child node at the specified index from this group node's     * list of children.     *     * <p>     * 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.     *     * @param index which child to remove.  The <code>index</code>     * must be a value     * greater than or equal to 0 and less than <code>numChildren()</code>.     * @exception CapabilityNotSetException if the appropriate capability is     * not set and this group node is part of live or compiled scene graph     * @exception RestrictedAccessException if this group node is part of     * live or compiled scene graph and the child node being removed is not     * a BranchGroup node     * @exception IndexOutOfBoundsException if <code>index</code> is invalid.     *     * @since Java 3D 1.3     */    public void removeChild(int index) {	// Just call super -- the extra work is done by the retained class	super.removeChild(index);    }    /**     * Moves the specified branch group node from its existing location to     * the end of this group node's list of children.     *     * <p>     * 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.     *     * @param branchGroup the branch group node to move to this node's list     * of children     * @exception CapabilityNotSetException if the appropriate capability is     * not set and this group node is part of live or compiled scene graph     *     * @since Java 3D 1.3     */    public void moveTo(BranchGroup branchGroup) {	// Just call super -- the extra work is done by the retained class	super.moveTo(branchGroup);    }    /**     * 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.     *     * <p>     * 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.     *     * @param child the child node to be removed.     * @exception CapabilityNotSetException if appropriate capability is     * not set and this object is part of live or compiled scene graph     * @exception RestrictedAccessException if this group node is part of     * live or compiled scene graph and the child node being removed is not     * a BranchGroup node     *     * @since Java 3D 1.3     */    public void removeChild(Node child) {	// Just call super -- the extra work is done by the retained class	super.removeChild(child);    }    /**     * Removes all children from this Group node.     *     * <p>     * 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 is     * not set and this object is part of live or compiled scene graph     * @exception RestrictedAccessException if this group node is part of     * live or compiled scene graph and any of the children being removed are     * not BranchGroup nodes     *     * @since Java 3D 1.3     */    public void removeAllChildren() {	// Just call super -- the extra work is done by the retained class	super.removeAllChildren();    }    /**     * Creates the retained mode OrderedGroupRetained object that this     * OrderedGroup component object will point to.     */    void createRetained() {	this.retained = new OrderedGroupRetained();	this.retained.setSource(this);    }        void verifyAddStates(Node child) {	if (child instanceof SharedGroup) {	    throw new IllegalArgumentException(J3dI18N.getString("Group2"));	}		if (isLiveOrCompiled()) {	    if (! (child instanceof BranchGroup))		throw new RestrictedAccessException(J3dI18N.getString("Group12"));	    	    if(!this.getCapability(ALLOW_CHILDREN_EXTEND))		throw new CapabilityNotSetException(J3dI18N.getString("Group16"));	}    }    void verifyChildIndexOrderArray(int[] cIOArr, int plus) {	if (isLiveOrCompiled()) {	    	    if(!this.getCapability(ALLOW_CHILD_INDEX_ORDER_WRITE)) 		throw new		    CapabilityNotSetException(J3dI18N.getString("OrderedGroup4"));	}	if(cIOArr != null) {	    	    	    if(cIOArr.length != (((GroupRetained)retained).children.size() + plus)) {		throw new 		    IllegalArgumentException(J3dI18N.getString("OrderedGroup0"));	    }	    	    if((checkArr == null) || (checkArr.length != cIOArr.length)) {		checkArr = new boolean[cIOArr.length];	    }	    	    Arrays.fill(checkArr, false);	    	    for(int i=0; i<cIOArr.length; i++) {		if(cIOArr[i] < 0) {		    throw new			IllegalArgumentException(J3dI18N.getString("OrderedGroup1"));		}		else if(cIOArr[i] >= cIOArr.length) {		    throw new			IllegalArgumentException(J3dI18N.getString("OrderedGroup2"));		}		else if(checkArr[cIOArr[i]]) {		    throw new			IllegalArgumentException(J3dI18N.getString("OrderedGroup3"));		}		else {		    checkArr[cIOArr[i]] = true;		}	    }	}    }    /**     * Used to create a new instance of the node.  This routine is called     * by <code>cloneTree</code> to duplicate the current node.     * @param forceDuplicate when set to <code>true</code>, causes the     *  <code>duplicateOnCloneTree</code> flag to be ignored.  When     *  <code>false</code>, the value of each node's     *  <code>duplicateOnCloneTree</code> variable determines whether     *  NodeComponent data is duplicated or copied.     *     * @see Node#cloneTree     * @see Node#cloneNode     * @see Node#duplicateNode     * @see NodeComponent#setDuplicateOnCloneTree     */     public Node cloneNode(boolean forceDuplicate) {	 OrderedGroup og = new OrderedGroup();	 og.duplicateNode(this, forceDuplicate);	 return og;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -