Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / swingjs / JSAbstractDocument.js
index aded2ec..666710f 100644 (file)
-Clazz.declarePackage ("swingjs");\r
-Clazz.load (["javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument"], "swingjs.JSAbstractDocument", ["java.lang.IllegalStateException", "java.util.HashMap", "JU.AU", "javax.swing.event.DocumentEvent", "$.DocumentListener", "$.EventListenerList", "javax.swing.text.BadLocationException", "swingjs.JSDocumentEvent"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.props = null;\r
-this.root = null;\r
-this.positions = null;\r
-this.listenerList = null;\r
-this.notifyingListeners = false;\r
-this.filterBypass = null;\r
-this.me = null;\r
-this.sb = null;\r
-this.tempChar = null;\r
-this.filter = null;\r
-if (!Clazz.isClassDefined ("swingjs.JSAbstractDocument.DefaultFilterBypass")) {\r
-swingjs.JSAbstractDocument.$JSAbstractDocument$DefaultFilterBypass$ ();\r
-}\r
-if (!Clazz.isClassDefined ("swingjs.JSAbstractDocument.JSElement")) {\r
-swingjs.JSAbstractDocument.$JSAbstractDocument$JSElement$ ();\r
-}\r
-Clazz.instantialize (this, arguments);\r
-}, swingjs, "JSAbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.me = this;\r
-this.props =  new java.util.HashMap ();\r
-});\r
-Clazz.overrideMethod (c$, "getRootElements", \r
-function () {\r
-return  Clazz.newArray (-1, [this.root, null]);\r
-});\r
-Clazz.defineMethod (c$, "checkLoc", \r
-function (start, end) {\r
-if (start < 0 || end > this.getLength ()) throw  new javax.swing.text.BadLocationException ("JSAbstractDocument: out of range", (start < 0 ? start : end));\r
-}, "~N,~N");\r
-Clazz.defineMethod (c$, "fixPositions", \r
-function (offset, length, isInsert) {\r
-if (this.positions == null || this.positions.isEmpty ()) return;\r
-if (isInsert) {\r
-for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {\r
-var pos = i.intValue ();\r
-if (pos > offset) this.positions.get (i).pos += length;\r
-}\r
-return;\r
-}for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {\r
-var pos = i.intValue ();\r
-if (pos <= offset) continue;\r
-if (pos >= offset + length) this.positions.get (i).pos -= length;\r
- else this.positions.get (i).pos = offset;\r
-}\r
-}, "~N,~N,~B");\r
-Clazz.defineMethod (c$, "getFilterBypass", \r
- function () {\r
-if (this.filterBypass == null) {\r
-this.filterBypass = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.DefaultFilterBypass, this, null);\r
-}return this.filterBypass;\r
-});\r
-Clazz.overrideMethod (c$, "remove", \r
-function (offs, len) {\r
-var filter = this.getDocumentFilter ();\r
-if (filter == null) this.handleRemove (offs, len);\r
- else filter.remove (this.getFilterBypass (), offs, len);\r
-}, "~N,~N");\r
-Clazz.overrideMethod (c$, "insertString", \r
-function (offset, str, a) {\r
-var filter = this.getDocumentFilter ();\r
-if (filter == null) this.handleInsertString (offset, str, a);\r
- else filter.insertString (this.getFilterBypass (), offset, str, a);\r
-}, "~N,~S,javax.swing.text.AttributeSet");\r
-Clazz.overrideMethod (c$, "replace", \r
-function (offset, length, text, attrs) {\r
-if (length == 0 && (text == null || text.length == 0)) return;\r
-var filter = this.getDocumentFilter ();\r
-if (filter != null) {\r
-filter.replace (this.getFilterBypass (), offset, length, text, attrs);\r
-} else {\r
-if (length > 0) this.remove (offset, length);\r
-if (text != null && text.length > 0) this.insertString (offset, text, attrs);\r
-}}, "~N,~N,~S,javax.swing.text.AttributeSet");\r
-Clazz.defineMethod (c$, "taint", \r
- function () {\r
-this.tempChar = null;\r
-});\r
-Clazz.defineMethod (c$, "setLines", \r
- function () {\r
-this.root = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);\r
-var s = this.sb.toString ();\r
-if (s.lastIndexOf ('\n') != s.length - 1) s += "\n";\r
-var ilast = 0;\r
-for (var i = 0; i < s.length; i++) {\r
-if (s.charAt (i) != '\n') continue;\r
-var e = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);\r
-e.start = ilast;\r
-e.end = i;\r
-ilast = i + 1;\r
-this.root.addChild (e);\r
-}\r
-});\r
-Clazz.defineMethod (c$, "handleInsertString", \r
-function (offs, str, a) {\r
-if ((str == null) || (str.length == 0)) {\r
-return;\r
-}this.checkLoc (offs, offs);\r
-this.taint ();\r
-this.sb.insert (offs, str);\r
-this.fixPositions (offs, str.length, true);\r
-if (str.indexOf ('\n') >= 0) this.setLines ();\r
-var e =  new swingjs.JSDocumentEvent (this, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);\r
-this.fireInsertUpdate (e);\r
-}, "~N,~S,javax.swing.text.AttributeSet");\r
-Clazz.defineMethod (c$, "handleRemove", \r
-function (offs, len) {\r
-this.checkLoc (offs, offs + len);\r
-this.taint ();\r
-var str = this.sb.substring2 (offs, offs + len);\r
-this.sb.replace (offs, offs + len, "");\r
-this.fixPositions (offs, offs + len, false);\r
-if (str.indexOf ('\n') >= 0) this.setLines ();\r
-if (len > 0) {\r
-var chng =  new swingjs.JSDocumentEvent (this, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);\r
-this.fireRemoveUpdate (chng);\r
-}}, "~N,~N");\r
-Clazz.defineMethod (c$, "fireInsertUpdate", \r
-function (e) {\r
-if (this.listenerList == null) return;\r
-this.checkAlreadyNotifying ();\r
-this.notifyingListeners = true;\r
-try {\r
-var listeners = this.listenerList.getListenerList ();\r
-for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
-if (listeners[i] === javax.swing.event.DocumentListener) {\r
-(listeners[i + 1]).insertUpdate (e);\r
-}}\r
-} finally {\r
-this.notifyingListeners = false;\r
-}\r
-}, "javax.swing.event.DocumentEvent");\r
-Clazz.defineMethod (c$, "fireChangedUpdate", \r
-function (e) {\r
-if (this.listenerList == null) return;\r
-this.checkAlreadyNotifying ();\r
-this.notifyingListeners = true;\r
-try {\r
-var listeners = this.listenerList.getListenerList ();\r
-for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
-if (listeners[i] === javax.swing.event.DocumentListener) {\r
-(listeners[i + 1]).changedUpdate (e);\r
-}}\r
-} finally {\r
-this.notifyingListeners = false;\r
-}\r
-}, "javax.swing.event.DocumentEvent");\r
-Clazz.defineMethod (c$, "fireRemoveUpdate", \r
-function (e) {\r
-if (this.listenerList == null) return;\r
-this.checkAlreadyNotifying ();\r
-this.notifyingListeners = true;\r
-try {\r
-var listeners = this.listenerList.getListenerList ();\r
-for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
-if (listeners[i] === javax.swing.event.DocumentListener) {\r
-(listeners[i + 1]).removeUpdate (e);\r
-}}\r
-} finally {\r
-this.notifyingListeners = false;\r
-}\r
-}, "javax.swing.event.DocumentEvent");\r
-Clazz.defineMethod (c$, "checkAlreadyNotifying", \r
- function () {\r
-if (this.notifyingListeners) throw  new IllegalStateException ("One of the document listeners modifed the document. This is not allowed.");\r
-});\r
-Clazz.overrideMethod (c$, "addDocumentListener", \r
-function (listener) {\r
-if (this.listenerList == null) this.listenerList =  new javax.swing.event.EventListenerList ();\r
-this.listenerList.add (javax.swing.event.DocumentListener, listener);\r
-}, "javax.swing.event.DocumentListener");\r
-Clazz.overrideMethod (c$, "removeDocumentListener", \r
-function (listener) {\r
-if (this.listenerList != null) this.listenerList.remove (javax.swing.event.DocumentListener, listener);\r
-}, "javax.swing.event.DocumentListener");\r
-Clazz.overrideMethod (c$, "addUndoableEditListener", \r
-function (listener) {\r
-}, "javax.swing.event.UndoableEditListener");\r
-Clazz.overrideMethod (c$, "removeUndoableEditListener", \r
-function (listener) {\r
-}, "javax.swing.event.UndoableEditListener");\r
-Clazz.overrideMethod (c$, "getProperty", \r
-function (key) {\r
-return this.props.get (key);\r
-}, "~O");\r
-Clazz.overrideMethod (c$, "putProperty", \r
-function (key, value) {\r
-this.props.put (key, value);\r
-}, "~O,~O");\r
-Clazz.overrideMethod (c$, "getAsynchronousLoadPriority", \r
-function () {\r
-return -1;\r
-});\r
-Clazz.overrideMethod (c$, "setDocumentFilter", \r
-function (filter) {\r
-this.filter = filter;\r
-}, "javax.swing.text.DocumentFilter");\r
-Clazz.defineMethod (c$, "getDocumentFilter", \r
-function () {\r
-return this.filter;\r
-});\r
-c$.$JSAbstractDocument$DefaultFilterBypass$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-Clazz.instantialize (this, arguments);\r
-}, swingjs.JSAbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);\r
-Clazz.overrideMethod (c$, "getDocument", \r
-function () {\r
-return this.b$["swingjs.JSAbstractDocument"].me;\r
-});\r
-Clazz.overrideMethod (c$, "remove", \r
-function (a, b) {\r
-this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);\r
-}, "~N,~N");\r
-Clazz.overrideMethod (c$, "insertString", \r
-function (a, b, c) {\r
-this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, b, c);\r
-}, "~N,~S,javax.swing.text.AttributeSet");\r
-Clazz.overrideMethod (c$, "replace", \r
-function (a, b, c, d) {\r
-this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);\r
-this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, c, d);\r
-}, "~N,~N,~S,javax.swing.text.AttributeSet");\r
-c$ = Clazz.p0p ();\r
-};\r
-c$.$JSAbstractDocument$JSElement$ = function () {\r
-Clazz.pu$h(self.c$);\r
-c$ = Clazz.decorateAsClass (function () {\r
-Clazz.prepareCallback (this, arguments);\r
-this.parent = null;\r
-this.attributeSet = null;\r
-this.start = 0;\r
-this.end = 0;\r
-this.nchildren = 0;\r
-this.children = null;\r
-this.lastIndex = 0;\r
-Clazz.instantialize (this, arguments);\r
-}, swingjs.JSAbstractDocument, "JSElement", null, javax.swing.text.Element);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.children = null;\r
-this.nchildren = 0;\r
-this.lastIndex = -1;\r
-});\r
-Clazz.defineMethod (c$, "addChild", \r
-function (a) {\r
-if (this.children == null) this.children =  new Array (10);\r
- else if (this.nchildren == this.children.length) this.children = JU.AU.doubleLength (this.children);\r
-this.children[this.nchildren++] = a;\r
-}, "swingjs.JSAbstractDocument.JSElement");\r
-Clazz.overrideMethod (c$, "getDocument", \r
-function () {\r
-return this.b$["swingjs.JSAbstractDocument"].me;\r
-});\r
-Clazz.overrideMethod (c$, "getParentElement", \r
-function () {\r
-return this.parent;\r
-});\r
-Clazz.overrideMethod (c$, "getName", \r
-function () {\r
-return this.getName ();\r
-});\r
-Clazz.overrideMethod (c$, "getAttributes", \r
-function () {\r
-return this.attributeSet;\r
-});\r
-Clazz.defineMethod (c$, "getStartOffset", \r
-function () {\r
-return this.start;\r
-});\r
-Clazz.defineMethod (c$, "getEndOffset", \r
-function () {\r
-return this.end;\r
-});\r
-Clazz.overrideMethod (c$, "getElementIndex", \r
-function (a) {\r
-var b;\r
-var c = 0;\r
-var d = this.nchildren - 1;\r
-var e = 0;\r
-var f = this.getStartOffset ();\r
-var g;\r
-if (this.nchildren == 0) {\r
-return 0;\r
-}if (a >= this.getEndOffset ()) {\r
-return this.nchildren - 1;\r
-}if ((this.lastIndex >= c) && (this.lastIndex <= d)) {\r
-var h = this.children[this.lastIndex];\r
-f = h.getStartOffset ();\r
-g = h.getEndOffset ();\r
-if ((a >= f) && (a < g)) {\r
-return this.lastIndex;\r
-}if (a < f) {\r
-d = this.lastIndex;\r
-} else {\r
-c = this.lastIndex;\r
-}}while (c <= d) {\r
-e = c + (Clazz.doubleToInt ((d - c) / 2));\r
-var h = this.children[e];\r
-f = h.getStartOffset ();\r
-g = h.getEndOffset ();\r
-if ((a >= f) && (a < g)) {\r
-b = e;\r
-this.lastIndex = b;\r
-return b;\r
-} else if (a < f) {\r
-d = e - 1;\r
-} else {\r
-c = e + 1;\r
-}}\r
-if (a < f) {\r
-b = e;\r
-} else {\r
-b = e + 1;\r
-}this.lastIndex = b;\r
-return b;\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "getElementCount", \r
-function () {\r
-return this.nchildren;\r
-});\r
-Clazz.overrideMethod (c$, "getElement", \r
-function (a) {\r
-return (a >= this.nchildren ? null : this.children[a]);\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "isLeaf", \r
-function () {\r
-return (this.parent != null);\r
-});\r
-c$ = Clazz.p0p ();\r
-};\r
-Clazz.defineStatics (c$,\r
-"ParagraphElementName", "paragraph",\r
-"ContentElementName", "content");\r
-});\r
+Clazz.declarePackage ("swingjs");
+Clazz.load (["javax.swing.text.DocumentFilter", "$.Element", "$.JSMinimalAbstractDocument"], "swingjs.JSAbstractDocument", ["java.lang.IllegalStateException", "java.util.HashMap", "JU.AU", "javax.swing.event.DocumentEvent", "$.DocumentListener", "$.EventListenerList", "javax.swing.text.BadLocationException", "swingjs.JSDocumentEvent"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.props = null;
+this.root = null;
+this.positions = null;
+this.listenerList = null;
+this.notifyingListeners = false;
+this.filterBypass = null;
+this.me = null;
+this.sb = null;
+this.tempChar = null;
+this.filter = null;
+if (!Clazz.isClassDefined ("swingjs.JSAbstractDocument.DefaultFilterBypass")) {
+swingjs.JSAbstractDocument.$JSAbstractDocument$DefaultFilterBypass$ ();
+}
+if (!Clazz.isClassDefined ("swingjs.JSAbstractDocument.JSElement")) {
+swingjs.JSAbstractDocument.$JSAbstractDocument$JSElement$ ();
+}
+Clazz.instantialize (this, arguments);
+}, swingjs, "JSAbstractDocument", null, javax.swing.text.JSMinimalAbstractDocument);
+Clazz.makeConstructor (c$, 
+function () {
+this.me = this;
+this.props =  new java.util.HashMap ();
+});
+Clazz.overrideMethod (c$, "getRootElements", 
+function () {
+return  Clazz.newArray (-1, [this.root, null]);
+});
+Clazz.defineMethod (c$, "checkLoc", 
+function (start, end) {
+if (start < 0 || end > this.getLength ()) throw  new javax.swing.text.BadLocationException ("JSAbstractDocument: out of range", (start < 0 ? start : end));
+}, "~N,~N");
+Clazz.defineMethod (c$, "fixPositions", 
+function (offset, length, isInsert) {
+if (this.positions == null || this.positions.isEmpty ()) return;
+if (isInsert) {
+for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
+var pos = i.intValue ();
+if (pos > offset) this.positions.get (i).pos += length;
+}
+return;
+}for (var i, $i = this.positions.keySet ().iterator (); $i.hasNext () && ((i = $i.next ()) || true);) {
+var pos = i.intValue ();
+if (pos <= offset) continue;
+if (pos >= offset + length) this.positions.get (i).pos -= length;
+ else this.positions.get (i).pos = offset;
+}
+}, "~N,~N,~B");
+Clazz.defineMethod (c$, "getFilterBypass", 
+ function () {
+if (this.filterBypass == null) {
+this.filterBypass = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.DefaultFilterBypass, this, null);
+}return this.filterBypass;
+});
+Clazz.overrideMethod (c$, "remove", 
+function (offs, len) {
+var filter = this.getDocumentFilter ();
+if (filter == null) this.handleRemove (offs, len);
+ else filter.remove (this.getFilterBypass (), offs, len);
+}, "~N,~N");
+Clazz.overrideMethod (c$, "insertString", 
+function (offset, str, a) {
+var filter = this.getDocumentFilter ();
+if (filter == null) this.handleInsertString (offset, str, a);
+ else filter.insertString (this.getFilterBypass (), offset, str, a);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz.overrideMethod (c$, "replace", 
+function (offset, length, text, attrs) {
+if (length == 0 && (text == null || text.length == 0)) return;
+var filter = this.getDocumentFilter ();
+if (filter != null) {
+filter.replace (this.getFilterBypass (), offset, length, text, attrs);
+} else {
+if (length > 0) this.remove (offset, length);
+if (text != null && text.length > 0) this.insertString (offset, text, attrs);
+}}, "~N,~N,~S,javax.swing.text.AttributeSet");
+Clazz.defineMethod (c$, "taint", 
+ function () {
+this.tempChar = null;
+});
+Clazz.defineMethod (c$, "setLines", 
+ function () {
+this.root = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
+var s = this.sb.toString ();
+if (s.lastIndexOf ('\n') != s.length - 1) s += "\n";
+var ilast = 0;
+for (var i = 0; i < s.length; i++) {
+if (s.charAt (i) != '\n') continue;
+var e = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null);
+e.start = ilast;
+e.end = i;
+ilast = i + 1;
+this.root.addChild (e);
+}
+});
+Clazz.defineMethod (c$, "handleInsertString", 
+function (offs, str, a) {
+if ((str == null) || (str.length == 0)) {
+return;
+}this.checkLoc (offs, offs);
+this.taint ();
+this.sb.insert (offs, str);
+this.fixPositions (offs, str.length, true);
+if (str.indexOf ('\n') >= 0) this.setLines ();
+var e =  new swingjs.JSDocumentEvent (this, offs, str.length, javax.swing.event.DocumentEvent.EventType.INSERT);
+this.fireInsertUpdate (e);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz.defineMethod (c$, "handleRemove", 
+function (offs, len) {
+this.checkLoc (offs, offs + len);
+this.taint ();
+var str = this.sb.substring2 (offs, offs + len);
+this.sb.replace (offs, offs + len, "");
+this.fixPositions (offs, offs + len, false);
+if (str.indexOf ('\n') >= 0) this.setLines ();
+if (len > 0) {
+var chng =  new swingjs.JSDocumentEvent (this, offs, len, javax.swing.event.DocumentEvent.EventType.REMOVE);
+this.fireRemoveUpdate (chng);
+}}, "~N,~N");
+Clazz.defineMethod (c$, "fireInsertUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).insertUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz.defineMethod (c$, "fireChangedUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).changedUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz.defineMethod (c$, "fireRemoveUpdate", 
+function (e) {
+if (this.listenerList == null) return;
+this.checkAlreadyNotifying ();
+this.notifyingListeners = true;
+try {
+var listeners = this.listenerList.getListenerList ();
+for (var i = listeners.length - 2; i >= 0; i -= 2) {
+if (listeners[i] === javax.swing.event.DocumentListener) {
+(listeners[i + 1]).removeUpdate (e);
+}}
+} finally {
+this.notifyingListeners = false;
+}
+}, "javax.swing.event.DocumentEvent");
+Clazz.defineMethod (c$, "checkAlreadyNotifying", 
+ function () {
+if (this.notifyingListeners) throw  new IllegalStateException ("One of the document listeners modifed the document. This is not allowed.");
+});
+Clazz.overrideMethod (c$, "addDocumentListener", 
+function (listener) {
+if (this.listenerList == null) this.listenerList =  new javax.swing.event.EventListenerList ();
+this.listenerList.add (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz.overrideMethod (c$, "removeDocumentListener", 
+function (listener) {
+if (this.listenerList != null) this.listenerList.remove (javax.swing.event.DocumentListener, listener);
+}, "javax.swing.event.DocumentListener");
+Clazz.overrideMethod (c$, "addUndoableEditListener", 
+function (listener) {
+}, "javax.swing.event.UndoableEditListener");
+Clazz.overrideMethod (c$, "removeUndoableEditListener", 
+function (listener) {
+}, "javax.swing.event.UndoableEditListener");
+Clazz.overrideMethod (c$, "getProperty", 
+function (key) {
+return this.props.get (key);
+}, "~O");
+Clazz.overrideMethod (c$, "putProperty", 
+function (key, value) {
+this.props.put (key, value);
+}, "~O,~O");
+Clazz.overrideMethod (c$, "getAsynchronousLoadPriority", 
+function () {
+return -1;
+});
+Clazz.overrideMethod (c$, "setDocumentFilter", 
+function (filter) {
+this.filter = filter;
+}, "javax.swing.text.DocumentFilter");
+Clazz.defineMethod (c$, "getDocumentFilter", 
+function () {
+return this.filter;
+});
+c$.$JSAbstractDocument$DefaultFilterBypass$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+Clazz.instantialize (this, arguments);
+}, swingjs.JSAbstractDocument, "DefaultFilterBypass", javax.swing.text.DocumentFilter.FilterBypass);
+Clazz.overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["swingjs.JSAbstractDocument"].me;
+});
+Clazz.overrideMethod (c$, "remove", 
+function (a, b) {
+this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
+}, "~N,~N");
+Clazz.overrideMethod (c$, "insertString", 
+function (a, b, c) {
+this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, b, c);
+}, "~N,~S,javax.swing.text.AttributeSet");
+Clazz.overrideMethod (c$, "replace", 
+function (a, b, c, d) {
+this.b$["swingjs.JSAbstractDocument"].handleRemove (a, b);
+this.b$["swingjs.JSAbstractDocument"].handleInsertString (a, c, d);
+}, "~N,~N,~S,javax.swing.text.AttributeSet");
+c$ = Clazz.p0p ();
+};
+c$.$JSAbstractDocument$JSElement$ = function () {
+Clazz.pu$h(self.c$);
+c$ = Clazz.decorateAsClass (function () {
+Clazz.prepareCallback (this, arguments);
+this.parent = null;
+this.attributeSet = null;
+this.start = 0;
+this.end = 0;
+this.nchildren = 0;
+this.children = null;
+this.lastIndex = 0;
+Clazz.instantialize (this, arguments);
+}, swingjs.JSAbstractDocument, "JSElement", null, javax.swing.text.Element);
+Clazz.makeConstructor (c$, 
+function () {
+this.children = null;
+this.nchildren = 0;
+this.lastIndex = -1;
+});
+Clazz.defineMethod (c$, "addChild", 
+function (a) {
+if (this.children == null) this.children =  new Array (10);
+ else if (this.nchildren == this.children.length) this.children = JU.AU.doubleLength (this.children);
+this.children[this.nchildren++] = a;
+}, "swingjs.JSAbstractDocument.JSElement");
+Clazz.overrideMethod (c$, "getDocument", 
+function () {
+return this.b$["swingjs.JSAbstractDocument"].me;
+});
+Clazz.overrideMethod (c$, "getParentElement", 
+function () {
+return this.parent;
+});
+Clazz.overrideMethod (c$, "getName", 
+function () {
+return this.getName ();
+});
+Clazz.overrideMethod (c$, "getAttributes", 
+function () {
+return this.attributeSet;
+});
+Clazz.defineMethod (c$, "getStartOffset", 
+function () {
+return this.start;
+});
+Clazz.defineMethod (c$, "getEndOffset", 
+function () {
+return this.end;
+});
+Clazz.overrideMethod (c$, "getElementIndex", 
+function (a) {
+var b;
+var c = 0;
+var d = this.nchildren - 1;
+var e = 0;
+var f = this.getStartOffset ();
+var g;
+if (this.nchildren == 0) {
+return 0;
+}if (a >= this.getEndOffset ()) {
+return this.nchildren - 1;
+}if ((this.lastIndex >= c) && (this.lastIndex <= d)) {
+var h = this.children[this.lastIndex];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+return this.lastIndex;
+}if (a < f) {
+d = this.lastIndex;
+} else {
+c = this.lastIndex;
+}}while (c <= d) {
+e = c + (Clazz.doubleToInt ((d - c) / 2));
+var h = this.children[e];
+f = h.getStartOffset ();
+g = h.getEndOffset ();
+if ((a >= f) && (a < g)) {
+b = e;
+this.lastIndex = b;
+return b;
+} else if (a < f) {
+d = e - 1;
+} else {
+c = e + 1;
+}}
+if (a < f) {
+b = e;
+} else {
+b = e + 1;
+}this.lastIndex = b;
+return b;
+}, "~N");
+Clazz.overrideMethod (c$, "getElementCount", 
+function () {
+return this.nchildren;
+});
+Clazz.overrideMethod (c$, "getElement", 
+function (a) {
+return (a >= this.nchildren ? null : this.children[a]);
+}, "~N");
+Clazz.overrideMethod (c$, "isLeaf", 
+function () {
+return (this.parent != null);
+});
+c$ = Clazz.p0p ();
+};
+Clazz.defineStatics (c$,
+"ParagraphElementName", "paragraph",
+"ContentElementName", "content");
+});