FreeWRL / FreeX3D 4.3.0
EventInMFVec2f.java
1package vrml.external.field;
2import vrml.external.field.FieldTypes;
3import vrml.external.Node;
4import vrml.external.Browser;
5
6public 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}