vrml.eai.field
Class EventOutSFColor

java.lang.Object
  extended by vrml.eai.field.BaseField
      extended by vrml.eai.field.EventOut
          extended by vrml.eai.field.EventOutSFColor

public abstract class EventOutSFColor
extends EventOut

Reference to a SFColor event-out slot. Use this class to read values from SFColor event-out slots.

The following example demonstrates how to get the color of an object:

 vrml.eai.Node material = ...;
 vrml.eai.field.EventOutSFColor diffuseColor_changed = (vrml.eai.field.EventOutSFColor)material.getEventOut("diffuseColor_changed");
 float[] color = diffuseColor_changed.getValue();
 System.out.println("red = " + color[0] + ", green = " + color[1] + ", blue = " + color[2]);
 


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 EventOutSFColor()
          Default Constructor.
 
Method Summary
abstract  float[] getValue()
          Returns the current value of the SFColor event-out slot.
abstract  void getValue(float[] value)
          Returns the current value of the SFColor event-out slot.
 
Methods inherited from class vrml.eai.field.EventOut
addVrmlEventListener, getUserData, removeVrmlEventListener, 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

EventOutSFColor

protected EventOutSFColor()
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.getEventOut(java.lang.String) method.

Method Detail

getValue

public abstract float[] getValue()
Returns the current value of the SFColor event-out slot.

The following example demonstrates how to get the color of an object:

 vrml.eai.Node material = ...;
 vrml.eai.field.EventOutSFColor diffuseColor_changed = (vrml.eai.field.EventOutSFColor)material.getEventOut("diffuseColor_changed");
 float[] color = diffuseColor_changed.getValue();
 System.out.println("red = " + color[0] + ", green = " + color[1] + ", blue = " + color[2]);
 

Returns:
An array of three float values that contain the red, green and blue color component. A value of 0 means no intensity, and a value of one means full intensity.

getValue

public abstract void getValue(float[] value)
                       throws java.lang.ArrayIndexOutOfBoundsException
Returns the current value of the SFColor event-out slot.

The following example demonstrates how to get the color of an object:

 vrml.eai.Node material = ...;
 vrml.eai.field.EventOutSFColor diffuseColor_changed = (vrml.eai.field.EventOutSFColor)material.getEventOut("diffuseColor_changed");
 float[] color = new float[3];
 diffuseColor_changed.getValue(color);
 System.out.println("red = " + color[0] + ", green = " + color[1] + ", blue = " + color[2]);
 

Parameters:
value - An array of at least three float values whose first three elements get filled with the red, green and blue color component. A value of 0 means no intensity, and a value of one means full intensity.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the value array has less then three elements.