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
|
/* */ package NET.worlds.scape;
/* */
/* */ import java.awt.Color;
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SetColorAction
/* */ extends SlidePropertyAction
/* */ {
/* 18 */ private Color _value = null;
/* */
/* */ private Color _start;
/* */
/* */
/* */ public Persister trigger(Event e, Persister seqID)
/* */ {
/* 25 */ Persister ret = null;
/* 26 */ Color val = null;
/* 27 */ if (useParam()) {
/* */ try {
/* 29 */ this._value = new Color(Integer.valueOf(param()).intValue());
/* */ }
/* */ catch (NumberFormatException nfe) {
/* 32 */ System.out.println(getName() + " unable to parse " +
/* 33 */ paramName());
/* 34 */ this._value = null;
/* */ }
/* */ }
/* 37 */ if (this._value == null) {
/* 38 */ if ((!$assertionsDisabled) && (slide())) throw new AssertionError();
/* */ }
/* */ else {
/* 41 */ if (slide()) {
/* 42 */ if (seqID == null) {
/* 43 */ start();
/* 44 */ this._start = ((Color)get());
/* */ }
/* 46 */ float frac = fraction();
/* 47 */ if (frac < 1.0D) {
/* 48 */ int red = (int)((this._value.getRed() - this._start.getRed()) *
/* 49 */ frac) + this._start.getRed();
/* 50 */ int grn = (int)((this._value.getGreen() - this._start.getGreen()) *
/* 51 */ frac) + this._start.getGreen();
/* 52 */ int blu = (int)((this._value.getBlue() - this._start.getBlue()) *
/* 53 */ frac) + this._start.getBlue();
/* 54 */ val = new Color(red, grn, blu);
/* 55 */ ret = this;
/* */ }
/* */ }
/* 58 */ if (val == null)
/* 59 */ val = this._value;
/* */ }
/* 61 */ set(val);
/* 62 */ return ret;
/* */ }
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 68 */ Object ret = null;
/* 69 */ switch (index - offset) {
/* */ case 0:
/* 71 */ if (mode == 0) {
/* 72 */ ret = ColorPropertyEditor.make(new Property(this, index,
/* 73 */ "Set To").allowSetNull());
/* 74 */ if (this._value == null) {
/* 75 */ ret = MaybeNullPropertyEditor.make((Property)ret,
/* 76 */ Color.black);
/* */ }
/* */ }
/* 79 */ else if (mode == 1) {
/* 80 */ ret = this._value;
/* 81 */ } else if (mode == 2) {
/* 82 */ this._value = ((Color)value);
/* 83 */ } else if (mode == 4) {
/* 84 */ this._value = null; }
/* 85 */ break;
/* */ default:
/* 87 */ ret = super.properties(index, offset + 1, mode, value);
/* */ }
/* 89 */ return ret;
/* */ }
/* */
/* 92 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 96 */ s.saveVersion(1, classCookie);
/* 97 */ super.saveState(s);
/* 98 */ if (this._value == null) {
/* 99 */ s.saveBoolean(false);
/* */ } else {
/* 101 */ s.saveBoolean(true);
/* 102 */ s.saveInt(this._value.getRed());
/* 103 */ s.saveInt(this._value.getGreen());
/* 104 */ s.saveInt(this._value.getBlue());
/* */ }
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 110 */ switch (r.restoreVersion(classCookie)) {
/* */ case 1:
/* 112 */ super.restoreState(r);
/* 113 */ if (r.restoreBoolean()) {
/* 114 */ int red = r.restoreInt();
/* 115 */ int grn = r.restoreInt();
/* 116 */ int blu = r.restoreInt();
/* 117 */ this._value = new Color(red, grn, blu);
/* */ }
/* 119 */ break;
/* */
/* */ default:
/* 122 */ throw new TooNewException();
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SetColorAction.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|