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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SetPoint2Action
/* */ extends SlidePropertyAction
/* */ {
/* 18 */ private Point2 _value = null;
/* */
/* */ private Point2 _start;
/* */
/* */
/* */ public Persister trigger(Event e, Persister seqID)
/* */ {
/* 25 */ Persister ret = null;
/* 26 */ Point2 val = null;
/* 27 */ if (useParam()) {
/* 28 */ String p = param();
/* 29 */ if (p == null) {
/* 30 */ this._value = null;
/* */ } else {
/* 32 */ float x = 0.0F;float y = 0.0F;
/* 33 */ boolean ok = true;
/* 34 */ int comma = p.indexOf(',');
/* 35 */ if (comma == -1) {
/* 36 */ ok = false;
/* */ } else {
/* */ try {
/* 39 */ x = Float.valueOf(p.substring(0, comma)).floatValue();
/* 40 */ p = p.substring(comma + 1);
/* 41 */ y = Float.valueOf(p).floatValue();
/* */ }
/* */ catch (NumberFormatException nfe) {
/* 44 */ ok = false;
/* */ }
/* */ }
/* 47 */ if (!ok) {
/* 48 */ x = 0.0F;
/* 49 */ y = 0.0F;
/* 50 */ System.out.println(getName() + " unable to parse " +
/* 51 */ paramName());
/* */ }
/* 53 */ this._value = new Point2(x, y);
/* */ }
/* */ }
/* 56 */ if (this._value == null) {
/* 57 */ if ((!$assertionsDisabled) && (slide())) throw new AssertionError();
/* */ }
/* */ else {
/* 60 */ if (slide()) {
/* 61 */ if (seqID == null) {
/* 62 */ start();
/* 63 */ this._start = ((Point2)get());
/* */ }
/* 65 */ float frac = fraction();
/* 66 */ if ((frac < 1.0D) && (this._start != null)) {
/* 67 */ val = new Point2(this._value);
/* 68 */ val.x = ((this._value.x - this._start.x) * frac + this._start.x);
/* 69 */ val.y = ((this._value.y - this._start.y) * frac + this._start.y);
/* 70 */ ret = this;
/* */ }
/* */ }
/* 73 */ if (val == null)
/* 74 */ val = this._value;
/* */ }
/* 76 */ set(val);
/* 77 */ return ret;
/* */ }
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 83 */ Object ret = null;
/* 84 */ switch (index - offset) {
/* */ case 0:
/* 86 */ if (mode == 0) {
/* 87 */ ret = Point2PropertyEditor.make(new Property(this, index,
/* 88 */ "Set To").allowSetNull());
/* 89 */ if (this._value == null) {
/* 90 */ ret = MaybeNullPropertyEditor.make((Property)ret,
/* 91 */ new Point2());
/* */ }
/* */ }
/* 94 */ else if (mode == 1) {
/* 95 */ ret = this._value;
/* 96 */ } else if (mode == 2) {
/* 97 */ this._value = ((Point2)value);
/* 98 */ } else if (mode == 4) {
/* 99 */ this._value = null; }
/* 100 */ break;
/* */ default:
/* 102 */ ret = super.properties(index, offset + 1, mode, value);
/* */ }
/* 104 */ return ret;
/* */ }
/* */
/* 107 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 111 */ s.saveVersion(1, classCookie);
/* 112 */ super.saveState(s);
/* 113 */ s.saveMaybeNull(this._value);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 118 */ switch (r.restoreVersion(classCookie)) {
/* */ case 1:
/* 120 */ super.restoreState(r);
/* 121 */ this._value = ((Point2)r.restoreMaybeNull());
/* 122 */ break;
/* */
/* */ default:
/* 125 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetPoint2Action.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|