Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / javax / swing / text / IconView.js
index ea8c1f2..ea7cc34 100644 (file)
@@ -1,59 +1,59 @@
-Clazz.declarePackage ("javax.swing.text");\r
-Clazz.load (["javax.swing.text.View"], "javax.swing.text.IconView", ["java.lang.IllegalArgumentException", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.c = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javax.swing.text, "IconView", javax.swing.text.View);\r
-Clazz.makeConstructor (c$, \r
-function (elem) {\r
-Clazz.superConstructor (this, javax.swing.text.IconView, [elem]);\r
-var attr = elem.getAttributes ();\r
-this.c = javax.swing.text.StyleConstants.getIcon (attr);\r
-}, "javax.swing.text.Element");\r
-Clazz.overrideMethod (c$, "paint", \r
-function (g, a) {\r
-var alloc = a.getBounds ();\r
-this.c.paintIcon (this.getContainer (), g, alloc.x, alloc.y);\r
-}, "java.awt.Graphics,java.awt.Shape");\r
-Clazz.overrideMethod (c$, "getPreferredSpan", \r
-function (axis) {\r
-switch (axis) {\r
-case 0:\r
-return this.c.getIconWidth ();\r
-case 1:\r
-return this.c.getIconHeight ();\r
-default:\r
-throw  new IllegalArgumentException ("Invalid axis: " + axis);\r
-}\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getAlignment", \r
-function (axis) {\r
-switch (axis) {\r
-case 1:\r
-return 1;\r
-default:\r
-return Clazz.superCall (this, javax.swing.text.IconView, "getAlignment", [axis]);\r
-}\r
-}, "~N");\r
-Clazz.defineMethod (c$, "modelToView", \r
-function (pos, a, b) {\r
-var p0 = this.getStartOffset ();\r
-var p1 = this.getEndOffset ();\r
-if ((pos >= p0) && (pos <= p1)) {\r
-var r = a.getBounds ();\r
-if (pos == p1) {\r
-r.x += r.width;\r
-}r.width = 0;\r
-return r;\r
-}throw  new javax.swing.text.BadLocationException (pos + " not in range " + p0 + "," + p1, pos);\r
-}, "~N,java.awt.Shape,javax.swing.text.Position.Bias");\r
-Clazz.defineMethod (c$, "viewToModel", \r
-function (x, y, a, bias) {\r
-var alloc = a;\r
-if (x < alloc.x + (Clazz.doubleToInt (alloc.width / 2))) {\r
-bias[0] = javax.swing.text.Position.Bias.Forward;\r
-return this.getStartOffset ();\r
-}bias[0] = javax.swing.text.Position.Bias.Backward;\r
-return this.getEndOffset ();\r
-}, "~N,~N,java.awt.Shape,~A");\r
-});\r
+Clazz.declarePackage ("javax.swing.text");
+Clazz.load (["javax.swing.text.View"], "javax.swing.text.IconView", ["java.lang.IllegalArgumentException", "javax.swing.text.BadLocationException", "$.Position", "$.StyleConstants"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.c = null;
+Clazz.instantialize (this, arguments);
+}, javax.swing.text, "IconView", javax.swing.text.View);
+Clazz.makeConstructor (c$, 
+function (elem) {
+Clazz.superConstructor (this, javax.swing.text.IconView, [elem]);
+var attr = elem.getAttributes ();
+this.c = javax.swing.text.StyleConstants.getIcon (attr);
+}, "javax.swing.text.Element");
+Clazz.overrideMethod (c$, "paint", 
+function (g, a) {
+var alloc = a.getBounds ();
+this.c.paintIcon (this.getContainer (), g, alloc.x, alloc.y);
+}, "java.awt.Graphics,java.awt.Shape");
+Clazz.overrideMethod (c$, "getPreferredSpan", 
+function (axis) {
+switch (axis) {
+case 0:
+return this.c.getIconWidth ();
+case 1:
+return this.c.getIconHeight ();
+default:
+throw  new IllegalArgumentException ("Invalid axis: " + axis);
+}
+}, "~N");
+Clazz.defineMethod (c$, "getAlignment", 
+function (axis) {
+switch (axis) {
+case 1:
+return 1;
+default:
+return Clazz.superCall (this, javax.swing.text.IconView, "getAlignment", [axis]);
+}
+}, "~N");
+Clazz.defineMethod (c$, "modelToView", 
+function (pos, a, b) {
+var p0 = this.getStartOffset ();
+var p1 = this.getEndOffset ();
+if ((pos >= p0) && (pos <= p1)) {
+var r = a.getBounds ();
+if (pos == p1) {
+r.x += r.width;
+}r.width = 0;
+return r;
+}throw  new javax.swing.text.BadLocationException (pos + " not in range " + p0 + "," + p1, pos);
+}, "~N,java.awt.Shape,javax.swing.text.Position.Bias");
+Clazz.defineMethod (c$, "viewToModel", 
+function (x, y, a, bias) {
+var alloc = a;
+if (x < alloc.x + (Clazz.doubleToInt (alloc.width / 2))) {
+bias[0] = javax.swing.text.Position.Bias.Forward;
+return this.getStartOffset ();
+}bias[0] = javax.swing.text.Position.Bias.Backward;
+return this.getEndOffset ();
+}, "~N,~N,java.awt.Shape,~A");
+});