Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / geom / FlatteningPathIterator.js
index e57d41d..657956e 100644 (file)
-Clazz.declarePackage ("java.awt.geom");\r
-Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.FlatteningPathIterator", ["java.lang.IllegalArgumentException", "java.util.NoSuchElementException", "java.awt.geom.CubicCurve2D", "$.QuadCurve2D"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.src = null;\r
-this.squareflat = 0;\r
-this.limit = 0;\r
-this.hold = null;\r
-this.curx = 0;\r
-this.cury = 0;\r
-this.movx = 0;\r
-this.movy = 0;\r
-this.holdType = 0;\r
-this.holdEnd = 0;\r
-this.holdIndex = 0;\r
-this.levels = null;\r
-this.levelIndex = 0;\r
-this.done = false;\r
-Clazz.instantialize (this, arguments);\r
-}, java.awt.geom, "FlatteningPathIterator", null, java.awt.geom.PathIterator);\r
-Clazz.prepareFields (c$, function () {\r
-this.hold =  Clazz.newDoubleArray (14, 0);\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (src, flatness) {\r
-this.construct (src, flatness, 10);\r
-}, "java.awt.geom.PathIterator,~N");\r
-Clazz.makeConstructor (c$, \r
-function (src, flatness, limit) {\r
-if (flatness < 0.0) {\r
-throw  new IllegalArgumentException ("flatness must be >= 0");\r
-}if (limit < 0) {\r
-throw  new IllegalArgumentException ("limit must be >= 0");\r
-}this.src = src;\r
-this.squareflat = flatness * flatness;\r
-this.limit = limit;\r
-this.levels =  Clazz.newIntArray (limit + 1, 0);\r
-this.next (false);\r
-}, "java.awt.geom.PathIterator,~N,~N");\r
-Clazz.defineMethod (c$, "getFlatness", \r
-function () {\r
-return Math.sqrt (this.squareflat);\r
-});\r
-Clazz.defineMethod (c$, "getRecursionLimit", \r
-function () {\r
-return this.limit;\r
-});\r
-Clazz.defineMethod (c$, "getWindingRule", \r
-function () {\r
-return this.src.getWindingRule ();\r
-});\r
-Clazz.defineMethod (c$, "isDone", \r
-function () {\r
-return this.done;\r
-});\r
-Clazz.defineMethod (c$, "ensureHoldCapacity", \r
-function (want) {\r
-if (this.holdIndex - want < 0) {\r
-var have = this.hold.length - this.holdIndex;\r
-var newsize = this.hold.length + 24;\r
-var newhold =  Clazz.newDoubleArray (newsize, 0);\r
-System.arraycopy (this.hold, this.holdIndex, newhold, this.holdIndex + 24, have);\r
-this.hold = newhold;\r
-this.holdIndex += 24;\r
-this.holdEnd += 24;\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "next", \r
-function () {\r
-this.next (true);\r
-});\r
-Clazz.defineMethod (c$, "next", \r
- function (doNext) {\r
-var level;\r
-if (this.holdIndex >= this.holdEnd) {\r
-if (doNext) {\r
-this.src.next ();\r
-}if (this.src.isDone ()) {\r
-this.done = true;\r
-return;\r
-}this.holdType = this.src.currentSegment (this.hold);\r
-this.levelIndex = 0;\r
-this.levels[0] = 0;\r
-}switch (this.holdType) {\r
-case 0:\r
-case 1:\r
-this.curx = this.hold[0];\r
-this.cury = this.hold[1];\r
-if (this.holdType == 0) {\r
-this.movx = this.curx;\r
-this.movy = this.cury;\r
-}this.holdIndex = 0;\r
-this.holdEnd = 0;\r
-break;\r
-case 4:\r
-this.curx = this.movx;\r
-this.cury = this.movy;\r
-this.holdIndex = 0;\r
-this.holdEnd = 0;\r
-break;\r
-case 2:\r
-if (this.holdIndex >= this.holdEnd) {\r
-this.holdIndex = this.hold.length - 6;\r
-this.holdEnd = this.hold.length - 2;\r
-this.hold[this.holdIndex + 0] = this.curx;\r
-this.hold[this.holdIndex + 1] = this.cury;\r
-this.hold[this.holdIndex + 2] = this.hold[0];\r
-this.hold[this.holdIndex + 3] = this.hold[1];\r
-this.hold[this.holdIndex + 4] = this.curx = this.hold[2];\r
-this.hold[this.holdIndex + 5] = this.cury = this.hold[3];\r
-}level = this.levels[this.levelIndex];\r
-while (level < this.limit) {\r
-if (java.awt.geom.QuadCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) {\r
-break;\r
-}this.ensureHoldCapacity (4);\r
-java.awt.geom.QuadCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 4, this.hold, this.holdIndex);\r
-this.holdIndex -= 4;\r
-level++;\r
-this.levels[this.levelIndex] = level;\r
-this.levelIndex++;\r
-this.levels[this.levelIndex] = level;\r
-}\r
-this.holdIndex += 4;\r
-this.levelIndex--;\r
-break;\r
-case 3:\r
-if (this.holdIndex >= this.holdEnd) {\r
-this.holdIndex = this.hold.length - 8;\r
-this.holdEnd = this.hold.length - 2;\r
-this.hold[this.holdIndex + 0] = this.curx;\r
-this.hold[this.holdIndex + 1] = this.cury;\r
-this.hold[this.holdIndex + 2] = this.hold[0];\r
-this.hold[this.holdIndex + 3] = this.hold[1];\r
-this.hold[this.holdIndex + 4] = this.hold[2];\r
-this.hold[this.holdIndex + 5] = this.hold[3];\r
-this.hold[this.holdIndex + 6] = this.curx = this.hold[4];\r
-this.hold[this.holdIndex + 7] = this.cury = this.hold[5];\r
-}level = this.levels[this.levelIndex];\r
-while (level < this.limit) {\r
-if (java.awt.geom.CubicCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) {\r
-break;\r
-}this.ensureHoldCapacity (6);\r
-java.awt.geom.CubicCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 6, this.hold, this.holdIndex);\r
-this.holdIndex -= 6;\r
-level++;\r
-this.levels[this.levelIndex] = level;\r
-this.levelIndex++;\r
-this.levels[this.levelIndex] = level;\r
-}\r
-this.holdIndex += 6;\r
-this.levelIndex--;\r
-break;\r
-}\r
-}, "~B");\r
-Clazz.defineMethod (c$, "currentSegment", \r
-function (coords) {\r
-if (this.isDone ()) {\r
-throw  new java.util.NoSuchElementException ("flattening iterator out of bounds");\r
-}var type = this.holdType;\r
-if (type != 4) {\r
-coords[0] = this.hold[this.holdIndex + 0];\r
-coords[1] = this.hold[this.holdIndex + 1];\r
-if (type != 0) {\r
-type = 1;\r
-}}return type;\r
-}, "~A");\r
-Clazz.defineMethod (c$, "currentSegment", \r
-function (coords) {\r
-if (this.isDone ()) {\r
-throw  new java.util.NoSuchElementException ("flattening iterator out of bounds");\r
-}var type = this.holdType;\r
-if (type != 4) {\r
-coords[0] = this.hold[this.holdIndex + 0];\r
-coords[1] = this.hold[this.holdIndex + 1];\r
-if (type != 0) {\r
-type = 1;\r
-}}return type;\r
-}, "~A");\r
-Clazz.defineStatics (c$,\r
-"GROW_SIZE", 24);\r
-});\r
+Clazz.declarePackage ("java.awt.geom");
+Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.FlatteningPathIterator", ["java.lang.IllegalArgumentException", "java.util.NoSuchElementException", "java.awt.geom.CubicCurve2D", "$.QuadCurve2D"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.src = null;
+this.squareflat = 0;
+this.limit = 0;
+this.hold = null;
+this.curx = 0;
+this.cury = 0;
+this.movx = 0;
+this.movy = 0;
+this.holdType = 0;
+this.holdEnd = 0;
+this.holdIndex = 0;
+this.levels = null;
+this.levelIndex = 0;
+this.done = false;
+Clazz.instantialize (this, arguments);
+}, java.awt.geom, "FlatteningPathIterator", null, java.awt.geom.PathIterator);
+Clazz.prepareFields (c$, function () {
+this.hold =  Clazz.newDoubleArray (14, 0);
+});
+Clazz.makeConstructor (c$, 
+function (src, flatness) {
+this.construct (src, flatness, 10);
+}, "java.awt.geom.PathIterator,~N");
+Clazz.makeConstructor (c$, 
+function (src, flatness, limit) {
+if (flatness < 0.0) {
+throw  new IllegalArgumentException ("flatness must be >= 0");
+}if (limit < 0) {
+throw  new IllegalArgumentException ("limit must be >= 0");
+}this.src = src;
+this.squareflat = flatness * flatness;
+this.limit = limit;
+this.levels =  Clazz.newIntArray (limit + 1, 0);
+this.next (false);
+}, "java.awt.geom.PathIterator,~N,~N");
+Clazz.defineMethod (c$, "getFlatness", 
+function () {
+return Math.sqrt (this.squareflat);
+});
+Clazz.defineMethod (c$, "getRecursionLimit", 
+function () {
+return this.limit;
+});
+Clazz.defineMethod (c$, "getWindingRule", 
+function () {
+return this.src.getWindingRule ();
+});
+Clazz.defineMethod (c$, "isDone", 
+function () {
+return this.done;
+});
+Clazz.defineMethod (c$, "ensureHoldCapacity", 
+function (want) {
+if (this.holdIndex - want < 0) {
+var have = this.hold.length - this.holdIndex;
+var newsize = this.hold.length + 24;
+var newhold =  Clazz.newDoubleArray (newsize, 0);
+System.arraycopy (this.hold, this.holdIndex, newhold, this.holdIndex + 24, have);
+this.hold = newhold;
+this.holdIndex += 24;
+this.holdEnd += 24;
+}}, "~N");
+Clazz.defineMethod (c$, "next", 
+function () {
+this.next (true);
+});
+Clazz.defineMethod (c$, "next", 
+ function (doNext) {
+var level;
+if (this.holdIndex >= this.holdEnd) {
+if (doNext) {
+this.src.next ();
+}if (this.src.isDone ()) {
+this.done = true;
+return;
+}this.holdType = this.src.currentSegment (this.hold);
+this.levelIndex = 0;
+this.levels[0] = 0;
+}switch (this.holdType) {
+case 0:
+case 1:
+this.curx = this.hold[0];
+this.cury = this.hold[1];
+if (this.holdType == 0) {
+this.movx = this.curx;
+this.movy = this.cury;
+}this.holdIndex = 0;
+this.holdEnd = 0;
+break;
+case 4:
+this.curx = this.movx;
+this.cury = this.movy;
+this.holdIndex = 0;
+this.holdEnd = 0;
+break;
+case 2:
+if (this.holdIndex >= this.holdEnd) {
+this.holdIndex = this.hold.length - 6;
+this.holdEnd = this.hold.length - 2;
+this.hold[this.holdIndex + 0] = this.curx;
+this.hold[this.holdIndex + 1] = this.cury;
+this.hold[this.holdIndex + 2] = this.hold[0];
+this.hold[this.holdIndex + 3] = this.hold[1];
+this.hold[this.holdIndex + 4] = this.curx = this.hold[2];
+this.hold[this.holdIndex + 5] = this.cury = this.hold[3];
+}level = this.levels[this.levelIndex];
+while (level < this.limit) {
+if (java.awt.geom.QuadCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) {
+break;
+}this.ensureHoldCapacity (4);
+java.awt.geom.QuadCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 4, this.hold, this.holdIndex);
+this.holdIndex -= 4;
+level++;
+this.levels[this.levelIndex] = level;
+this.levelIndex++;
+this.levels[this.levelIndex] = level;
+}
+this.holdIndex += 4;
+this.levelIndex--;
+break;
+case 3:
+if (this.holdIndex >= this.holdEnd) {
+this.holdIndex = this.hold.length - 8;
+this.holdEnd = this.hold.length - 2;
+this.hold[this.holdIndex + 0] = this.curx;
+this.hold[this.holdIndex + 1] = this.cury;
+this.hold[this.holdIndex + 2] = this.hold[0];
+this.hold[this.holdIndex + 3] = this.hold[1];
+this.hold[this.holdIndex + 4] = this.hold[2];
+this.hold[this.holdIndex + 5] = this.hold[3];
+this.hold[this.holdIndex + 6] = this.curx = this.hold[4];
+this.hold[this.holdIndex + 7] = this.cury = this.hold[5];
+}level = this.levels[this.levelIndex];
+while (level < this.limit) {
+if (java.awt.geom.CubicCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) {
+break;
+}this.ensureHoldCapacity (6);
+java.awt.geom.CubicCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 6, this.hold, this.holdIndex);
+this.holdIndex -= 6;
+level++;
+this.levels[this.levelIndex] = level;
+this.levelIndex++;
+this.levels[this.levelIndex] = level;
+}
+this.holdIndex += 6;
+this.levelIndex--;
+break;
+}
+}, "~B");
+Clazz.defineMethod (c$, "currentSegment", 
+function (coords) {
+if (this.isDone ()) {
+throw  new java.util.NoSuchElementException ("flattening iterator out of bounds");
+}var type = this.holdType;
+if (type != 4) {
+coords[0] = this.hold[this.holdIndex + 0];
+coords[1] = this.hold[this.holdIndex + 1];
+if (type != 0) {
+type = 1;
+}}return type;
+}, "~A");
+Clazz.defineMethod (c$, "currentSegment", 
+function (coords) {
+if (this.isDone ()) {
+throw  new java.util.NoSuchElementException ("flattening iterator out of bounds");
+}var type = this.holdType;
+if (type != 4) {
+coords[0] = this.hold[this.holdIndex + 0];
+coords[1] = this.hold[this.holdIndex + 1];
+if (type != 0) {
+type = 1;
+}}return type;
+}, "~A");
+Clazz.defineStatics (c$,
+"GROW_SIZE", 24);
+});