1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["java.io.FilterInputStream", "java.lang.Thread", "javax.swing.text.CompositeView", "$.DefaultEditorKit", "$.JTextComponent", "$.ParagraphView", "$.ViewFactory", "java.lang.Error", "java.util.HashMap", "javax.swing.JTextArea"], "javax.swing.JEditorPane", ["java.io.BufferedInputStream", "$.DataOutputStream", "$.IOException", "$.InputStreamReader", "$.StringReader", "java.lang.Boolean", "$.RuntimeException", "java.net.HttpURLConnection", "$.URL", "java.util.Hashtable", "java.awt.Dimension", "$.Rectangle", "javax.swing.JViewport", "$.SwingUtilities", "$.UIManager", "javax.swing.event.HyperlinkListener", "javax.swing.text.BoxView", "$.JSMinimalAbstractDocument", "$.WrappedPlainView", "swingjs.api.Interface"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 if (!Clazz.isClassDefined ("javax.swing.JEditorPane.PageLoader")) {
5 javax.swing.JEditorPane.$JEditorPane$PageLoader$ ();
9 this.isUserSetEditorKit = false;
10 this.pageProperties = null;
11 this.typeHandlers = null;
12 Clazz.instantialize (this, arguments);
13 }, javax.swing, "JEditorPane", javax.swing.text.JTextComponent);
14 Clazz.makeConstructor (c$,
15 function (initialPage) {
17 this.setPage (initialPage);
19 Clazz.makeConstructor (c$,
24 Clazz.makeConstructor (c$,
25 function (type, text) {
27 this.setContentType (type);
30 Clazz.defineMethod (c$, "addHyperlinkListener",
32 this.listenerList.add (javax.swing.event.HyperlinkListener, listener);
33 }, "javax.swing.event.HyperlinkListener");
34 Clazz.defineMethod (c$, "removeHyperlinkListener",
36 this.listenerList.remove (javax.swing.event.HyperlinkListener, listener);
37 }, "javax.swing.event.HyperlinkListener");
38 Clazz.defineMethod (c$, "getHyperlinkListeners",
40 return this.listenerList.getListeners (javax.swing.event.HyperlinkListener);
42 Clazz.defineMethod (c$, "fireHyperlinkUpdate",
44 var listeners = this.listenerList.getListenerList ();
45 for (var i = listeners.length - 2; i >= 0; i -= 2) {
46 if (listeners[i] === javax.swing.event.HyperlinkListener) {
47 (listeners[i + 1]).hyperlinkUpdate (e);
49 }, "javax.swing.event.HyperlinkEvent");
50 Clazz.defineMethod (c$, "setPage",
53 throw new java.io.IOException ("invalid url");
54 }var loaded = this.getPage ();
55 if (!page.equals (loaded) && page.getRef () == null) {
56 this.scrollRectToVisible ( new java.awt.Rectangle (0, 0, 1, 1));
57 }var reloaded = false;
58 var postData = this.getPostData ();
59 if ((loaded == null) || !loaded.sameFile (page) || (postData != null)) {
60 var p = this.getAsynchronousLoadPriority (this.getDocument ());
61 if ((postData == null) || (p < 0)) {
62 var $in = this.getStream (page);
63 if (this.kit != null) {
64 var doc = this.initializeModel (this.kit, page);
66 if (this.loading != null) {
67 this.loading.cancel ();
69 }}p = this.getAsynchronousLoadPriority (doc);
71 this.setDocument (doc);
73 this.loading = new javax.swing.JEditorPane.PageStream ($in);
74 var pl = Clazz.innerTypeInstance (javax.swing.JEditorPane.PageLoader, this, null, doc, this.loading, p, loaded, page);
77 }this.read ($in, doc);
78 this.setDocument (doc);
81 var pl = Clazz.innerTypeInstance (javax.swing.JEditorPane.PageLoader, this, null, null, null, p, loaded, page);
84 }}var reference = page.getRef ();
85 if (reference != null) {
87 this.scrollToReference (reference);
89 javax.swing.SwingUtilities.invokeLater (((Clazz.isClassDefined ("javax.swing.JEditorPane$1") ? 0 : javax.swing.JEditorPane.$JEditorPane$1$ ()), Clazz.innerTypeInstance (javax.swing.JEditorPane$1, this, Clazz.cloneFinals ("reference", reference))));
90 }this.getDocument ().putProperty ("stream", page);
91 }this.firePropertyChangeObject ("page", loaded, page);
93 Clazz.defineMethod (c$, "initializeModel",
94 function (kit, page) {
95 var doc = kit.createDefaultDocument ();
96 if (this.pageProperties != null) {
97 for (var e = this.pageProperties.keys (); e.hasMoreElements (); ) {
98 var key = e.nextElement ();
99 doc.putProperty (key, this.pageProperties.get (key));
101 this.pageProperties.clear ();
102 }if (doc.getProperty ("stream") == null) {
103 doc.putProperty ("stream", page);
105 }, "javax.swing.text.EditorKit,java.net.URL");
106 Clazz.defineMethod (c$, "getAsynchronousLoadPriority",
108 return (Clazz.instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument) ? (doc).getAsynchronousLoadPriority () : -1);
109 }, "javax.swing.text.Document");
110 Clazz.defineMethod (c$, "read",
111 function ($in, desc) {
112 var charset = this.getClientProperty ("charset");
113 var r = (charset != null) ? new java.io.InputStreamReader ($in, charset) : new java.io.InputStreamReader ($in);
114 Clazz.superCall (this, javax.swing.JEditorPane, "read", [r, desc]);
115 }, "java.io.InputStream,~O");
116 Clazz.defineMethod (c$, "read",
117 function ($in, doc) {
118 if (!Boolean.TRUE.equals (doc.getProperty ("IgnoreCharsetDirective"))) {
119 var READ_LIMIT = 10240;
120 $in = new java.io.BufferedInputStream ($in, 10240);
123 var charset = this.getClientProperty ("charset");
124 var r = (charset != null) ? new java.io.InputStreamReader ($in, charset) : new java.io.InputStreamReader ($in);
125 this.kit.read (r, doc, 0);
127 if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {
130 throw new java.io.IOException (e.getMessage ());
132 } else if (Clazz.exceptionOf (e$$, javax.swing.text.ChangedCharSetException)) {
133 var changedCharSetException = e$$;
135 var charSetSpec = changedCharSetException.getCharSetSpec ();
136 if (changedCharSetException.keyEqualsCharSet ()) {
137 this.putClientProperty ("charset", charSetSpec);
139 this.setCharsetFromContentTypeParameters (charSetSpec);
142 } catch (exception) {
143 if (Clazz.exceptionOf (exception, java.io.IOException)) {
145 var url = doc.getProperty ("stream");
147 var conn = url.openConnection ();
148 $in = conn.getInputStream ();
150 throw changedCharSetException;
156 doc.remove (0, doc.getLength ());
158 if (Clazz.exceptionOf (e, javax.swing.text.BadLocationException)) {
163 doc.putProperty ("IgnoreCharsetDirective", Boolean.$valueOf (true));
164 this.read ($in, doc);
170 }, "java.io.InputStream,javax.swing.text.Document");
171 Clazz.defineMethod (c$, "getStream",
173 var conn = page.openConnection ();
174 if (Clazz.instanceOf (conn, java.net.HttpURLConnection)) {
176 hconn.setInstanceFollowRedirects (false);
177 var postData = this.getPostData ();
178 if (postData != null) {
179 this.handlePostData (hconn, postData);
180 }var response = hconn.getResponseCode ();
181 var redirect = (response >= 300 && response <= 399);
183 var loc = conn.getHeaderField ("Location");
184 if (loc.startsWith ("http", 0)) {
185 page = new java.net.URL (loc);
187 page = new java.net.URL (page, loc);
188 }return this.getStream (page);
189 }}if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
190 this.handleConnectionProperties (conn);
193 javax.swing.SwingUtilities.invokeAndWait (((Clazz.isClassDefined ("javax.swing.JEditorPane$2") ? 0 : javax.swing.JEditorPane.$JEditorPane$2$ ()), Clazz.innerTypeInstance (javax.swing.JEditorPane$2, this, Clazz.cloneFinals ("conn", conn))));
195 if (Clazz.exceptionOf (e$$, InterruptedException)) {
198 throw new RuntimeException (e);
200 } else if (Clazz.exceptionOf (e$$, java.lang.reflect.InvocationTargetException)) {
203 throw new RuntimeException (e);
209 }return conn.getInputStream ();
211 Clazz.defineMethod (c$, "handleConnectionProperties",
213 if (this.pageProperties == null) {
214 this.pageProperties = new java.util.Hashtable ();
215 }var type = conn.getContentType ();
217 this.setContentType (type);
218 this.pageProperties.put ("content-type", type);
219 }this.pageProperties.put ("stream", conn.getURL ());
220 var enc = conn.getContentEncoding ();
222 this.pageProperties.put ("content-encoding", enc);
223 }}, "java.net.URLConnection");
224 Clazz.defineMethod (c$, "getPostData",
226 return this.getDocument ().getProperty ("javax.swing.JEditorPane.postdata");
228 Clazz.defineMethod (c$, "handlePostData",
229 function (conn, postData) {
230 conn.setDoOutput (true);
233 conn.setRequestProperty ("Content-Type", "application/x-www-form-urlencoded");
234 os = new java.io.DataOutputStream (conn.getOutputStream ());
235 os.writeBytes (postData);
240 }, "java.net.HttpURLConnection,~O");
241 Clazz.defineMethod (c$, "scrollToReference",
242 function (reference) {
244 Clazz.defineMethod (c$, "getPage",
246 return this.getDocument ().getProperty ("stream");
248 Clazz.defineMethod (c$, "setPage",
251 throw new java.io.IOException ("invalid url");
252 }var page = new java.net.URL (url);
255 Clazz.overrideMethod (c$, "getUIClassID",
257 return "EditorPaneUI";
259 Clazz.defineMethod (c$, "createDefaultEditorKit",
261 return new javax.swing.JEditorPane.PlainEditorKit ();
263 Clazz.defineMethod (c$, "getEditorKit",
265 if (this.kit == null) {
266 this.kit = this.createDefaultEditorKit ();
267 this.isUserSetEditorKit = false;
270 Clazz.defineMethod (c$, "getContentType",
272 return (this.kit != null) ? this.kit.getContentType () : null;
274 Clazz.defineMethod (c$, "setContentType",
276 var parm = type.indexOf (";");
278 var paramList = type.substring (parm);
279 type = type.substring (0, parm).trim ();
280 if (type.toLowerCase ().startsWith ("text/")) {
281 this.setCharsetFromContentTypeParameters (paramList);
282 }}if ((this.kit == null) || (!type.equals (this.kit.getContentType ())) || !this.isUserSetEditorKit) {
283 var k = this.getEditorKitForContentType (type);
284 if (k != null && k !== this.kit) {
285 this.setEditorKit (k);
286 this.isUserSetEditorKit = false;
288 Clazz.defineMethod (c$, "setCharsetFromContentTypeParameters",
289 function (paramlist) {
292 var semi = paramlist.indexOf (';');
293 if (semi > -1 && semi < paramlist.length - 1) {
294 paramlist = paramlist.substring (semi + 1);
295 }if (paramlist.length > 0) {
296 var hdrParser = new javax.swing.JEditorPane.HeaderParser (paramlist);
297 charset = hdrParser.findValue ("charset");
298 if (charset != null) {
299 this.putClientProperty ("charset", charset);
301 if (Clazz.exceptionOf (e$$, IndexOutOfBoundsException)) {
305 } else if (Clazz.exceptionOf (e$$, NullPointerException)) {
309 } else if (Clazz.exceptionOf (e$$, Exception)) {
312 System.err.println ("JEditorPane.getCharsetFromContentTypeParameters failed on: " + paramlist);
313 e.printStackTrace ();
320 Clazz.defineMethod (c$, "setEditorKit",
323 this.isUserSetEditorKit = true;
325 old.deinstall (this);
327 if (this.kit != null) {
328 this.kit.install (this);
329 this.setDocument (this.kit.createDefaultDocument ());
330 }this.firePropertyChangeObject ("editorKit", old, kit);
331 }, "javax.swing.text.EditorKit");
332 Clazz.defineMethod (c$, "getEditorKitForContentType",
334 if (this.typeHandlers == null) {
335 this.typeHandlers = new java.util.Hashtable (3);
336 }var k = this.typeHandlers.get (type);
338 k = javax.swing.JEditorPane.createEditorKitForContentType (type);
340 this.setEditorKitForContentType (type, k);
342 k = this.createDefaultEditorKit ();
345 Clazz.defineMethod (c$, "setEditorKitForContentType",
347 if (this.typeHandlers == null) {
348 this.typeHandlers = new java.util.Hashtable (3);
349 }this.typeHandlers.put (type, k);
350 }, "~S,javax.swing.text.EditorKit");
351 Clazz.defineMethod (c$, "replaceSelection",
353 if (!this.isEditable ()) {
354 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this);
356 }var kit = this.getEditorKit ();
357 if (Clazz.instanceOf (kit, javax.swing.text.StyledEditorKit)) {
359 var doc = this.getDocument ();
360 var caret = this.getCaret ();
361 var p0 = Math.min (caret.getDot (), caret.getMark ());
362 var p1 = Math.max (caret.getDot (), caret.getMark ());
363 if (Clazz.instanceOf (doc, javax.swing.text.JSMinimalAbstractDocument)) {
364 (doc).replace (p0, p1 - p0, content, (kit).getInputAttributes ());
367 doc.remove (p0, p1 - p0);
368 }if (content != null && content.length > 0) {
369 doc.insertString (p0, content, (kit).getInputAttributes ());
371 if (Clazz.exceptionOf (e, javax.swing.text.BadLocationException)) {
372 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this);
378 Clazz.superCall (this, javax.swing.JEditorPane, "replaceSelection", [content]);
380 c$.createEditorKitForContentType = Clazz.defineMethod (c$, "createEditorKitForContentType",
383 var kitRegistry = javax.swing.JEditorPane.getKitRegisty ();
384 k = kitRegistry.get (type);
386 var classname = javax.swing.JEditorPane.getKitTypeRegistry ().get (type);
388 k = swingjs.api.Interface.getInstance (classname, false);
389 kitRegistry.put (type, k);
397 c$.registerEditorKitForContentType = Clazz.defineMethod (c$, "registerEditorKitForContentType",
398 function (type, classname) {
399 javax.swing.JEditorPane.registerEditorKitForContentType (type, classname, null);
401 c$.registerEditorKitForContentType = Clazz.defineMethod (c$, "registerEditorKitForContentType",
402 function (type, classname, loader) {
403 javax.swing.JEditorPane.getKitTypeRegistry ().put (type, classname);
404 javax.swing.JEditorPane.getKitRegisty ().remove (type);
405 }, "~S,~S,ClassLoader");
406 c$.getEditorKitClassNameForContentType = Clazz.defineMethod (c$, "getEditorKitClassNameForContentType",
408 return javax.swing.JEditorPane.getKitTypeRegistry ().get (type);
410 c$.getKitTypeRegistry = Clazz.defineMethod (c$, "getKitTypeRegistry",
412 javax.swing.JEditorPane.loadDefaultKitsIfNecessary ();
413 return javax.swing.SwingUtilities.appContextGet (javax.swing.JEditorPane.kitTypeRegistryKey);
415 c$.getKitRegisty = Clazz.defineMethod (c$, "getKitRegisty",
417 var ht = javax.swing.SwingUtilities.appContextGet (javax.swing.JEditorPane.kitRegistryKey);
419 ht = new java.util.Hashtable (3);
420 javax.swing.SwingUtilities.appContextPut (javax.swing.JEditorPane.kitRegistryKey, ht);
423 c$.loadDefaultKitsIfNecessary = Clazz.defineMethod (c$, "loadDefaultKitsIfNecessary",
425 if (javax.swing.SwingUtilities.appContextGet (javax.swing.JEditorPane.kitTypeRegistryKey) == null) {
427 if (javax.swing.JEditorPane.defaultEditorKitMap.size () == 0) {
428 javax.swing.JEditorPane.defaultEditorKitMap.put ("text/plain", "javax.swing.JEditorPane$PlainEditorKit");
429 javax.swing.JEditorPane.defaultEditorKitMap.put ("text/html", "javax.swing.text.html.HTMLEditorKit");
430 javax.swing.JEditorPane.defaultEditorKitMap.put ("text/rtf", "javax.swing.text.rtf.RTFEditorKit");
431 javax.swing.JEditorPane.defaultEditorKitMap.put ("application/rtf", "javax.swing.text.rtf.RTFEditorKit");
432 }}var ht = new java.util.Hashtable ();
433 javax.swing.SwingUtilities.appContextPut (javax.swing.JEditorPane.kitTypeRegistryKey, ht);
434 ht = new java.util.Hashtable ();
435 javax.swing.SwingUtilities.appContextPut (javax.swing.JEditorPane.kitLoaderRegistryKey, ht);
436 for (var key, $key = javax.swing.JEditorPane.defaultEditorKitMap.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) {
437 javax.swing.JEditorPane.registerEditorKitForContentType (key, javax.swing.JEditorPane.defaultEditorKitMap.get (key));
440 Clazz.overrideMethod (c$, "getPreferredSize",
442 var d = this.getPrefSizeJComp ();
443 if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {
444 var port = this.getParent ();
445 var ui = this.getUI ();
446 var prefWidth = d.width;
447 var prefHeight = d.height;
448 if (!this.getScrollableTracksViewportWidth ()) {
449 var w = port.getWidth ();
450 var min = ui.getMinimumSize (this);
451 if (w != 0 && w < min.width) {
452 prefWidth = min.width;
453 }}if (!this.getScrollableTracksViewportHeight ()) {
454 var h = port.getHeight ();
455 var min = ui.getMinimumSize (this);
456 if (h != 0 && h < min.height) {
457 prefHeight = min.height;
458 }}if (prefWidth != d.width || prefHeight != d.height) {
459 d = new java.awt.Dimension (prefWidth, prefHeight);
462 Clazz.overrideMethod (c$, "setText",
465 var doc = this.getDocument ();
466 doc.remove (0, doc.getLength ());
467 if (t == null || t.equals ("")) {
469 }var r = new java.io.StringReader (t);
470 var kit = this.getEditorKit ();
471 kit.read (r, doc, 0);
473 if (Clazz.exceptionOf (e$$, java.io.IOException)) {
476 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this);
478 } else if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {
481 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this);
488 Clazz.defineMethod (c$, "getText",
490 var doc = this.getDocument ();
492 return doc.getText (0, doc.getLength ());
494 if (Clazz.exceptionOf (e, javax.swing.text.BadLocationException)) {
501 Clazz.overrideMethod (c$, "getScrollableTracksViewportWidth",
503 if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {
504 var port = this.getParent ();
505 var ui = this.getUI ();
506 var w = port.getWidth ();
507 var min = ui.getMinimumSize (this);
508 var max = ui.getMaximumSize (this);
509 if ((w >= min.width) && (w <= max.width)) {
513 Clazz.overrideMethod (c$, "getScrollableTracksViewportHeight",
515 if (Clazz.instanceOf (this.getParent (), javax.swing.JViewport)) {
516 var port = this.getParent ();
517 var ui = this.getUI ();
518 var h = port.getHeight ();
519 var min = ui.getMinimumSize (this);
520 if (h >= min.height) {
521 var max = ui.getMaximumSize (this);
522 if (h <= max.height) {
526 Clazz.defineMethod (c$, "paramString",
528 var kitString = (this.kit != null ? this.kit.toString () : "");
529 var typeHandlersString = (this.typeHandlers != null ? this.typeHandlers.toString () : "");
530 return Clazz.superCall (this, javax.swing.JEditorPane, "paramString", []) + ",kit=" + kitString + ",typeHandlers=" + typeHandlersString;
532 c$.$JEditorPane$PageLoader$ = function () {
534 c$ = Clazz.decorateAsClass (function () {
535 Clazz.prepareCallback (this, arguments);
536 this.pageLoaded = false;
541 Clazz.instantialize (this, arguments);
542 }, javax.swing.JEditorPane, "PageLoader", Thread);
543 Clazz.makeConstructor (c$,
544 function (a, b, c, d, e) {
545 Clazz.superConstructor (this, javax.swing.JEditorPane.PageLoader, []);
546 this.setPriority (c);
551 }, "javax.swing.text.Document,java.io.InputStream,~N,java.net.URL,java.net.URL");
552 Clazz.overrideMethod (c$, "run",
555 if (this.$in == null) {
556 this.$in = this.b$["javax.swing.JEditorPane"].getStream (this.page);
557 if (this.b$["javax.swing.JEditorPane"].kit == null) {
558 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this.b$["javax.swing.JEditorPane"]);
561 this.$in = this.b$["javax.swing.JEditorPane"].loading = new javax.swing.JEditorPane.PageStream (this.$in);
562 }}if (this.doc == null) {
564 javax.swing.SwingUtilities.invokeAndWait (((Clazz.isClassDefined ("javax.swing.JEditorPane$PageLoader$2") ? 0 : javax.swing.JEditorPane.PageLoader.$JEditorPane$PageLoader$2$ ()), Clazz.innerTypeInstance (javax.swing.JEditorPane$PageLoader$2, this, null)));
566 if (Clazz.exceptionOf (e$$, java.lang.reflect.InvocationTargetException)) {
569 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this.b$["javax.swing.JEditorPane"]);
572 } else if (Clazz.exceptionOf (e$$, InterruptedException)) {
575 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this.b$["javax.swing.JEditorPane"]);
582 }this.b$["javax.swing.JEditorPane"].read (this.$in, this.doc);
583 var a = this.doc.getProperty ("stream");
586 var c = ((Clazz.isClassDefined ("javax.swing.JEditorPane$PageLoader$3") ? 0 : javax.swing.JEditorPane.PageLoader.$JEditorPane$PageLoader$3$ ()), Clazz.innerTypeInstance (javax.swing.JEditorPane$PageLoader$3, this, null));
587 javax.swing.SwingUtilities.invokeLater (c);
588 }this.pageLoaded = true;
590 if (Clazz.exceptionOf (ioe, java.io.IOException)) {
591 javax.swing.UIManager.getLookAndFeel ().provideErrorFeedback (this.b$["javax.swing.JEditorPane"]);
597 this.b$["javax.swing.JEditorPane"].loading = null;
598 }javax.swing.SwingUtilities.invokeLater (((Clazz.isClassDefined ("javax.swing.JEditorPane$PageLoader$1") ? 0 : javax.swing.JEditorPane.PageLoader.$JEditorPane$PageLoader$1$ ()), Clazz.innerTypeInstance (javax.swing.JEditorPane$PageLoader$1, this, null)));
601 c$.$JEditorPane$PageLoader$2$ = function () {
603 c$ = Clazz.declareAnonymous (javax.swing, "JEditorPane$PageLoader$2", null, Runnable);
604 Clazz.overrideMethod (c$, "run",
606 this.b$["javax.swing.JEditorPane.PageLoader"].doc = this.b$["javax.swing.JEditorPane"].initializeModel (this.b$["javax.swing.JEditorPane"].kit, this.b$["javax.swing.JEditorPane.PageLoader"].page);
607 this.b$["javax.swing.JEditorPane"].setDocument (this.b$["javax.swing.JEditorPane.PageLoader"].doc);
611 c$.$JEditorPane$PageLoader$3$ = function () {
613 c$ = Clazz.declareAnonymous (javax.swing, "JEditorPane$PageLoader$3", null, Runnable);
614 Clazz.overrideMethod (c$, "run",
616 var a = this.b$["javax.swing.JEditorPane"].getDocument ().getProperty ("stream");
618 this.b$["javax.swing.JEditorPane"].scrollToReference (b);
622 c$.$JEditorPane$PageLoader$1$ = function () {
624 c$ = Clazz.declareAnonymous (javax.swing, "JEditorPane$PageLoader$1", null, Runnable);
625 Clazz.overrideMethod (c$, "run",
627 if (this.b$["javax.swing.JEditorPane.PageLoader"].pageLoaded) {
628 this.b$["javax.swing.JEditorPane"].firePropertyChangeObject ("page", this.b$["javax.swing.JEditorPane.PageLoader"].old, this.b$["javax.swing.JEditorPane.PageLoader"].page);
634 c$.$JEditorPane$1$ = function () {
636 c$ = Clazz.declareAnonymous (javax.swing, "JEditorPane$1", null, Runnable);
637 Clazz.overrideMethod (c$, "run",
639 this.b$["javax.swing.JEditorPane"].scrollToReference (this.f$.reference);
643 c$.$JEditorPane$2$ = function () {
645 c$ = Clazz.declareAnonymous (javax.swing, "JEditorPane$2", null, Runnable);
646 Clazz.overrideMethod (c$, "run",
648 this.b$["javax.swing.JEditorPane"].handleConnectionProperties (this.f$.conn);
653 c$ = Clazz.decorateAsClass (function () {
654 this.canceled = false;
655 Clazz.instantialize (this, arguments);
656 }, javax.swing.JEditorPane, "PageStream", java.io.FilterInputStream);
657 Clazz.makeConstructor (c$,
659 Clazz.superConstructor (this, javax.swing.JEditorPane.PageStream, [a]);
660 this.canceled = false;
661 }, "java.io.InputStream");
662 Clazz.defineMethod (c$, "cancel",
664 this.canceled = true;
666 Clazz.defineMethod (c$, "checkCanceled",
669 throw new java.io.IOException ("page canceled");
671 Clazz.defineMethod (c$, "read",
673 this.checkCanceled ();
674 return Clazz.superCall (this, javax.swing.JEditorPane.PageStream, "read", []);
676 Clazz.defineMethod (c$, "skip",
678 this.checkCanceled ();
679 return Clazz.superCall (this, javax.swing.JEditorPane.PageStream, "skip", [a]);
681 Clazz.defineMethod (c$, "available",
683 this.checkCanceled ();
684 return Clazz.superCall (this, javax.swing.JEditorPane.PageStream, "available", []);
686 Clazz.defineMethod (c$, "reset",
688 this.checkCanceled ();
689 Clazz.superCall (this, javax.swing.JEditorPane.PageStream, "reset", []);
693 c$ = Clazz.declareType (javax.swing.JEditorPane, "PlainEditorKit", javax.swing.text.DefaultEditorKit, javax.swing.text.ViewFactory);
694 Clazz.overrideMethod (c$, "getViewFactory",
698 Clazz.overrideMethod (c$, "create",
700 return new javax.swing.text.WrappedPlainView (a);
701 }, "javax.swing.text.Element");
702 Clazz.defineMethod (c$, "createI18N",
704 var b = a.getName ();
706 if (b.equals ("content")) {
707 return new javax.swing.JEditorPane.PlainEditorKit.PlainParagraph (a);
708 } else if (b.equals ("paragraph")) {
709 return new javax.swing.text.BoxView (a, 1);
711 }, "javax.swing.text.Element");
713 c$ = Clazz.declareType (javax.swing.JEditorPane.PlainEditorKit, "PlainParagraph", javax.swing.text.ParagraphView);
714 Clazz.makeConstructor (c$,
716 Clazz.superConstructor (this, javax.swing.JEditorPane.PlainEditorKit.PlainParagraph, [a]);
717 this.layoutPool = new javax.swing.JEditorPane.PlainEditorKit.PlainParagraph.LogicalView (a);
718 this.layoutPool.setParent (this);
719 }, "javax.swing.text.Element");
720 Clazz.overrideMethod (c$, "setPropertiesFromAttributes",
722 var a = this.getContainer ();
723 if ((a != null) && (!a.getComponentOrientation ().isLeftToRight ())) {
724 this.setJustification (2);
726 this.setJustification (0);
728 Clazz.defineMethod (c$, "getFlowSpan",
730 var b = this.getContainer ();
731 if (Clazz.instanceOf (b, javax.swing.JTextArea)) {
733 if (!c.getLineWrap ()) {
735 }}return Clazz.superCall (this, javax.swing.JEditorPane.PlainEditorKit.PlainParagraph, "getFlowSpan", [a]);
737 Clazz.defineMethod (c$, "calculateMinorAxisRequirements",
739 var c = Clazz.superCall (this, javax.swing.JEditorPane.PlainEditorKit.PlainParagraph, "calculateMinorAxisRequirements", [a, b]);
740 var d = this.getContainer ();
741 if (Clazz.instanceOf (d, javax.swing.JTextArea)) {
743 if (!e.getLineWrap ()) {
744 c.minimum = c.preferred;
746 }, "~N,javax.swing.SizeRequirements");
748 c$ = Clazz.declareType (javax.swing.JEditorPane.PlainEditorKit.PlainParagraph, "LogicalView", javax.swing.text.CompositeView);
749 Clazz.overrideMethod (c$, "getViewIndexAtPosition",
751 var b = this.getElement ();
752 if (b.getElementCount () > 0) {
753 return b.getElementIndex (a);
756 Clazz.overrideMethod (c$, "updateChildren",
759 }, "javax.swing.event.DocumentEvent.ElementChange,javax.swing.event.DocumentEvent,javax.swing.text.ViewFactory");
760 Clazz.overrideMethod (c$, "loadChildren",
762 }, "javax.swing.text.ViewFactory");
763 Clazz.defineMethod (c$, "getPreferredSpan",
765 if (this.getViewCount () != 1) throw new Error ("One child view is assumed.");
766 var b = this.getView (0);
767 return b.getPreferredSpan (a);
769 Clazz.defineMethod (c$, "forwardUpdateToView",
770 function (a, b, c, d) {
772 Clazz.superCall (this, javax.swing.JEditorPane.PlainEditorKit.PlainParagraph.LogicalView, "forwardUpdateToView", [a, b, c, d]);
773 }, "javax.swing.text.View,javax.swing.event.DocumentEvent,java.awt.Shape,javax.swing.text.ViewFactory");
774 Clazz.overrideMethod (c$, "paint",
776 }, "java.awt.Graphics,java.awt.Shape");
777 Clazz.overrideMethod (c$, "isBefore",
780 }, "~N,~N,java.awt.Rectangle");
781 Clazz.overrideMethod (c$, "isAfter",
784 }, "~N,~N,java.awt.Rectangle");
785 Clazz.overrideMethod (c$, "getViewAtPoint",
788 }, "~N,~N,java.awt.Rectangle");
789 Clazz.overrideMethod (c$, "childAllocation",
791 }, "~N,java.awt.Rectangle");
796 c$ = Clazz.decorateAsClass (function () {
799 Clazz.instantialize (this, arguments);
800 }, javax.swing.JEditorPane, "HeaderParser");
801 Clazz.makeConstructor (c$,
804 this.tab = Clazz.newArray (10, 2, null);
807 Clazz.defineMethod (c$, "parse",
809 if (this.raw != null) {
810 this.raw = this.raw.trim ();
811 var a = this.raw.toCharArray ();
821 this.tab[d][0] = String.instantialize (a, b, c - b).toLowerCase ();
825 } else if (h == '\"') {
827 this.tab[d++][1] = String.instantialize (a, b, c - b);
831 } while (c < g && (a[c] == ' ' || a[c] == ','));
838 }} else if (h == ' ' || h == ',') {
843 this.tab[d++][0] = ( String.instantialize (a, b, c - b)).toLowerCase ();
845 this.tab[d++][1] = ( String.instantialize (a, b, c - b));
846 }while (c < g && (a[c] == ' ' || a[c] == ',')) {
857 this.tab[d++][1] = ( String.instantialize (a, b, c - b));
859 this.tab[d++][1] = ( String.instantialize (a, b, c - b + 1));
861 this.tab[d][0] = ( String.instantialize (a, b, c - b + 1)).toLowerCase ();
862 }} else if (c == b) {
865 this.tab[d++][1] = String.valueOf (a[c - 1]);
867 this.tab[d++][1] = String.valueOf (a[c]);
869 this.tab[d][0] = String.valueOf (a[c]).toLowerCase ();
871 Clazz.defineMethod (c$, "findKey",
873 if (a < 0 || a > 10) return null;
874 return this.tab[a][0];
876 Clazz.defineMethod (c$, "findValue",
878 if (a < 0 || a > 10) return null;
879 return this.tab[a][1];
881 Clazz.defineMethod (c$, "findValue",
883 return this.findValue (a, null);
885 Clazz.defineMethod (c$, "findValue",
887 if (a == null) return b;
888 a = a.toLowerCase ();
889 for (var c = 0; c < 10; ++c) {
890 if (this.tab[c][0] == null) {
892 } else if (a.equals (this.tab[c][0])) {
893 return this.tab[c][1];
897 Clazz.defineMethod (c$, "findInt",
900 return Integer.parseInt (this.findValue (a, String.valueOf (b)));
906 Clazz.defineStatics (c$,
907 "PostDataProperty", "javax.swing.JEditorPane.postdata");
908 c$.kitRegistryKey = c$.prototype.kitRegistryKey = new Clazz._O ();
909 c$.kitTypeRegistryKey = c$.prototype.kitTypeRegistryKey = new Clazz._O ();
910 c$.kitLoaderRegistryKey = c$.prototype.kitLoaderRegistryKey = new Clazz._O ();
911 Clazz.defineStatics (c$,
912 "$uiClassID", "EditorPaneUI",
913 "W3C_LENGTH_UNITS", "JEditorPane.w3cLengthUnits",
914 "HONOR_DISPLAY_PROPERTIES", "JEditorPane.honorDisplayProperties");
915 c$.defaultEditorKitMap = c$.prototype.defaultEditorKitMap = new java.util.HashMap (0);