vrml.eai.field
Class EventInSFColor

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

public abstract class EventInSFColor
extends EventIn

Reference to a SFColor event-in slot. Use this class to write values into SFColor event-in slots.

The following example demonstrates how to set the diffuseColor field of a Material node to red:

 vrml.eai.Node material = ...;
 vrml.eai.field.EventInSFColor set_diffuseColor = (vrml.eai.field.EventInSFColor)material.getEventIn("set_diffuseColor");
 float red_component = 1.0f;
 float green_component = 0.0f;
 float blue_component = 0.0f;
 float[] color = new float[] { red_component, green_component, blue_component };
 set_diffuseColor.setValue(color);
 


Field Summary
 
Fields inherited from class vrml.eai.field.BaseField
MFColor, MFFloat, MFInt32, MFNode, MFRotation, MFString, MFTime, MFVec2f, MFVec3f, SFBool, SFColor, SFFloat, SFImage, SFInt32, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f
 
Constructor Summary
protected EventInSFColor()
          Default constructor.
 
Method Summary
abstract  void setValue(float[] value)
          Sets the value of the SFColor event-in slot.
 
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

EventInSFColor

protected EventInSFColor()
Default constructor. This method is protected, i.e. you cannot create new instances of this class. The only way to get instances is via the Node.getEventIn(java.lang.String) method.

Method Detail

setValue

public abstract void setValue(float[] value)
                       throws java.lang.IllegalArgumentException,
                              java.lang.ArrayIndexOutOfBoundsException
Sets the value of the SFColor event-in slot.

The following example demonstrates how to set the diffuseColor field of a Material node to red:

 vrml.eai.Node material = ...;
 vrml.eai.field.EventInSFColor set_diffuseColor = (vrml.eai.field.EventInSFColor)material.getEventIn("set_diffuseColor");
 float red_component = 1.0f;
 float green_component = 0.0f;
 float blue_component = 0.0f;
 float[] color = new float[] { red_component, green_component, blue_component };
 set_diffuseColor.setValue(color);
 

Parameters:
value - The new color value. This is an array of at least three float values. The first value is the red color component, the second the green, and the third the blue. Each component must be between 0 (no intensity) and 1 (full intensity), inclusively.
Throws:
java.lang.IllegalArgumentException - when one component of the value parameter is not between 0 and 1, inclusively.
java.lang.ArrayIndexOutOfBoundsException - when the value array contains less then three values.