Skip to content

Commit e825baa

Browse files
committed
aligning Jmol and SwingJS
1 parent da684a7 commit e825baa

39 files changed

+640
-2714
lines changed
Lines changed: 340 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,340 @@
1+
/* private */
2+
window["java.registered"] = false;
3+
4+
window["java.package.callback"] = function () {
5+
window["java.package.callback"] = null;
6+
ClazzLoader.registerPackages ("java", [
7+
"io", "lang", "lang.annotation", "lang.reflect",
8+
"util", "util.concurrent", "util.concurrent.atomic", "util.concurrent.locks",
9+
"util.jar", "util.logging", "util.prefs", "util.regex", "util.zip",
10+
"net", "text"]);
11+
12+
window["reflect"] = java.lang.reflect;
13+
14+
var base = ClazzLoader.getClasspathFor ("java.*");
15+
16+
var coreZ = null;
17+
if (window["j2s.rt.z.enabled"]) {
18+
ClazzLoader.jarClasspath (base + "rt.z.js", [
19+
"java.lang.Void",
20+
"$.reflect.AccessibleObject",
21+
"$.AnnotatedElement",
22+
"$.GenericDeclaration",
23+
"$.InvocationHandler",
24+
"$.Member",
25+
"$.Modifier",
26+
"$.Constructor",
27+
"$.Field",
28+
"$.Method",
29+
"$.Array",
30+
"$.InvocationTargetException",
31+
"$.UndeclaredThrowableException",
32+
33+
"java.util.Date",
34+
"$.EventObject",
35+
"$.EventListener",
36+
"$.EventListenerProxy",
37+
"$.Iterator",
38+
"$.ListIterator",
39+
"$.Enumeration",
40+
"$.Collection",
41+
"$.Set",
42+
"$.Map",
43+
"$.List",
44+
"$.Queue",
45+
"$.RandomAccess",
46+
"$.ConcurrentModificationException",
47+
"$.EmptyStackException",
48+
"$.MissingResourceException",
49+
"$.NoSuchElementException",
50+
"$.TooManyListenersException",
51+
52+
"java.io.IOException",
53+
"$.CharConversionException",
54+
"$.EOFException",
55+
"$.FileNotFoundException",
56+
"$.InterruptedIOException",
57+
"$.ObjectStreamException",
58+
"$.InvalidClassException",
59+
"$.InvalidObjectException",
60+
"$.NotActiveException",
61+
"$.NotSerializableException",
62+
"$.OptionalDataException",
63+
"$.StreamCorruptedException",
64+
"$.SyncFailedException",
65+
"$.UnsupportedEncodingException",
66+
"$.UTFDataFormatException",
67+
"$.WriteAbortedException",
68+
69+
"java.net.URLEncoder",
70+
"$.URLDecoder",
71+
]);
72+
ClazzLoader.jarClasspath (base + "simple.z.js", [
73+
"net.sf.j2s.ajax.HttpRequest",
74+
"$.ARunnable",
75+
"$.AClass",
76+
"$.ASWTClass",
77+
78+
"net.sf.j2s.ajax.IXHRCallback",
79+
"$.XHRCallbackAdapter",
80+
"$.XHRCallbackSWTAdapter",
81+
82+
"$.SimpleSerializable",
83+
"$.ISimpleCometable",
84+
"$.ISimpleConstant",
85+
"$.ISimpleEnum",
86+
"$.SimpleFilter",
87+
"$.SimpleRPCRunnable",
88+
"$.ISimpleRequestInfoBinding",
89+
"$.ISimpleRequestInfo",
90+
"$.ISimpleGeoLocationBinding",
91+
"$.ISimpleGeoLocation",
92+
"$.SimpleRPCRequest",
93+
"$.SimpleRPCSWTRequest",
94+
95+
"$.SimplePipeSequence",
96+
"$.SimplePipeRunnable",
97+
"$.ISimpleCacheable",
98+
"$.ISimplePipePriority",
99+
"$.SimplePipeHelper",
100+
"$.SimplePipeRequest",
101+
"$.SimplePipeSWTRequest",
102+
103+
"$.CompoundSerializable",
104+
"$.CompoundPipeSession",
105+
"$.CompoundPipeRunnable",
106+
"$.CompoundPipeRequest",
107+
"$.CompoundPipeSWTRequest",
108+
109+
"net.sf.j2s.store.IStore",
110+
"$.CookieStore",
111+
"$.XSSCookieStore",
112+
"$.HTML5LocalStorage",
113+
"$.SimpleStore"
114+
]);
115+
ClazzLoader.jarClasspath (base + "simple.store.z.js", [
116+
"net.sf.j2s.store.IStore",
117+
"$.CookieStore",
118+
"$.XSSCookieStore",
119+
"$.HTML5LocalStorage",
120+
"$.SimpleStore"
121+
]);
122+
ClazzLoader.jarClasspath (base + "simple.rpc.z.js", [
123+
"net.sf.j2s.ajax.HttpRequest",
124+
"$.ARunnable",
125+
"$.AClass",
126+
127+
"net.sf.j2s.ajax.IXHRCallback",
128+
"$.XHRCallbackAdapter",
129+
130+
"$.SimpleSerializable",
131+
"$.ISimpleCometable",
132+
"$.ISimpleConstant",
133+
"$.ISimpleEnum",
134+
"$.SimpleFilter",
135+
"$.SimpleRPCRunnable",
136+
"$.ISimpleRequestInfoBinding",
137+
"$.ISimpleRequestInfo",
138+
"$.ISimpleGeoLocationBinding",
139+
"$.ISimpleGeoLocation",
140+
"$.SimpleRPCRequest",
141+
]);
142+
ClazzLoader.jarClasspath (base + "simple.pipe.z.js", [
143+
"net.sf.j2s.ajax.SimplePipeSequence",
144+
"$.SimplePipeRunnable",
145+
"$.ISimpleCacheable",
146+
"$.ISimplePipePriority",
147+
"$.SimplePipeHelper",
148+
"$.SimplePipeRequest",
149+
"$.SimplePipeSWTRequest",
150+
151+
"$.CompoundSerializable",
152+
"$.CompoundPipeSession",
153+
"$.CompoundPipeRunnable",
154+
"$.CompoundPipeRequest",
155+
"$.CompoundPipeSWTRequest",
156+
]);
157+
ClazzLoader.jarClasspath (base + "simple.swt.z.js", [
158+
"net.sf.j2s.ajax.ASWTClass",
159+
"$.XHRCallbackSWTAdapter",
160+
"$.SimpleRPCSWTRequest",
161+
"$.CompoundPipeSWTRequest",
162+
]);
163+
coreZ = base + "rt.z.js";
164+
}
165+
if (coreZ != null && window["j2s.core.z.packing"] != null) {
166+
try {
167+
coreZ = window["j2s.core.z.packing"] (base);
168+
} catch (e) {
169+
}
170+
}
171+
172+
if (coreZ == null || coreZ.length == 0) {
173+
coreZ = base + "core.z.js";
174+
ClazzLoader.jarClasspath (coreZ, [
175+
"java.lang.Void",
176+
"$.reflect.AccessibleObject",
177+
"$.AnnotatedElement",
178+
"$.GenericDeclaration",
179+
"$.InvocationHandler",
180+
"$.Member",
181+
"$.Modifier",
182+
"$.Constructor",
183+
"$.Field",
184+
"$.Method",
185+
"$.Array",
186+
"$.InvocationTargetException",
187+
"$.UndeclaredThrowableException",
188+
189+
"java.util.Date",
190+
"$.EventObject",
191+
"$.EventListener",
192+
"$.EventListenerProxy",
193+
"$.Iterator",
194+
"$.ListIterator",
195+
"$.Enumeration",
196+
"$.Collection",
197+
"$.Set",
198+
"$.Map",
199+
"$.List",
200+
"$.Queue",
201+
"$.RandomAccess",
202+
"$.ConcurrentModificationException",
203+
"$.EmptyStackException",
204+
"$.MissingResourceException",
205+
"$.NoSuchElementException",
206+
"$.TooManyListenersException",
207+
208+
"java.io.IOException",
209+
"$.CharConversionException",
210+
"$.EOFException",
211+
"$.FileNotFoundException",
212+
"$.InterruptedIOException",
213+
"$.ObjectStreamException",
214+
"$.InvalidClassException",
215+
"$.InvalidObjectException",
216+
"$.NotActiveException",
217+
"$.NotSerializableException",
218+
"$.OptionalDataException",
219+
"$.StreamCorruptedException",
220+
"$.SyncFailedException",
221+
"$.UnsupportedEncodingException",
222+
"$.UTFDataFormatException",
223+
"$.WriteAbortedException",
224+
225+
"java.net.URLEncoder",
226+
"$.URLDecoder",
227+
228+
"net.sf.j2s.ajax.HttpRequest",
229+
"$.ARunnable",
230+
"$.AClass",
231+
"$.ASWTClass",
232+
233+
"net.sf.j2s.ajax.IXHRCallback",
234+
"$.XHRCallbackAdapter",
235+
"$.XHRCallbackSWTAdapter",
236+
237+
"$.SimpleSerializable",
238+
"$.ISimpleCometable",
239+
"$.ISimpleConstant",
240+
"$.ISimpleEnum",
241+
"$.SimpleFilter",
242+
"$.SimpleRPCRunnable",
243+
"$.ISimpleRequestInfoBinding",
244+
"$.ISimpleRequestInfo",
245+
"$.ISimpleGeoLocationBinding",
246+
"$.ISimpleGeoLocation",
247+
"$.SimpleRPCRequest",
248+
"$.SimpleRPCSWTRequest",
249+
250+
"$.SimplePipeSequence",
251+
"$.SimplePipeRunnable",
252+
"$.ISimpleCacheable",
253+
"$.ISimplePipePriority",
254+
"$.SimplePipeHelper",
255+
"$.SimplePipeRequest",
256+
"$.SimplePipeSWTRequest",
257+
258+
"$.CompoundSerializable",
259+
"$.CompoundPipeSession",
260+
"$.CompoundPipeRunnable",
261+
"$.CompoundPipeRequest",
262+
"$.CompoundPipeSWTRequest",
263+
264+
"net.sf.j2s.store.IStore",
265+
"$.CookieStore",
266+
"$.XSSCookieStore",
267+
"$.HTML5LocalStorage",
268+
"$.SimpleStore"
269+
]);
270+
}
271+
272+
ClazzLoader.jarClasspath (base + "util/AbstractList.js", [
273+
"java.util.AbstractList",
274+
"java.util.AbstractList.FullListIterator",
275+
"java.util.AbstractList.SimpleListIterator",
276+
"java.util.AbstractList.SubAbstractList",
277+
"java.util.AbstractList.SubAbstractListRandomAccess"
278+
]);
279+
280+
ClazzLoader.jarClasspath (base + "util/MapEntry.js", [
281+
"java.util.MapEntry",
282+
"java.util.MapEntry.Type"
283+
]);
284+
285+
ClazzLoader.jarClasspath (base + "util/Collections.js", [
286+
"java.util.Collections",
287+
"java.util.Collections.CheckedCollection",
288+
"java.util.Collections.CheckedList",
289+
"java.util.Collections.CheckedListIterator",
290+
"java.util.Collections.CheckedMap",
291+
"java.util.Collections.CheckedMap.CheckedEntry",
292+
"java.util.Collections.CheckedMap.CheckedEntrySet",
293+
"java.util.Collections.CheckedMap.CheckedEntrySet.CheckedEntryIterator",
294+
"java.util.Collections.CheckedRandomAccessList",
295+
"java.util.Collections.CheckedSet",
296+
"java.util.Collections.CheckedSortedMap",
297+
"java.util.Collections.CheckedSortedSet",
298+
"java.util.Collections.CopiesList",
299+
"java.util.Collections.EmptyList",
300+
"java.util.Collections.EmptyMap",
301+
"java.util.Collections.EmptySet",
302+
"java.util.Collections.ReverseComparator",
303+
"java.util.Collections.ReverseComparatorWithComparator",
304+
"java.util.Collections.SingletonList",
305+
"java.util.Collections.SingletonMap",
306+
"java.util.Collections.SingletonSet",
307+
"java.util.Collections.SynchronizedCollection",
308+
"java.util.Collections.SynchronizedList",
309+
"java.util.Collections.SynchronizedMap",
310+
"java.util.Collections.SynchronizedRandomAccessList",
311+
"java.util.Collections.SynchronizedSet",
312+
"java.util.Collections.SynchronizedSortedMap",
313+
"java.util.Collections.SynchronizedSortedSet",
314+
"java.util.Collections.UnmodifiableCollection",
315+
"java.util.Collections.UnmodifiableList",
316+
"java.util.Collections.UnmodifiableMap",
317+
"java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet",
318+
"java.util.Collections.UnmodifiableMap.UnmodifiableEntrySet.UnmodifiableMapEntry",
319+
"java.util.Collections.UnmodifiableRandomAccessList",
320+
"java.util.Collections.UnmodifiableSet",
321+
"java.util.Collections.UnmodifiableSortedMap",
322+
"java.util.Collections.UnmodifiableSortedSet"
323+
]);
324+
325+
ClazzLoader.jarClasspath (base + "lang/StringBuilder.z.js",
326+
["java.lang.AbstractStringBuilder", "$.StringBuilder"]);
327+
328+
ClazzLoader.jarClasspath (base.substring (0, base.lastIndexOf ("java/"))
329+
+ "org/apache/harmony/luni/util/Msg.z.js",
330+
["org.apache.harmony.luni.util.Msg", "$.MsgHelp"]);
331+
332+
ClazzLoader.loadZJar (coreZ, ClazzLoader.runtimeKeyClass); //"java.lang.String"
333+
};
334+
if (ClazzLoader.classpathMap["@java"] != null) {
335+
window["java.package.callback"] ();
336+
}
337+
338+
339+
/* private */
340+
window["java.registered"] = true;

0 commit comments

Comments
 (0)