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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
/* */ package NET.worlds.scape;
/* */
/* */ import NET.worlds.network.URL;
/* */ import java.io.File;
/* */ import java.io.IOException;
/* */ import java.util.Vector;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Library
/* */ extends SuperRoot
/* */ {
/* */ private Object owningDialog;
/* 39 */ private Vector<LibraryEntry> contents = new Vector();
/* */ private LibEventHandler handler;
/* */ protected String propertyName;
/* */
/* */ public static Library load(URL url)
/* */ {
/* 45 */ return (Library)SuperRoot.readFile(url);
/* */ }
/* */
/* */ public Library(URL url, String name)
/* */ {
/* 50 */ setSourceURL(url);
/* 51 */ setName(name);
/* */ }
/* */
/* */
/* */ public Library() {}
/* */
/* */ public void save()
/* */ {
/* */ try
/* */ {
/* 61 */ saveFile(getSourceURL());
/* */ }
/* */ catch (IOException localIOException) {}
/* */ }
/* */
/* */ public void delete() {
/* 67 */ new File(getSourceURL().unalias()).delete();
/* */ }
/* */
/* */ public void add(LibraryEntry ent)
/* */ {
/* 72 */ assert (ent.getOwner() == null);
/* 73 */ this.contents.addElement(ent);
/* 74 */ super.add(ent);
/* 75 */ changed();
/* */ }
/* */
/* */ public void delete(LibraryEntry ent)
/* */ {
/* 80 */ boolean found = this.contents.removeElement(ent);
/* 81 */ assert (found);
/* 82 */ assert (ent.getOwner() == this);
/* 83 */ ent.detach();
/* 84 */ changed();
/* */ }
/* */
/* */ public void move(LibraryEntry src, LibraryEntry dst)
/* */ {
/* 89 */ int oldPos = this.contents.indexOf(src);
/* 90 */ assert (oldPos != -1);
/* 91 */ int newPos = this.contents.indexOf(dst);
/* 92 */ assert (newPos != -1);
/* 93 */ this.contents.removeElement(src);
/* 94 */ this.contents.insertElementAt(src, newPos);
/* 95 */ changed();
/* */ }
/* */
/* */ void entryChanged(LibraryEntry which)
/* */ {
/* 100 */ changed();
/* */ }
/* */
/* */ private void changed()
/* */ {
/* 105 */ if (this.handler != null)
/* 106 */ this.handler.libraryChanged(this);
/* */ }
/* */
/* 109 */ public Object getOwningDialog() { return this.owningDialog; }
/* */
/* 111 */ public Vector<LibraryEntry> getContents() { return (Vector)this.contents.clone(); }
/* 112 */ public String getPropertyName() { return this.propertyName; }
/* */
/* */ public LibraryEntry getEntry(int index)
/* */ {
/* 116 */ return (LibraryEntry)this.contents.elementAt(index);
/* */ }
/* */
/* 119 */ public void setOwningDialog(Object o) { this.owningDialog = o; }
/* 120 */ public void setName(String s) { super.setName(s);changed(); }
/* 121 */ public void setPropertyName(String s) { this.propertyName = s;changed();
/* */ }
/* */
/* */ public void setEventHandler(LibEventHandler handler) {
/* 125 */ this.handler = handler;
/* */ }
/* */
/* */
/* */
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 134 */ Object ret = null;
/* 135 */ switch (index - offset) {
/* */ case 0:
/* 137 */ if (mode == 0) {
/* 138 */ ret = PropAdder.make(
/* 139 */ new VectorProperty(this, index, "Contents"));
/* 140 */ } else if (mode == 1) {
/* 141 */ ret = getContents();
/* 142 */ } else if (mode == 4) {
/* 143 */ delete((LibraryEntry)value);
/* 144 */ } else if (mode == 3) {
/* 145 */ add((LibraryEntry)value);
/* 146 */ } else if ((mode == 5) && ((value instanceof LibraryEntry)))
/* 147 */ ret = value;
/* 148 */ break;
/* */ case 1:
/* 150 */ if (mode == 0) {
/* 151 */ ret = StringPropertyEditor.make(
/* 152 */ new Property(this, index, "Property Name")
/* 153 */ .allowSetNull());
/* 154 */ } else if (mode == 1) {
/* 155 */ ret = getPropertyName();
/* 156 */ } else if (mode == 2)
/* 157 */ setPropertyName((String)value);
/* 158 */ break;
/* */ default:
/* 160 */ ret = super.properties(index, offset + 2, mode, value);
/* */ }
/* 162 */ return ret;
/* */ }
/* */
/* */ public Object propertyParent()
/* */ {
/* 167 */ return getOwningDialog();
/* */ }
/* */
/* 170 */ private static Object classCookie = new Object();
/* */
/* */ public void saveState(Saver s) throws IOException
/* */ {
/* 174 */ s.saveVersion(2, classCookie);
/* 175 */ super.saveState(s);
/* 176 */ s.saveVector(this.contents);
/* 177 */ s.saveString(this.propertyName);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException
/* */ {
/* 182 */ Vector<?> newContents = null;
/* */
/* 184 */ switch (r.restoreVersion(classCookie)) {
/* */ case 0:
/* 186 */ setName(r.restoreString());
/* 187 */ r.restoreString();
/* 188 */ r.restoreString();
/* 189 */ newContents = r.restoreVector();
/* 190 */ break;
/* */ case 1:
/* 192 */ super.restoreState(r);
/* 193 */ r.restoreString();
/* 194 */ r.restoreString();
/* 195 */ newContents = r.restoreVector();
/* 196 */ break;
/* */ case 2:
/* 198 */ super.restoreState(r);
/* 199 */ newContents = r.restoreVector();
/* 200 */ this.propertyName = r.restoreString();
/* 201 */ break;
/* */ default:
/* 203 */ throw new TooNewException();
/* */ }
/* */
/* 206 */ for (int i = 0; i < newContents.size(); i++) {
/* 207 */ add((LibraryEntry)newContents.elementAt(i));
/* */ }
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Library.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|