X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fswingjs%2FJSPlainDocument.js;fp=site%2Fswingjs%2Fj2s%2Fswingjs%2FJSPlainDocument.js;h=5a11b916fc854f5b69942f2670f85bc3c0e75ec8;hp=e11ce3df813581b2172a47bee2ab80434cb77ce5;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/swingjs/JSPlainDocument.js b/site/swingjs/j2s/swingjs/JSPlainDocument.js index e11ce3d..5a11b91 100644 --- a/site/swingjs/j2s/swingjs/JSPlainDocument.js +++ b/site/swingjs/j2s/swingjs/JSPlainDocument.js @@ -1,57 +1,57 @@ -Clazz.declarePackage ("swingjs"); -Clazz.load (["swingjs.JSAbstractDocument"], "swingjs.JSPlainDocument", ["java.util.Hashtable", "JU.SB", "swingjs.JSPosition"], function () { -c$ = Clazz.declareType (swingjs, "JSPlainDocument", swingjs.JSAbstractDocument); -Clazz.makeConstructor (c$, -function () { -Clazz.superConstructor (this, swingjs.JSPlainDocument); -this.sb = new JU.SB (); -this.root = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null); -}); -Clazz.overrideMethod (c$, "getLength", -function () { -return this.sb.length (); -}); -Clazz.defineMethod (c$, "getText", -function (offset, length) { -this.checkLoc (offset, offset + length); -return this.sb.substring2 (offset, offset + length); -}, "~N,~N"); -Clazz.defineMethod (c$, "getText", -function (offset, length, chars) { -this.checkLoc (offset, offset + length); -if (this.tempChar == null) { -this.tempChar = Clazz.newCharArray (this.sb.length (), '\0'); -for (var i = this.tempChar.length; --i >= 0; ) this.tempChar[i] = this.sb.charAt (i); - -}chars.array = this.tempChar; -chars.offset = offset; -chars.count = length; -}, "~N,~N,javax.swing.text.Segment"); -Clazz.overrideMethod (c$, "getStartPosition", -function () { -return new swingjs.JSPosition (0); -}); -Clazz.overrideMethod (c$, "getEndPosition", -function () { -return new swingjs.JSPosition (this.sb.length ()); -}); -Clazz.overrideMethod (c$, "createPosition", -function (offs) { -this.checkLoc (offs, offs); -var i = Integer.$valueOf (offs); -if (this.positions == null) this.positions = new java.util.Hashtable (); -var p = this.positions.get (i); -if (p == null) this.positions.put (i, p = new swingjs.JSPosition (offs)); -return p; -}, "~N"); -Clazz.overrideMethod (c$, "getDefaultRootElement", -function () { -return this.root; -}); -Clazz.overrideMethod (c$, "render", -function (r) { -}, "Runnable"); -Clazz.defineStatics (c$, -"tabSizeAttribute", "tabSize", -"lineLimitAttribute", "lineLimit"); -}); +Clazz.declarePackage ("swingjs"); +Clazz.load (["swingjs.JSAbstractDocument"], "swingjs.JSPlainDocument", ["java.util.Hashtable", "JU.SB", "swingjs.JSPosition"], function () { +c$ = Clazz.declareType (swingjs, "JSPlainDocument", swingjs.JSAbstractDocument); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, swingjs.JSPlainDocument); +this.sb = new JU.SB (); +this.root = Clazz.innerTypeInstance (swingjs.JSAbstractDocument.JSElement, this, null); +}); +Clazz.overrideMethod (c$, "getLength", +function () { +return this.sb.length (); +}); +Clazz.defineMethod (c$, "getText", +function (offset, length) { +this.checkLoc (offset, offset + length); +return this.sb.substring2 (offset, offset + length); +}, "~N,~N"); +Clazz.defineMethod (c$, "getText", +function (offset, length, chars) { +this.checkLoc (offset, offset + length); +if (this.tempChar == null) { +this.tempChar = Clazz.newCharArray (this.sb.length (), '\0'); +for (var i = this.tempChar.length; --i >= 0; ) this.tempChar[i] = this.sb.charAt (i); + +}chars.array = this.tempChar; +chars.offset = offset; +chars.count = length; +}, "~N,~N,javax.swing.text.Segment"); +Clazz.overrideMethod (c$, "getStartPosition", +function () { +return new swingjs.JSPosition (0); +}); +Clazz.overrideMethod (c$, "getEndPosition", +function () { +return new swingjs.JSPosition (this.sb.length ()); +}); +Clazz.overrideMethod (c$, "createPosition", +function (offs) { +this.checkLoc (offs, offs); +var i = Integer.$valueOf (offs); +if (this.positions == null) this.positions = new java.util.Hashtable (); +var p = this.positions.get (i); +if (p == null) this.positions.put (i, p = new swingjs.JSPosition (offs)); +return p; +}, "~N"); +Clazz.overrideMethod (c$, "getDefaultRootElement", +function () { +return this.root; +}); +Clazz.overrideMethod (c$, "render", +function (r) { +}, "Runnable"); +Clazz.defineStatics (c$, +"tabSizeAttribute", "tabSize", +"lineLimitAttribute", "lineLimit"); +});