|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvrml.eai.field.BaseField
vrml.eai.field.EventOut
vrml.eai.field.EventOutMField
vrml.eai.field.EventOutMFTime
public abstract class EventOutMFTime
Reference to a MFTime event-out slot. Use this class to read values from MFTime event-out slots.
The following example gets the values of an "timestamps_changed" event-out slot of a Script node and prints them to the console:
vrml.eai.Node script = ...;
vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
double[] t = timestamps_changed.getValue();
for (int i = 0; i < t.length; ++i)
System.out.println(new java.util.Date((long)(t[i] * 1000.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, SFNode, SFRotation, SFString, SFTime, SFVec2f, SFVec3f |
| Constructor Summary | |
|---|---|
protected |
EventOutMFTime()
Default Constructor. |
| Method Summary | |
|---|---|
abstract double |
get1Value(int index)
Returns one element of a MFTime event-out slot. |
abstract double[] |
getValue()
Returns the current value of a MFTime event-out slot. |
abstract void |
getValue(double[] value)
Returns the current value of a MFTime event-out slot. |
| Methods inherited from class vrml.eai.field.EventOutMField |
|---|
size |
| 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 |
|---|
protected EventOutMFTime()
Node.getEventOut(java.lang.String) method.
| Method Detail |
|---|
public abstract double[] getValue()
The following example gets the values of an "timestamps_changed" event-out slot of a Script node and prints them to the console:
vrml.eai.Node script = ...;
vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
double[] t = timestamps_changed.getValue();
for (int i = 0; i < t.length; ++i)
System.out.println(new java.util.Date((long)(t[i] * 1000.0)));
public abstract void getValue(double[] value)
throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the values of an "timestamps_changed" event-out slot of a Script node and prints them to the console:
vrml.eai.Node script = ...;
vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
int size = timestamps_changed.size();
double[] t = new double[size];
timestamps_changed.getValue(t);
for (int i = 0; i < size; ++i)
System.out.println(new java.util.Date((long)(t[i] * 1000.0)));
value - An array of double values that gets filled with the
current time values of the MFTime event-out slot.
The double values contain the number of seconds since
January the 1st, 1970, 00:00:00 GMT.
java.lang.ArrayIndexOutOfBoundsException - when the value array is too
small.
public abstract double get1Value(int index)
throws java.lang.ArrayIndexOutOfBoundsException
The following example gets the first value of an "timestamps_changed" event-out slot of a Script node and prints it to the console:
vrml.eai.Node script = ...;
vrml.eai.field.EventOutMFTime timestamps_changed = (vrml.eai.field.EventOutMFTime)script.getEventOut("timestamps_changed");
System.out.println(new java.util.Date((long)(timestamps_changed.get1Value(0) * 1000.0)));
index - The index of the element, starting at 0.
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||