X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjava%2Fawt%2Fgeom%2FRectIterator.js;fp=site%2Fswingjs%2Fj2s%2Fjava%2Fawt%2Fgeom%2FRectIterator.js;h=252ec846359f5dcb4b10d18248be1c7f411c81bd;hp=cf61dce4624c360683dfa972a7e6023ac998fecd;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/java/awt/geom/RectIterator.js b/site/swingjs/j2s/java/awt/geom/RectIterator.js index cf61dce..252ec84 100644 --- a/site/swingjs/j2s/java/awt/geom/RectIterator.js +++ b/site/swingjs/j2s/java/awt/geom/RectIterator.js @@ -1,66 +1,66 @@ -Clazz.declarePackage ("java.awt.geom"); -Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.RectIterator", ["java.util.NoSuchElementException"], function () { -c$ = Clazz.decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.w = 0; -this.h = 0; -this.affine = null; -this.index = 0; -Clazz.instantialize (this, arguments); -}, java.awt.geom, "RectIterator", null, java.awt.geom.PathIterator); -Clazz.makeConstructor (c$, -function (r, at) { -this.x = r.getX (); -this.y = r.getY (); -this.w = r.getWidth (); -this.h = r.getHeight (); -this.affine = at; -if (this.w < 0 || this.h < 0) { -this.index = 6; -}}, "java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform"); -Clazz.overrideMethod (c$, "getWindingRule", -function () { -return 1; -}); -Clazz.overrideMethod (c$, "isDone", -function () { -return this.index > 5; -}); -Clazz.overrideMethod (c$, "next", -function () { -this.index++; -}); -Clazz.defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("rect iterator out of bounds"); -}if (this.index == 5) { -return 4; -}coords[0] = this.x; -coords[1] = this.y; -if (this.index == 1 || this.index == 2) { -coords[0] += this.w; -}if (this.index == 2 || this.index == 3) { -coords[1] += this.h; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return (this.index == 0 ? 0 : 1); -}, "~A"); -Clazz.defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("rect iterator out of bounds"); -}if (this.index == 5) { -return 4; -}coords[0] = this.x; -coords[1] = this.y; -if (this.index == 1 || this.index == 2) { -coords[0] += this.w; -}if (this.index == 2 || this.index == 3) { -coords[1] += this.h; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return (this.index == 0 ? 0 : 1); -}, "~A"); -}); +Clazz.declarePackage ("java.awt.geom"); +Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.RectIterator", ["java.util.NoSuchElementException"], function () { +c$ = Clazz.decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.w = 0; +this.h = 0; +this.affine = null; +this.index = 0; +Clazz.instantialize (this, arguments); +}, java.awt.geom, "RectIterator", null, java.awt.geom.PathIterator); +Clazz.makeConstructor (c$, +function (r, at) { +this.x = r.getX (); +this.y = r.getY (); +this.w = r.getWidth (); +this.h = r.getHeight (); +this.affine = at; +if (this.w < 0 || this.h < 0) { +this.index = 6; +}}, "java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform"); +Clazz.overrideMethod (c$, "getWindingRule", +function () { +return 1; +}); +Clazz.overrideMethod (c$, "isDone", +function () { +return this.index > 5; +}); +Clazz.overrideMethod (c$, "next", +function () { +this.index++; +}); +Clazz.defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("rect iterator out of bounds"); +}if (this.index == 5) { +return 4; +}coords[0] = this.x; +coords[1] = this.y; +if (this.index == 1 || this.index == 2) { +coords[0] += this.w; +}if (this.index == 2 || this.index == 3) { +coords[1] += this.h; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return (this.index == 0 ? 0 : 1); +}, "~A"); +Clazz.defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("rect iterator out of bounds"); +}if (this.index == 5) { +return 4; +}coords[0] = this.x; +coords[1] = this.y; +if (this.index == 1 || this.index == 2) { +coords[0] += this.w; +}if (this.index == 2 || this.index == 3) { +coords[1] += this.h; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return (this.index == 0 ? 0 : 1); +}, "~A"); +});