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