FreeWRL/FreeX3D  3.0.0
EventInMFVec2f.java
1 package vrml.external.field;
3 import vrml.external.Node;
5 
6 public class EventInMFVec2f extends EventIn {
7 
8  public EventInMFVec2f() { EventType = FieldTypes.MFVEC2F; }
9 
10  public void setValue(float[][] value) throws IllegalArgumentException {
11  int count;
12  String val;
13 
14  if (value == null) {
15  throw new IllegalArgumentException();
16  }
17  val = "[";
18 
19  for (count = 0; count < value.length; count++) {
20  if (value[count].length < 2) {
21  throw new IllegalArgumentException();
22  }
23  val = val + " " + value[count][0] + " " + value[count][1] + ",";
24  }
25  val = val + "]";
26  Browser.newSendEvent(this,val);
27 
28  return;
29  }
30 
31  public void set1Value(int index, float value[]) throws IllegalArgumentException {
32  if ((value == null) || (index < 0) || (value.length < 2)) {
33  throw new IllegalArgumentException();
34  }
35  Browser.newSendEvent(this, " ONEVAL " + index + " " + value[0] + " " + value[1]);
36 
37  return;
38  }
39 }