vrml.eai.field
Class EventInMFTime

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

public abstract class EventInMFTime
extends EventIn

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

The following example demonstrates how to write two timestamps into a "set_timestamps" field of a Script node:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventInMFTime set_timestamps = (vrml.eai.field.EventInMFTime)script.getEventIn("set_timestamps");
 java.util.Date date = new java.util.Date();
 double currentTime = (double)date.getTime() / 1000.0;
 set_timestamps.setValue(new double[] { currentTime + 5.0, currentTime + 10.0 });
 


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

EventInMFTime

protected EventInMFTime()
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(double[] value)
Sets the elements of the MFTime event-in slot.

The following example demonstrates how to write two timestamps into a "set_timestamps" field of a Script node:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventInMFTime set_timestamps = (vrml.eai.field.EventInMFTime)script.getEventIn("set_timestamps");
 java.util.Date date = new java.util.Date();
 double currentTime = (double)date.getTime() / 1000.0;
 set_timestamps.setValue(new double[] { currentTime + 5.0, currentTime + 10.0 });
 

Parameters:
value - The new time values. These are double values containing the number of seconds since January the 1st, 1970, 00:00:00 GMT.

set1Value

public abstract void set1Value(int index,
                               double value)
                        throws java.lang.ArrayIndexOutOfBoundsException
Sets one element of the MFTime event-in slot.

The following example demonstrates how to write a timestamp into the first element of a "set_timestamps" field of a Script node:

 vrml.eai.Node script = ...;
 vrml.eai.field.EventInMFTime set_timestamps = (vrml.eai.field.EventInMFTime)script.getEventIn("set_timestamps");
 java.util.Date date = new java.util.Date();
 double currentTime = (double)date.getTime() / 1000.0;
 set_timestamps.set1Value(0, currentTime);
 

Parameters:
index - The index of the element, starting at 0.
value - The new time value. This is a double value containing the number of seconds since January the 1st, 1970, 00:00:00 GMT.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.