Xj3D 2.0 VRML/X3D Code API

vrml.eai.field
Class EventInMFColor

java.lang.Object
  extended by vrml.eai.field.BaseField
      extended by vrml.eai.field.EventIn
          extended by vrml.eai.field.EventInMFColor

public abstract class EventInMFColor
extends EventIn

VRML eventIn class for MFColor.

Colour values are represented as floating point numbers between [0 - 1] as per the VRML IS specification Section 4.4.5 Standard units and coordinate system

Version:
1.0 30 April 1998

Field Summary
 
Fields inherited from class vrml.eai.field.BaseField
fieldType, MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f, UNSET_FIELD
 
Constructor Summary
protected EventInMFColor()
          Construct an instance of this class.
 
Method Summary
abstract  void set1Value(int index, float[] value)
          Set a particular colour value in the given eventIn array.
abstract  void setValue(float[][] value)
          Set the value of the array of colours.
 
Methods inherited from class vrml.eai.field.EventIn
getUserData, setUserData
 
Methods inherited from class vrml.eai.field.BaseField
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventInMFColor

protected EventInMFColor()
Construct an instance of this class. Calls the superclass constructor with the type set to MFColor.

Method Detail

setValue

public abstract void setValue(float[][] value)
Set the value of the array of colours. Input is an array of colour values in RGB order. All colour values are required to be in the range 0-1. Colour values outside of this range will generate an IllegalArgumentException. If value[i] that does not contain at least three values will generate an ArrayIndexOutOfBoundsException. If value[i] contains more than three items only the first three values will be used and the rest ignored.

Parameters:
value - The array of colour values where
value[i][0] = Red component [0-1]
value[i][1] = Green component [0-1]
value[i][2] = Blue component [0-1]
Throws:
java.lang.IllegalArgumentException - A colour value(s) was out of range
java.lang.ArrayIndexOutOfBoundsException - A value did not contain at least three values for the colour component

set1Value

public abstract void set1Value(int index,
                               float[] value)
Set a particular colour value in the given eventIn array. To the VRML world this will generate a full MFColor event with the nominated index value changed. Colour values are required to be in the range [0-1].

The value array must contain at least three elements. If the array contains more than 3 values only the first three values will be used and the rest ignored.

If the index is out of the bounds of the current array of data values or the array of values does not contain at least 3 elements an ArrayIndexOutOfBoundsException will be generated. If the colour values are out of range an IllegalArgumentException will be generated.

Parameters:
index - The position to set the colour value
value - The array of colour values where
value[0] = Red component [0-1]
value[1] = Green component [0-1]
value[2] = Blue component [0-1]
Throws:
java.lang.IllegalArgumentException - A colour value(s) was out of range
java.lang.ArrayIndexOutOfBoundsException - A value did not contain at least three values for the colour component

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium