blob: 8ab7b5e0f98d42cac3a93917ce8b706c78f710ac (
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
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
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SetIntegerAction
/* */ extends SlidePropertyAction
/* */ {
/* */ private int _value;
/* */ private int _start;
/* */
/* */ public Persister trigger(Event e, Persister seqID)
/* */ {
/* 22 */ Persister ret = null;
/* 23 */ if (useParam()) {
/* */ try {
/* 25 */ this._value = Integer.valueOf(param()).intValue();
/* */ }
/* */ catch (NumberFormatException nfe) {
/* 28 */ System.out.println(getName() + " unable to parse " +
/* 29 */ paramName());
/* 30 */ this._value = 0;
/* */ }
/* */ }
/* 33 */ int val = this._value;
/* 34 */ if (slide()) {
/* 35 */ if (seqID == null) {
/* 36 */ start();
/* 37 */ this._start = ((Integer)get()).intValue();
/* */ }
/* 39 */ float frac = fraction();
/* 40 */ if (frac < 1.0D) {
/* 41 */ val = (int)((this._value - this._start) * frac + this._start);
/* 42 */ ret = this;
/* */ }
/* */ }
/* 45 */ set(new Integer(val));
/* 46 */ return ret;
/* */ }
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 52 */ Object ret = null;
/* 53 */ switch (index - offset) {
/* */ case 0:
/* 55 */ if (mode == 0) {
/* 56 */ ret = IntegerPropertyEditor.make(new Property(this, index,
/* 57 */ "Set To"));
/* 58 */ } else if (mode == 1) {
/* 59 */ ret = new Integer(this._value);
/* 60 */ } else if (mode == 2)
/* 61 */ this._value = ((Integer)value).intValue();
/* 62 */ break;
/* */ default:
/* 64 */ ret = super.properties(index, offset + 1, mode, value);
/* */ }
/* 66 */ return ret;
/* */ }
/* */
/* 69 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 73 */ s.saveVersion(2, classCookie);
/* 74 */ super.saveState(s);
/* 75 */ s.saveInt(this._value);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 80 */ switch (r.restoreVersion(classCookie)) {
/* */ case 2:
/* 82 */ super.restoreState(r);
/* 83 */ this._value = r.restoreInt();
/* 84 */ break;
/* */ case 1:
/* 86 */ setPropertyActionRestoreState(r);
/* 87 */ this._value = r.restoreInt();
/* 88 */ break;
/* */
/* */ default:
/* 91 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetIntegerAction.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|