Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / javax / swing / text / CompositeView.js
index deb3bf0..70bfcd7 100644 (file)
-Clazz.declarePackage ("javax.swing.text");\r
-Clazz.load (["javax.swing.text.View"], "javax.swing.text.CompositeView", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants", "$.Utilities"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.children = null;\r
-this.nchildren = 0;\r
-this.left = 0;\r
-this.right = 0;\r
-this.top = 0;\r
-this.bottom = 0;\r
-this.childAlloc = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.text, "CompositeView", javax.swing.text.View);\r
-Clazz.makeConstructor (c$, \r
-function (elem) {\r
-Clazz.superConstructor (this, javax.swing.text.CompositeView, [elem]);\r
-this.children =  new Array (1);\r
-this.nchildren = 0;\r
-this.childAlloc =  new java.awt.Rectangle ();\r
-}, "javax.swing.text.Element");\r
-Clazz.defineMethod (c$, "loadChildren", \r
-function (f) {\r
-if (f == null) {\r
-return;\r
-}var e = this.getElement ();\r
-var n = e.getElementCount ();\r
-if (n > 0) {\r
-var added =  new Array (n);\r
-for (var i = 0; i < n; i++) {\r
-added[i] = f.create (e.getElement (i));\r
-}\r
-this.replace (0, 0, added);\r
-}}, "javax.swing.text.ViewFactory");\r
-Clazz.defineMethod (c$, "setParent", \r
-function (parent) {\r
-Clazz.superCall (this, javax.swing.text.CompositeView, "setParent", [parent]);\r
-if ((parent != null) && (this.nchildren == 0)) {\r
-var f = this.getViewFactory ();\r
-this.loadChildren (f);\r
-}}, "javax.swing.text.View");\r
-Clazz.overrideMethod (c$, "getViewCount", \r
-function () {\r
-return this.nchildren;\r
-});\r
-Clazz.overrideMethod (c$, "getView", \r
-function (n) {\r
-return this.children[n];\r
-}, "~N");\r
-Clazz.overrideMethod (c$, "replace", \r
-function (offset, length, views) {\r
-if (views == null) {\r
-views = javax.swing.text.CompositeView.ZERO;\r
-}for (var i = offset; i < offset + length; i++) {\r
-if (this.children[i].getParent () === this) {\r
-this.children[i].setParent (null);\r
-}this.children[i] = null;\r
-}\r
-var delta = views.length - length;\r
-var src = offset + length;\r
-var nmove = this.nchildren - src;\r
-var dest = src + delta;\r
-if ((this.nchildren + delta) >= this.children.length) {\r
-var newLength = Math.max (2 * this.children.length, this.nchildren + delta);\r
-var newChildren =  new Array (newLength);\r
-System.arraycopy (this.children, 0, newChildren, 0, offset);\r
-System.arraycopy (views, 0, newChildren, offset, views.length);\r
-System.arraycopy (this.children, src, newChildren, dest, nmove);\r
-this.children = newChildren;\r
-} else {\r
-System.arraycopy (this.children, src, this.children, dest, nmove);\r
-System.arraycopy (views, 0, this.children, offset, views.length);\r
-}this.nchildren = this.nchildren + delta;\r
-for (var i = 0; i < views.length; i++) {\r
-views[i].setParent (this);\r
-}\r
-}, "~N,~N,~A");\r
-Clazz.overrideMethod (c$, "getChildAllocation", \r
-function (index, a) {\r
-var alloc = this.getInsideAllocation (a);\r
-this.childAllocation (index, alloc);\r
-return alloc;\r
-}, "~N,java.awt.Shape");\r
-Clazz.defineMethod (c$, "modelToView", \r
-function (pos, a, b) {\r
-var isBackward = (b === javax.swing.text.Position.Bias.Backward);\r
-var testPos = (isBackward) ? Math.max (0, pos - 1) : pos;\r
-if (isBackward && testPos < this.getStartOffset ()) {\r
-return null;\r
-}var vIndex = this.getViewIndexAtPosition (testPos);\r
-if ((vIndex != -1) && (vIndex < this.getViewCount ())) {\r
-var v = this.getView (vIndex);\r
-if (v != null && testPos >= v.getStartOffset () && testPos < v.getEndOffset ()) {\r
-var childShape = this.getChildAllocation (vIndex, a);\r
-if (childShape == null) {\r
-return null;\r
-}var retShape = v.modelToView (pos, childShape, b);\r
-if (retShape == null && v.getEndOffset () == pos) {\r
-if (++vIndex < this.getViewCount ()) {\r
-v = this.getView (vIndex);\r
-retShape = v.modelToView (pos, this.getChildAllocation (vIndex, a), b);\r
-}}return retShape;\r
-}}throw  new javax.swing.text.BadLocationException ("Position not represented by view", pos);\r
-}, "~N,java.awt.Shape,javax.swing.text.Position.Bias");\r
-Clazz.defineMethod (c$, "modelToView", \r
-function (p0, b0, p1, b1, a) {\r
-if (p0 == this.getStartOffset () && p1 == this.getEndOffset ()) {\r
-return a;\r
-}var alloc = this.getInsideAllocation (a);\r
-var r0 =  new java.awt.Rectangle (alloc);\r
-var v0 = this.getViewAtPosition ((b0 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p0 - 1) : p0, r0);\r
-var r1 =  new java.awt.Rectangle (alloc);\r
-var v1 = this.getViewAtPosition ((b1 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p1 - 1) : p1, r1);\r
-if (v0 === v1) {\r
-if (v0 == null) {\r
-return a;\r
-}return v0.modelToView (p0, b0, p1, b1, r0);\r
-}var viewCount = this.getViewCount ();\r
-var counter = 0;\r
-while (counter < viewCount) {\r
-var v;\r
-if ((v = this.getView (counter)) === v0 || v === v1) {\r
-var endView;\r
-var retRect;\r
-var tempRect =  new java.awt.Rectangle ();\r
-if (v === v0) {\r
-retRect = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0).getBounds ();\r
-endView = v1;\r
-} else {\r
-retRect = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1).getBounds ();\r
-endView = v0;\r
-}while (++counter < viewCount && (v = this.getView (counter)) !== endView) {\r
-tempRect.setBounds (alloc);\r
-this.childAllocation (counter, tempRect);\r
-retRect.add (tempRect);\r
-}\r
-if (endView != null) {\r
-var endShape;\r
-if (endView === v1) {\r
-endShape = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1);\r
-} else {\r
-endShape = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0);\r
-}if (Clazz.instanceOf (endShape, java.awt.Rectangle)) {\r
-retRect.add (endShape);\r
-} else {\r
-retRect.add (endShape.getBounds ());\r
-}}return retRect;\r
-}counter++;\r
-}\r
-throw  new javax.swing.text.BadLocationException ("Position not represented by view", p0);\r
-}, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");\r
-Clazz.defineMethod (c$, "viewToModel", \r
-function (x, y, a, bias) {\r
-var alloc = this.getInsideAllocation (a);\r
-if (this.isBefore (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc)) {\r
-var retValue = -1;\r
-try {\r
-retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 3, bias);\r
-} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {\r
-var ble = e$$;\r
-{\r
-}\r
-} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {\r
-var iae = e$$;\r
-{\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-if (retValue == -1) {\r
-retValue = this.getStartOffset ();\r
-bias[0] = javax.swing.text.Position.Bias.Forward;\r
-}return retValue;\r
-} else if (this.isAfter (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc)) {\r
-var retValue = -1;\r
-try {\r
-retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 7, bias);\r
-} catch (e$$) {\r
-if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {\r
-var ble = e$$;\r
-{\r
-}\r
-} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {\r
-var iae = e$$;\r
-{\r
-}\r
-} else {\r
-throw e$$;\r
-}\r
-}\r
-if (retValue == -1) {\r
-retValue = this.getEndOffset () - 1;\r
-bias[0] = javax.swing.text.Position.Bias.Forward;\r
-}return retValue;\r
-} else {\r
-var v = this.getViewAtPoint (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc);\r
-if (v != null) {\r
-return v.viewToModel (x, y, alloc, bias);\r
-}}return -1;\r
-}, "~N,~N,java.awt.Shape,~A");\r
-Clazz.overrideMethod (c$, "getNextVisualPositionFrom", \r
-function (pos, b, a, direction, biasRet) {\r
-switch (direction) {\r
-case 1:\r
-return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);\r
-case 5:\r
-return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);\r
-case 3:\r
-return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);\r
-case 7:\r
-return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);\r
-default:\r
-throw  new IllegalArgumentException ("Bad direction: " + direction);\r
-}\r
-}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");\r
-Clazz.defineMethod (c$, "getViewIndex", \r
-function (pos, b) {\r
-if (b === javax.swing.text.Position.Bias.Backward) {\r
-pos -= 1;\r
-}if ((pos >= this.getStartOffset ()) && (pos < this.getEndOffset ())) {\r
-return this.getViewIndexAtPosition (pos);\r
-}return -1;\r
-}, "~N,javax.swing.text.Position.Bias");\r
-Clazz.defineMethod (c$, "getViewAtPosition", \r
-function (pos, a) {\r
-var index = this.getViewIndexAtPosition (pos);\r
-if ((index >= 0) && (index < this.getViewCount ())) {\r
-var v = this.getView (index);\r
-if (a != null) {\r
-this.childAllocation (index, a);\r
-}return v;\r
-}return null;\r
-}, "~N,java.awt.Rectangle");\r
-Clazz.defineMethod (c$, "getViewIndexAtPosition", \r
-function (pos) {\r
-var elem = this.getElement ();\r
-return elem.getElementIndex (pos);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getInsideAllocation", \r
-function (a) {\r
-if (a != null) {\r
-var alloc;\r
-if (Clazz.instanceOf (a, java.awt.Rectangle)) {\r
-alloc = a;\r
-} else {\r
-alloc = a.getBounds ();\r
-}this.childAlloc.setBounds (alloc);\r
-this.childAlloc.x += this.getLeftInset ();\r
-this.childAlloc.y += this.getTopInset ();\r
-this.childAlloc.width -= this.getLeftInset () + this.getRightInset ();\r
-this.childAlloc.height -= this.getTopInset () + this.getBottomInset ();\r
-return this.childAlloc;\r
-}return null;\r
-}, "java.awt.Shape");\r
-Clazz.defineMethod (c$, "setParagraphInsets", \r
-function (attr) {\r
-this.top = Clazz.floatToShort (javax.swing.text.StyleConstants.getSpaceAbove (attr));\r
-this.left = Clazz.floatToShort (javax.swing.text.StyleConstants.getLeftIndent (attr));\r
-this.bottom = Clazz.floatToShort (javax.swing.text.StyleConstants.getSpaceBelow (attr));\r
-this.right = Clazz.floatToShort (javax.swing.text.StyleConstants.getRightIndent (attr));\r
-}, "javax.swing.text.AttributeSet");\r
-Clazz.defineMethod (c$, "setInsets", \r
-function (top, left, bottom, right) {\r
-this.top = top;\r
-this.left = left;\r
-this.right = right;\r
-this.bottom = bottom;\r
-}, "~N,~N,~N,~N");\r
-Clazz.defineMethod (c$, "getLeftInset", \r
-function () {\r
-return this.left;\r
-});\r
-Clazz.defineMethod (c$, "getRightInset", \r
-function () {\r
-return this.right;\r
-});\r
-Clazz.defineMethod (c$, "getTopInset", \r
-function () {\r
-return this.top;\r
-});\r
-Clazz.defineMethod (c$, "getBottomInset", \r
-function () {\r
-return this.bottom;\r
-});\r
-Clazz.defineMethod (c$, "getNextNorthSouthVisualPositionFrom", \r
-function (pos, b, a, direction, biasRet) {\r
-return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);\r
-}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");\r
-Clazz.defineMethod (c$, "getNextEastWestVisualPositionFrom", \r
-function (pos, b, a, direction, biasRet) {\r
-return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);\r
-}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");\r
-Clazz.defineMethod (c$, "flipEastAndWestAtEnds", \r
-function (position, bias) {\r
-return false;\r
-}, "~N,javax.swing.text.Position.Bias");\r
-c$.ZERO = c$.prototype.ZERO =  new Array (0);\r
-});\r
+Clazz.declarePackage ("javax.swing.text");
+Clazz.load (["javax.swing.text.View"], "javax.swing.text.CompositeView", ["java.lang.IllegalArgumentException", "java.awt.Rectangle", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants", "$.Utilities"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.children = null;
+this.nchildren = 0;
+this.left = 0;
+this.right = 0;
+this.top = 0;
+this.bottom = 0;
+this.childAlloc = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.text, "CompositeView", javax.swing.text.View);
+Clazz.makeConstructor (c$, 
+function (elem) {
+Clazz.superConstructor (this, javax.swing.text.CompositeView, [elem]);
+this.children =  new Array (1);
+this.nchildren = 0;
+this.childAlloc =  new java.awt.Rectangle ();
+}, "javax.swing.text.Element");
+Clazz.defineMethod (c$, "loadChildren", 
+function (f) {
+if (f == null) {
+return;
+}var e = this.getElement ();
+var n = e.getElementCount ();
+if (n > 0) {
+var added =  new Array (n);
+for (var i = 0; i < n; i++) {
+added[i] = f.create (e.getElement (i));
+}
+this.replace (0, 0, added);
+}}, "javax.swing.text.ViewFactory");
+Clazz.defineMethod (c$, "setParent", 
+function (parent) {
+Clazz.superCall (this, javax.swing.text.CompositeView, "setParent", [parent]);
+if ((parent != null) && (this.nchildren == 0)) {
+var f = this.getViewFactory ();
+this.loadChildren (f);
+}}, "javax.swing.text.View");
+Clazz.overrideMethod (c$, "getViewCount", 
+function () {
+return this.nchildren;
+});
+Clazz.overrideMethod (c$, "getView", 
+function (n) {
+return this.children[n];
+}, "~N");
+Clazz.overrideMethod (c$, "replace", 
+function (offset, length, views) {
+if (views == null) {
+views = javax.swing.text.CompositeView.ZERO;
+}for (var i = offset; i < offset + length; i++) {
+if (this.children[i].getParent () === this) {
+this.children[i].setParent (null);
+}this.children[i] = null;
+}
+var delta = views.length - length;
+var src = offset + length;
+var nmove = this.nchildren - src;
+var dest = src + delta;
+if ((this.nchildren + delta) >= this.children.length) {
+var newLength = Math.max (2 * this.children.length, this.nchildren + delta);
+var newChildren =  new Array (newLength);
+System.arraycopy (this.children, 0, newChildren, 0, offset);
+System.arraycopy (views, 0, newChildren, offset, views.length);
+System.arraycopy (this.children, src, newChildren, dest, nmove);
+this.children = newChildren;
+} else {
+System.arraycopy (this.children, src, this.children, dest, nmove);
+System.arraycopy (views, 0, this.children, offset, views.length);
+}this.nchildren = this.nchildren + delta;
+for (var i = 0; i < views.length; i++) {
+views[i].setParent (this);
+}
+}, "~N,~N,~A");
+Clazz.overrideMethod (c$, "getChildAllocation", 
+function (index, a) {
+var alloc = this.getInsideAllocation (a);
+this.childAllocation (index, alloc);
+return alloc;
+}, "~N,java.awt.Shape");
+Clazz.defineMethod (c$, "modelToView", 
+function (pos, a, b) {
+var isBackward = (b === javax.swing.text.Position.Bias.Backward);
+var testPos = (isBackward) ? Math.max (0, pos - 1) : pos;
+if (isBackward && testPos < this.getStartOffset ()) {
+return null;
+}var vIndex = this.getViewIndexAtPosition (testPos);
+if ((vIndex != -1) && (vIndex < this.getViewCount ())) {
+var v = this.getView (vIndex);
+if (v != null && testPos >= v.getStartOffset () && testPos < v.getEndOffset ()) {
+var childShape = this.getChildAllocation (vIndex, a);
+if (childShape == null) {
+return null;
+}var retShape = v.modelToView (pos, childShape, b);
+if (retShape == null && v.getEndOffset () == pos) {
+if (++vIndex < this.getViewCount ()) {
+v = this.getView (vIndex);
+retShape = v.modelToView (pos, this.getChildAllocation (vIndex, a), b);
+}}return retShape;
+}}throw  new javax.swing.text.BadLocationException ("Position not represented by view", pos);
+}, "~N,java.awt.Shape,javax.swing.text.Position.Bias");
+Clazz.defineMethod (c$, "modelToView", 
+function (p0, b0, p1, b1, a) {
+if (p0 == this.getStartOffset () && p1 == this.getEndOffset ()) {
+return a;
+}var alloc = this.getInsideAllocation (a);
+var r0 =  new java.awt.Rectangle (alloc);
+var v0 = this.getViewAtPosition ((b0 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p0 - 1) : p0, r0);
+var r1 =  new java.awt.Rectangle (alloc);
+var v1 = this.getViewAtPosition ((b1 === javax.swing.text.Position.Bias.Backward) ? Math.max (0, p1 - 1) : p1, r1);
+if (v0 === v1) {
+if (v0 == null) {
+return a;
+}return v0.modelToView (p0, b0, p1, b1, r0);
+}var viewCount = this.getViewCount ();
+var counter = 0;
+while (counter < viewCount) {
+var v;
+if ((v = this.getView (counter)) === v0 || v === v1) {
+var endView;
+var retRect;
+var tempRect =  new java.awt.Rectangle ();
+if (v === v0) {
+retRect = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0).getBounds ();
+endView = v1;
+} else {
+retRect = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1).getBounds ();
+endView = v0;
+}while (++counter < viewCount && (v = this.getView (counter)) !== endView) {
+tempRect.setBounds (alloc);
+this.childAllocation (counter, tempRect);
+retRect.add (tempRect);
+}
+if (endView != null) {
+var endShape;
+if (endView === v1) {
+endShape = v1.modelToView (v1.getStartOffset (), javax.swing.text.Position.Bias.Forward, p1, b1, r1);
+} else {
+endShape = v0.modelToView (p0, b0, v0.getEndOffset (), javax.swing.text.Position.Bias.Backward, r0);
+}if (Clazz.instanceOf (endShape, java.awt.Rectangle)) {
+retRect.add (endShape);
+} else {
+retRect.add (endShape.getBounds ());
+}}return retRect;
+}counter++;
+}
+throw  new javax.swing.text.BadLocationException ("Position not represented by view", p0);
+}, "~N,javax.swing.text.Position.Bias,~N,javax.swing.text.Position.Bias,java.awt.Shape");
+Clazz.defineMethod (c$, "viewToModel", 
+function (x, y, a, bias) {
+var alloc = this.getInsideAllocation (a);
+if (this.isBefore (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc)) {
+var retValue = -1;
+try {
+retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 3, bias);
+} catch (e$$) {
+if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {
+var ble = e$$;
+{
+}
+} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {
+var iae = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+if (retValue == -1) {
+retValue = this.getStartOffset ();
+bias[0] = javax.swing.text.Position.Bias.Forward;
+}return retValue;
+} else if (this.isAfter (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc)) {
+var retValue = -1;
+try {
+retValue = this.getNextVisualPositionFrom (-1, javax.swing.text.Position.Bias.Forward, a, 7, bias);
+} catch (e$$) {
+if (Clazz.exceptionOf (e$$, javax.swing.text.BadLocationException)) {
+var ble = e$$;
+{
+}
+} else if (Clazz.exceptionOf (e$$, IllegalArgumentException)) {
+var iae = e$$;
+{
+}
+} else {
+throw e$$;
+}
+}
+if (retValue == -1) {
+retValue = this.getEndOffset () - 1;
+bias[0] = javax.swing.text.Position.Bias.Forward;
+}return retValue;
+} else {
+var v = this.getViewAtPoint (Clazz.floatToInt (x), Clazz.floatToInt (y), alloc);
+if (v != null) {
+return v.viewToModel (x, y, alloc, bias);
+}}return -1;
+}, "~N,~N,java.awt.Shape,~A");
+Clazz.overrideMethod (c$, "getNextVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+switch (direction) {
+case 1:
+return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
+case 5:
+return this.getNextNorthSouthVisualPositionFrom (pos, b, a, direction, biasRet);
+case 3:
+return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
+case 7:
+return this.getNextEastWestVisualPositionFrom (pos, b, a, direction, biasRet);
+default:
+throw  new IllegalArgumentException ("Bad direction: " + direction);
+}
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz.defineMethod (c$, "getViewIndex", 
+function (pos, b) {
+if (b === javax.swing.text.Position.Bias.Backward) {
+pos -= 1;
+}if ((pos >= this.getStartOffset ()) && (pos < this.getEndOffset ())) {
+return this.getViewIndexAtPosition (pos);
+}return -1;
+}, "~N,javax.swing.text.Position.Bias");
+Clazz.defineMethod (c$, "getViewAtPosition", 
+function (pos, a) {
+var index = this.getViewIndexAtPosition (pos);
+if ((index >= 0) && (index < this.getViewCount ())) {
+var v = this.getView (index);
+if (a != null) {
+this.childAllocation (index, a);
+}return v;
+}return null;
+}, "~N,java.awt.Rectangle");
+Clazz.defineMethod (c$, "getViewIndexAtPosition", 
+function (pos) {
+var elem = this.getElement ();
+return elem.getElementIndex (pos);
+}, "~N");
+Clazz.defineMethod (c$, "getInsideAllocation", 
+function (a) {
+if (a != null) {
+var alloc;
+if (Clazz.instanceOf (a, java.awt.Rectangle)) {
+alloc = a;
+} else {
+alloc = a.getBounds ();
+}this.childAlloc.setBounds (alloc);
+this.childAlloc.x += this.getLeftInset ();
+this.childAlloc.y += this.getTopInset ();
+this.childAlloc.width -= this.getLeftInset () + this.getRightInset ();
+this.childAlloc.height -= this.getTopInset () + this.getBottomInset ();
+return this.childAlloc;
+}return null;
+}, "java.awt.Shape");
+Clazz.defineMethod (c$, "setParagraphInsets", 
+function (attr) {
+this.top = Clazz.floatToShort (javax.swing.text.StyleConstants.getSpaceAbove (attr));
+this.left = Clazz.floatToShort (javax.swing.text.StyleConstants.getLeftIndent (attr));
+this.bottom = Clazz.floatToShort (javax.swing.text.StyleConstants.getSpaceBelow (attr));
+this.right = Clazz.floatToShort (javax.swing.text.StyleConstants.getRightIndent (attr));
+}, "javax.swing.text.AttributeSet");
+Clazz.defineMethod (c$, "setInsets", 
+function (top, left, bottom, right) {
+this.top = top;
+this.left = left;
+this.right = right;
+this.bottom = bottom;
+}, "~N,~N,~N,~N");
+Clazz.defineMethod (c$, "getLeftInset", 
+function () {
+return this.left;
+});
+Clazz.defineMethod (c$, "getRightInset", 
+function () {
+return this.right;
+});
+Clazz.defineMethod (c$, "getTopInset", 
+function () {
+return this.top;
+});
+Clazz.defineMethod (c$, "getBottomInset", 
+function () {
+return this.bottom;
+});
+Clazz.defineMethod (c$, "getNextNorthSouthVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz.defineMethod (c$, "getNextEastWestVisualPositionFrom", 
+function (pos, b, a, direction, biasRet) {
+return javax.swing.text.Utilities.getNextVisualPositionFrom (this, pos, b, a, direction, biasRet);
+}, "~N,javax.swing.text.Position.Bias,java.awt.Shape,~N,~A");
+Clazz.defineMethod (c$, "flipEastAndWestAtEnds", 
+function (position, bias) {
+return false;
+}, "~N,javax.swing.text.Position.Bias");
+c$.ZERO = c$.prototype.ZERO =  new Array (0);
+});