Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLColorNodeType

All Superinterfaces:
FrameStateListener, VRMLGeometricPropertyNodeType, VRMLNode, VRMLNodeType

public interface VRMLColorNodeType
extends VRMLGeometricPropertyNodeType

A node which specifies color information.

Version:
$Revision: 1.7 $
Author:
Alan Hudson

Method Summary
 void getColor(float[] colors)
          Get current value of field color.
 int getNumColorComponents()
          Get the number of components defined for this texture type.
 int getNumColors()
          Get the number of items in the color array now.
 void setColor(float[] newColor, int numValid)
          Accessor method to set a new value for field attribute color.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLGeometricPropertyNodeType
addComponentListener, removeComponentListener
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Method Detail

getNumColorComponents

int getNumColorComponents()
Get the number of components defined for this texture type. SHould be one of 1, 2, 3 or 4.

Returns:
one of 1, 2, 3 or 4

setColor

void setColor(float[] newColor,
              int numValid)
Accessor method to set a new value for field attribute color.

Parameters:
newColor - An array of 3 floats(r,g,b) specifying the new color
numValid - The number of valid values to copy from the array
Throws:
ArrayIndexOutofBoundsException

getNumColors

int getNumColors()
Get the number of items in the color array now. The number returned is the total number of values in the flat array. This will allow the caller to construct the correct size array for the getColor() call.

Returns:
The number of values in the array

getColor

void getColor(float[] colors)
Get current value of field color. Color is an array of Color or ColorRGBA floats. Don't call if there are no colors in the array.

Parameters:
colors - The array to copy the color values into

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium