vrml.eai.field
Class EventInMFString

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

public abstract class EventInMFString
extends EventIn

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

The following example demonstrates how to set the text lines displayed by a Text node:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventInMFString set_string = (vrml.eai.field.EventInMFString)text.getEventIn("set_string");
 String[] lines = new String[]
 {
     "Hello World!",
     "This is your X3D browser speaking."
 };
 set_string.setValue(lines);
 


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 EventInMFString()
          Default constructor.
 
Method Summary
abstract  void set1Value(int index, java.lang.String value)
          Sets one element of the MFString event-in slot.
abstract  void setValue(java.lang.String[] value)
          Sets the elements of the MFString 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

EventInMFString

protected EventInMFString()
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(java.lang.String[] value)
Sets the elements of the MFString event-in slot.

The following example demonstrates how to set the text lines displayed by a Text node:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventInMFString set_string = (vrml.eai.field.EventInMFString)text.getEventIn("set_string");
 String[] lines = new String[]
 {
     "Hello World!",
     "This is your X3D browser speaking."
 };
 set_string.setValue(lines);
 

Parameters:
value - The new string values.

set1Value

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

The following example demonstrates how to replace the first line displayed by a Text node:

 vrml.eai.Node text = ...;
 vrml.eai.field.EventInMFString set_string = (vrml.eai.field.EventInMFString)text.getEventIn("set_string");
 set_string.set1Value(0, "New first line");
 

Parameters:
index - The index of the element, starting at 0.
value - The new string value.
Throws:
java.lang.ArrayIndexOutOfBoundsException - when the index is invalid.