vrml.eai.field
Class EventInSFColor
java.lang.Object
vrml.eai.field.BaseField
vrml.eai.field.EventIn
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);
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 |
Method Summary |
abstract void |
setValue(float[] value)
Sets the value of the SFColor event-in slot. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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.