JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / geom / QuadIterator.js
1 Clazz.declarePackage ("java.awt.geom");\r
2 Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.QuadIterator", ["java.util.NoSuchElementException"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.quad = null;\r
5 this.affine = null;\r
6 this.index = 0;\r
7 Clazz.instantialize (this, arguments);\r
8 }, java.awt.geom, "QuadIterator", null, java.awt.geom.PathIterator);\r
9 Clazz.makeConstructor (c$, \r
10 function (q, at) {\r
11 this.quad = q;\r
12 this.affine = at;\r
13 }, "java.awt.geom.QuadCurve2D,java.awt.geom.AffineTransform");\r
14 Clazz.overrideMethod (c$, "getWindingRule", \r
15 function () {\r
16 return 1;\r
17 });\r
18 Clazz.overrideMethod (c$, "isDone", \r
19 function () {\r
20 return (this.index > 1);\r
21 });\r
22 Clazz.overrideMethod (c$, "next", \r
23 function () {\r
24 this.index++;\r
25 });\r
26 Clazz.defineMethod (c$, "currentSegment", \r
27 function (coords) {\r
28 if (this.isDone ()) {\r
29 throw  new java.util.NoSuchElementException ("quad iterator iterator out of bounds");\r
30 }var type;\r
31 if (this.index == 0) {\r
32 coords[0] = this.quad.getX1 ();\r
33 coords[1] = this.quad.getY1 ();\r
34 type = 0;\r
35 } else {\r
36 coords[0] = this.quad.getCtrlX ();\r
37 coords[1] = this.quad.getCtrlY ();\r
38 coords[2] = this.quad.getX2 ();\r
39 coords[3] = this.quad.getY2 ();\r
40 type = 2;\r
41 }if (this.affine != null) {\r
42 this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2);\r
43 }return type;\r
44 }, "~A");\r
45 Clazz.defineMethod (c$, "currentSegment", \r
46 function (coords) {\r
47 if (this.isDone ()) {\r
48 throw  new java.util.NoSuchElementException ("quad iterator iterator out of bounds");\r
49 }var type;\r
50 if (this.index == 0) {\r
51 coords[0] = this.quad.getX1 ();\r
52 coords[1] = this.quad.getY1 ();\r
53 type = 0;\r
54 } else {\r
55 coords[0] = this.quad.getCtrlX ();\r
56 coords[1] = this.quad.getCtrlY ();\r
57 coords[2] = this.quad.getX2 ();\r
58 coords[3] = this.quad.getY2 ();\r
59 type = 2;\r
60 }if (this.affine != null) {\r
61 this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2);\r
62 }return type;\r
63 }, "~A");\r
64 });\r