blob: 02134cbf75fafefe34583825b85c804a93400c98 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
package NET.worlds.scape;
import java.util.StringTokenizer;
class Point3EditorDialog extends ListEditorDialog {
protected Property property;
protected Point3 p;
Point3EditorDialog(EditTile parent, String title, Property property) {
super(parent, title);
this.property = property;
this.ready();
}
@Override
protected void build() {
this.p = (Point3)this.property.get();
super.build();
}
@Override
protected int getElementCount() {
return 3;
}
@Override
protected String getElement(int index) {
switch (index) {
case 0:
return "" + this.p.x;
case 1:
return "" + this.p.y;
default:
return "" + this.p.z;
}
}
@Override
protected boolean setElements(StringTokenizer e) {
Point3 p = new Point3();
int count = 0;
while (e.hasMoreTokens()) {
try {
float tmp = Float.valueOf(e.nextToken());
switch (count++) {
case 0:
p.x = tmp;
break;
case 1:
p.y = tmp;
break;
case 2:
p.z = tmp;
break;
default:
return false;
}
} catch (Exception var5) {
return false;
}
}
if (count != 3) {
return false;
} else {
this.parent.addUndoableSet(this.property, p);
return true;
}
}
}
|