1 Clazz.declarePackage ("java.awt.geom");
2 Clazz.load (["java.awt.geom.PathIterator"], "java.awt.geom.RoundRectIterator", ["java.util.NoSuchElementException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
12 Clazz.instantialize (this, arguments);
13 }, java.awt.geom, "RoundRectIterator", null, java.awt.geom.PathIterator);
14 Clazz.makeConstructor (c$,
18 this.w = rr.getWidth ();
19 this.h = rr.getHeight ();
20 this.aw = Math.min (this.w, Math.abs (rr.getArcWidth ()));
21 this.ah = Math.min (this.h, Math.abs (rr.getArcHeight ()));
23 if (this.aw < 0 || this.ah < 0) {
24 this.index = java.awt.geom.RoundRectIterator.ctrlpts.length;
25 }}, "java.awt.geom.RoundRectangle2D,java.awt.geom.AffineTransform");
26 Clazz.overrideMethod (c$, "getWindingRule",
30 Clazz.overrideMethod (c$, "isDone",
32 return this.index >= java.awt.geom.RoundRectIterator.ctrlpts.length;
34 Clazz.overrideMethod (c$, "next",
38 Clazz.defineMethod (c$, "currentSegment",
41 throw new java.util.NoSuchElementException ("roundrect iterator out of bounds");
42 }var ctrls = java.awt.geom.RoundRectIterator.ctrlpts[this.index];
44 for (var i = 0; i < ctrls.length; i += 4) {
45 coords[nc++] = (this.x + ctrls[i + 0] * this.w + ctrls[i + 1] * this.aw);
46 coords[nc++] = (this.y + ctrls[i + 2] * this.h + ctrls[i + 3] * this.ah);
48 if (this.affine != null) {
49 this.affine.transform (coords, 0, coords, 0, Clazz.doubleToInt (nc / 2));
50 }return java.awt.geom.RoundRectIterator.types[this.index];
52 Clazz.defineMethod (c$, "currentSegment",
55 throw new java.util.NoSuchElementException ("roundrect iterator out of bounds");
56 }var ctrls = java.awt.geom.RoundRectIterator.ctrlpts[this.index];
58 for (var i = 0; i < ctrls.length; i += 4) {
59 coords[nc++] = (this.x + ctrls[i + 0] * this.w + ctrls[i + 1] * this.aw);
60 coords[nc++] = (this.y + ctrls[i + 2] * this.h + ctrls[i + 3] * this.ah);
62 if (this.affine != null) {
63 this.affine.transform (coords, 0, coords, 0, Clazz.doubleToInt (nc / 2));
64 }return java.awt.geom.RoundRectIterator.types[this.index];
66 Clazz.defineStatics (c$,
67 "angle", 0.7853981633974483);
68 c$.a = c$.prototype.a = 1.0 - Math.cos (0.7853981633974483);
69 c$.b = c$.prototype.b = Math.tan (0.7853981633974483);
70 c$.c = c$.prototype.c = Math.sqrt (1.0 + java.awt.geom.RoundRectIterator.b * java.awt.geom.RoundRectIterator.b) - 1 + java.awt.geom.RoundRectIterator.a;
71 c$.cv = c$.prototype.cv = 1.3333333333333333 * java.awt.geom.RoundRectIterator.a * java.awt.geom.RoundRectIterator.b / java.awt.geom.RoundRectIterator.c;
72 c$.acv = c$.prototype.acv = (1.0 - java.awt.geom.RoundRectIterator.cv) / 2.0;
73 c$.ctrlpts = c$.prototype.ctrlpts = Clazz.newArray (-1, [ Clazz.newDoubleArray (-1, [0.0, 0.0, 0.0, 0.5]), Clazz.newDoubleArray (-1, [0.0, 0.0, 1.0, -0.5]), Clazz.newDoubleArray (-1, [0.0, 0.0, 1.0, -java.awt.geom.RoundRectIterator.acv, 0.0, java.awt.geom.RoundRectIterator.acv, 1.0, 0.0, 0.0, 0.5, 1.0, 0.0]), Clazz.newDoubleArray (-1, [1.0, -0.5, 1.0, 0.0]), Clazz.newDoubleArray (-1, [1.0, -java.awt.geom.RoundRectIterator.acv, 1.0, 0.0, 1.0, 0.0, 1.0, -java.awt.geom.RoundRectIterator.acv, 1.0, 0.0, 1.0, -0.5]), Clazz.newDoubleArray (-1, [1.0, 0.0, 0.0, 0.5]), Clazz.newDoubleArray (-1, [1.0, 0.0, 0.0, java.awt.geom.RoundRectIterator.acv, 1.0, -java.awt.geom.RoundRectIterator.acv, 0.0, 0.0, 1.0, -0.5, 0.0, 0.0]), Clazz.newDoubleArray (-1, [0.0, 0.5, 0.0, 0.0]), Clazz.newDoubleArray (-1, [0.0, java.awt.geom.RoundRectIterator.acv, 0.0, 0.0, 0.0, 0.0, 0.0, java.awt.geom.RoundRectIterator.acv, 0.0, 0.0, 0.0, 0.5]), Clazz.newDoubleArray (-1, [])]);
74 Clazz.defineStatics (c$,
75 "types", Clazz.newIntArray (-1, [0, 1, 3, 1, 3, 1, 3, 1, 3, 4]));