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

📄 textureattributes.java

📁 JAVA3D矩陈的相关类
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
    public void setTextureColorTable(int[][] table) {        if (isLiveOrCompiled())            if (!this.getCapability(ALLOW_COLOR_TABLE_WRITE))                throw new CapabilityNotSetException(J3dI18N.getString("TextureAttributes11"));        if (isLive())            ((TextureAttributesRetained)this.retained).setTextureColorTable(table);        else            ((TextureAttributesRetained)this.retained).initTextureColorTable(table);    }    /**     * Retrieves the texture color table and copies it into the     * specified array.  If the current texture color table is null,     * no values are copied.     *     * @param table the array that will receive a copy of the     * texture color table from this TextureAttributes object.     * The array must be allocated by the caller and must be large     * enough to hold the entire table (that is,     * <code>int[numTextureColorTableComponents][textureColorTableSize]</code>).     *     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *     * @since Java 3D 1.2     */    public void getTextureColorTable(int[][] table) {	if (isLiveOrCompiled())	    if (!this.getCapability(ALLOW_COLOR_TABLE_READ))		throw new CapabilityNotSetException(J3dI18N.getString("TextureAttributes12"));	((TextureAttributesRetained)this.retained).getTextureColorTable(table);	return;    }    /**     * Retrieves the number of color components in the current texture     * color table.  A value of 0 is returned if the texture color     * table is null.     *     * @return the number of color components in the texture color     * table, or 0 if the table is null     *     * @since Java 3D 1.2     */    public int getNumTextureColorTableComponents() {	return (((TextureAttributesRetained)this.retained).getNumTextureColorTableComponents());    }    /**     * Retrieves the size of the current texture color table.  A value     * of 0 is returned if the texture color table is null.     *     * @return the size of the texture color table, or 0 if the table     * is null     *     * @since Java 3D 1.2     */    public int getTextureColorTableSize() {	return (((TextureAttributesRetained)this.retained).getTextureColorTableSize());    }    /**     * Sets the combine mode for the rgb components of the output color      * for this object.     *     * @param combineMode the combine  mode, one of:      * <code>COMBINE_REPLACE</code>,     * <code>COMBINE_MODULATE</code>, <code>COMBINE_ADD</code>,      * <code>COMBINE_ADD_SIGNED</code>, <code>COMBINE_SUBTRACT</code>,     * <code>COMBINE_INTERPOLATE</code>, or <code>COMBINE_DOT3</code>     *     * @exception IllegalArgumentException if <code>combineMode</code>     * is a value other than <code>COMBINE_REPLACE</code>,     * <code>COMBINE_MODULATE</code>, <code>COMBINE_ADD</code>,      * <code>COMBINE_ADD_SIGNED</code>, <code>COMBINE_SUBTRACT</code>,     * <code>COMBINE_INTERPOLATE</code>, or <code>COMBINE_DOT3</code>     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *     * @see Canvas3D#queryProperties     *     * @since Java 3D 1.3     */    public void setCombineRgbMode(int combineMode) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_WRITE)) {                throw new CapabilityNotSetException(				J3dI18N.getString("TextureAttributes16"));	    }	}        if ((combineMode < COMBINE_REPLACE) || (combineMode > COMBINE_DOT3)) {            throw new IllegalArgumentException(		J3dI18N.getString("TextureAttributes20"));        }        if (isLive()) {            ((TextureAttributesRetained)this.retained).setCombineRgbMode(combineMode);        } else {            ((TextureAttributesRetained)this.retained).initCombineRgbMode(combineMode);	}    }    /**     * Sets the combine mode for the alpha component of the output color      * for this object.     *     * @param combineMode the combine  mode, one of:      * <code>COMBINE_REPLACE</code>,     * <code>COMBINE_MODULATE</code>, <code>COMBINE_ADD</code>,      * <code>COMBINE_ADD_SIGNED</code>, <code>COMBINE_SUBTRACT</code>,     * <code>COMBINE_INTERPOLATE</code>, or <code>COMBINE_DOT3</code>     *     * @exception IllegalArgumentException if <code>combineMode</code>     * is a value other than <code>COMBINE_REPLACE</code>,     * <code>COMBINE_MODULATE</code>, <code>COMBINE_ADD</code>,      * <code>COMBINE_ADD_SIGNED</code>, <code>COMBINE_SUBTRACT</code>,     * <code>COMBINE_INTERPOLATE</code>, or <code>COMBINE_DOT3</code>     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *     * @see Canvas3D#queryProperties     *     * @since Java 3D 1.3     */    public void setCombineAlphaMode(int combineMode) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_WRITE)) {                throw new CapabilityNotSetException(                                J3dI18N.getString("TextureAttributes18"));            }           }        if ((combineMode < COMBINE_REPLACE) || (combineMode > COMBINE_DOT3)) {            throw new IllegalArgumentException(                J3dI18N.getString("TextureAttributes20"));        }        if (isLive()) {            ((TextureAttributesRetained)this.retained).setCombineAlphaMode(combineMode);        } else {            ((TextureAttributesRetained)this.retained).initCombineAlphaMode(combineMode);        }    }    /**     * Retrieves the combine mode for the rgb components of the output color     * for this object.     * @return the combine mode for the rgb components.     *     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *     * @since Java 3D 1.3     */    public int getCombineRgbMode() {	if (isLiveOrCompiled()) {	    if (!this.getCapability(ALLOW_COMBINE_READ)) {		throw new CapabilityNotSetException(				J3dI18N.getString("TextureAttributes17"));	    }	}	return ((TextureAttributesRetained)this.retained).getCombineRgbMode();    }    /**     * Retrieves the combine mode for the alpha component of the output color     * for this object.     * @return the combine mode for the alpha component.     *     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *     * @since Java 3D 1.3     */    public int getCombineAlphaMode() {	if (isLiveOrCompiled()) {	    if (!this.getCapability(ALLOW_COMBINE_READ)) {		throw new CapabilityNotSetException(				J3dI18N.getString("TextureAttributes19"));	    }	}	return ((TextureAttributesRetained)this.retained).getCombineAlphaMode();    }    /**     * Sets the source for the rgb components of the specified color operand      * for this object.     *     * @param index color operand in the combine operation     * @param src the color source, one of: <code>COMBINE_OBJECT_COLOR</code>,     * <code>COMBINE_TEXTURE_COLOR</code>,      * <code>COMBINE_CONSTANT_COLOR</code>, or     * <code>COMBINE_PREVIOUS_TEXTURE_UNIT_STATE</code>     *     * @exception IndexOutOfBoundsException if <code>index</code> < 0 or      * <code>index</code> > 2     * @exception IllegalArgumentException if <code>src</code>     * is a value other than <code>COMBINE_OBJECT_COLOR</code>,     * <code>COMBINE_TEXTURE_COLOR</code>,      * <code>COMBINE_CONSTANT_COLOR</code>, or     * <code>COMBINE_PREVIOUS_TEXTURE_UNIT_STATE</code>     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *      * @see Canvas3D#queryProperties     *     * @since Java 3D 1.3     */    public void setCombineRgbSource(int index, int src) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_WRITE)) {                throw new CapabilityNotSetException(                                J3dI18N.getString("TextureAttributes21"));            }           }	if ((index < 0) || (index > 2)) {            throw new IndexOutOfBoundsException(                J3dI18N.getString("TextureAttributes25"));	}        if ((src < COMBINE_OBJECT_COLOR) || 		(src > COMBINE_PREVIOUS_TEXTURE_UNIT_STATE)) {            throw new IllegalArgumentException(                J3dI18N.getString("TextureAttributes26"));        }        if (isLive()) {            ((TextureAttributesRetained)this.retained).setCombineRgbSource(							index, src);        } else {            ((TextureAttributesRetained)this.retained).initCombineRgbSource(							index, src);        }    }    /**     * Sets the source for the alpha component of the specified color operand      * for this object.     *     * @param index color operand in the combine operation     * @param src the color source, one of: <code>COMBINE_OBJECT_COLOR</code>,     * <code>COMBINE_TEXTURE_COLOR</code>,      * <code>COMBINE_CONSTANT_COLOR</code>, or     * <code>COMBINE_PREVIOUS_TEXTURE_UNIT_STATE</code>     *     * @exception IndexOutOfBoundsException if <code>index</code> < 0 or      * <code>index</code> > 2     * @exception IllegalArgumentException if <code>src</code>     * is a value other than <code>COMBINE_OBJECT_COLOR</code>,     * <code>COMBINE_TEXTURE_COLOR</code>,      * <code>COMBINE_CONSTANT_COLOR</code>, or     * <code>COMBINE_PREVIOUS_TEXTURE_UNIT_STATE</code>     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *      * @see Canvas3D#queryProperties     *     * @since Java 3D 1.3     */    public void setCombineAlphaSource(int index, int src) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_WRITE)) {                throw new CapabilityNotSetException(                                J3dI18N.getString("TextureAttributes23"));            }        }        if ((index < 0) || (index > 2)) {            throw new IndexOutOfBoundsException(                J3dI18N.getString("TextureAttributes25"));        }        if ((src < COMBINE_OBJECT_COLOR) ||                 (src > COMBINE_PREVIOUS_TEXTURE_UNIT_STATE)) {            throw new IllegalArgumentException(                J3dI18N.getString("TextureAttributes26"));        }        if (isLive()) {            ((TextureAttributesRetained)this.retained).setCombineAlphaSource(                                                        index, src);        } else {            ((TextureAttributesRetained)this.retained).initCombineAlphaSource(                                                        index, src);        }    }    /**     * Retrieves the source for the rgb components of the specified     * color operand for this object.     *     * @param index color operand in the combine operation     *     * @return the source for the rgb components of the specified color     * operand for this object     *     * @exception IndexOutOfBoundsException if <code>index</code> < 0 or      * <code>index</code> > 2     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *      * @since Java 3D 1.3     */    public int getCombineRgbSource(int index) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_READ)) {                throw new CapabilityNotSetException(                                J3dI18N.getString("TextureAttributes22"));            }        }        if ((index < 0) || (index > 2)) {            throw new IndexOutOfBoundsException(                J3dI18N.getString("TextureAttributes25"));        }        return ((TextureAttributesRetained)this.retained).getCombineRgbSource(index);    }    /**     * Retrieves the source for the alpha component of the specified     * color operand for this object.     *     * @param index color operand in the combine operation     *     * @return the source for the alpha component of the specified color     * operand for this object     *     * @exception IndexOutOfBoundsException if <code>index</code> < 0 or      * <code>index</code> > 2     * @exception CapabilityNotSetException if appropriate capability is      * not set and this object is part of live or compiled scene graph     *      * @since Java 3D 1.3     */    public int getCombineAlphaSource(int index) {        if (isLiveOrCompiled()) {            if (!this.getCapability(ALLOW_COMBINE_READ)) {                throw new CapabilityNotSetException(                                J3dI18N.getString("TextureAttributes24"));            }        }        if ((index < 0) || (index > 2)) {            throw new IndexOutOfBoundsException(                J3dI18N.getString("TextureAttributes25"));        }        return ((TextureAttributesRetained)this.retained).getCombineAlphaSource(index);

⌨️ 快捷键说明

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