1 Clazz.declarePackage ("java.awt.geom");
2 Clazz.load (null, "java.awt.geom.AffineTransform", ["java.lang.Double", "$.InternalError", "JU.AU", "java.awt.geom.NoninvertibleTransformException", "$.Path2D", "$.Point2D", "java.awt.geom.Point2D.Double"], function () {
3 c$ = Clazz.decorateAsClass (function () {
12 Clazz.instantialize (this, arguments);
13 }, java.awt.geom, "AffineTransform", null, [Cloneable, java.io.Serializable]);
14 Clazz.makeConstructor (c$,
15 function (m00, m10, m01, m11, m02, m12, state) {
17 switch (arguments.length) { case 0: this.m00 = this.m11 = 1.0;
20 if (Clazz.instanceOf(m00, java.awt.geom.AffineTransform)) {
21 var Tx = m00; this.m00 =
22 Tx.m00; this.m10 = Tx.m10; this.m01 = Tx.m01; this.m11 =
23 Tx.m11; this.m02 = Tx.m02; this.m12 = Tx.m12; this.state =
24 Tx.state; this.type = Tx.type;
27 this.m00 = flatmatrix[0];
28 this.m10 = flatmatrix[1];
29 this.m01 = flatmatrix[2];
30 this.m11 = flatmatrix[3];
31 if (flatmatrix.length > 5) {
32 this.m02 = flatmatrix[4];
33 this.m12 = flatmatrix[5];
56 }, "~N,~N,~N,~N,~N,~N,~N");
57 c$.getTranslateInstance = Clazz.defineMethod (c$, "getTranslateInstance",
59 var Tx = new java.awt.geom.AffineTransform ();
60 Tx.setToTranslation (tx, ty);
63 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance",
65 var Tx = new java.awt.geom.AffineTransform ();
66 Tx.setToRotation (theta);
69 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance",
70 function (theta, anchorx, anchory) {
71 var Tx = new java.awt.geom.AffineTransform ();
72 Tx.setToRotation (theta, anchorx, anchory);
75 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance",
76 function (vecx, vecy) {
77 var Tx = new java.awt.geom.AffineTransform ();
78 Tx.setToRotation (vecx, vecy);
81 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance",
82 function (vecx, vecy, anchorx, anchory) {
83 var Tx = new java.awt.geom.AffineTransform ();
84 Tx.setToRotation (vecx, vecy, anchorx, anchory);
87 c$.getQuadrantRotateInstance = Clazz.defineMethod (c$, "getQuadrantRotateInstance",
88 function (numquadrants) {
89 var Tx = new java.awt.geom.AffineTransform ();
90 Tx.setToQuadrantRotation (numquadrants);
93 c$.getQuadrantRotateInstance = Clazz.defineMethod (c$, "getQuadrantRotateInstance",
94 function (numquadrants, anchorx, anchory) {
95 var Tx = new java.awt.geom.AffineTransform ();
96 Tx.setToQuadrantRotation (numquadrants, anchorx, anchory);
99 c$.getScaleInstance = Clazz.defineMethod (c$, "getScaleInstance",
101 var Tx = new java.awt.geom.AffineTransform ();
102 Tx.setToScale (sx, sy);
105 c$.getShearInstance = Clazz.defineMethod (c$, "getShearInstance",
106 function (shx, shy) {
107 var Tx = new java.awt.geom.AffineTransform ();
108 Tx.setToShear (shx, shy);
111 Clazz.defineMethod (c$, "getType",
113 if (this.type == -1) {
114 this.calculateType ();
117 Clazz.defineMethod (c$, "calculateType",
127 switch (this.state) {
133 if ((M0 = this.m00) * (M2 = this.m01) + (M3 = this.m10) * (M1 = this.m11) != 0) {
139 if (M0 != M1 || M2 != -M3) {
141 } else if (M0 * M1 - M2 * M3 != 1.0) {
146 if (M0 != -M1 || M2 != M3) {
148 } else if (M0 * M1 - M2 * M3 != 1.0) {
156 sgn0 = ((M0 = this.m01) >= 0.0);
157 sgn1 = ((M1 = this.m10) >= 0.0);
161 } else if (M0 != 1.0 && M0 != -1.0) {
174 sgn0 = ((M0 = this.m00) >= 0.0);
175 sgn1 = ((M1 = this.m11) >= 0.0);
185 } else if (M0 != -1.0) {
191 if (M0 == 1.0 || M0 == -1.0) {
206 Clazz.defineMethod (c$, "getDeterminant",
208 switch (this.state) {
213 return this.m00 * this.m11 - this.m01 * this.m10;
216 return -(this.m01 * this.m10);
219 return this.m00 * this.m11;
225 Clazz.defineMethod (c$, "updateState",
227 if (this.m01 == 0.0 && this.m10 == 0.0) {
228 if (this.m00 == 1.0 && this.m11 == 1.0) {
229 if (this.m02 == 0.0 && this.m12 == 0.0) {
236 if (this.m02 == 0.0 && this.m12 == 0.0) {
243 if (this.m00 == 0.0 && this.m11 == 0.0) {
244 if (this.m02 == 0.0 && this.m12 == 0.0) {
251 if (this.m02 == 0.0 && this.m12 == 0.0) {
258 Clazz.defineMethod (c$, "stateError",
260 throw new InternalError ("missing case in transform state switch");
262 Clazz.defineMethod (c$, "getMatrix",
263 function (flatmatrix) {
264 flatmatrix[0] = this.m00;
265 flatmatrix[1] = this.m10;
266 flatmatrix[2] = this.m01;
267 flatmatrix[3] = this.m11;
268 if (flatmatrix.length > 5) {
269 flatmatrix[4] = this.m02;
270 flatmatrix[5] = this.m12;
272 Clazz.defineMethod (c$, "getScaleX",
276 Clazz.defineMethod (c$, "getScaleY",
280 Clazz.defineMethod (c$, "getShearX",
284 Clazz.defineMethod (c$, "getShearY",
288 Clazz.defineMethod (c$, "getTranslateX",
292 Clazz.defineMethod (c$, "getTranslateY",
296 Clazz.defineMethod (c$, "translate",
298 switch (this.state) {
302 this.m02 = tx * this.m00 + ty * this.m01 + this.m02;
303 this.m12 = tx * this.m10 + ty * this.m11 + this.m12;
304 if (this.m02 == 0.0 && this.m12 == 0.0) {
306 if (this.type != -1) {
310 this.m02 = tx * this.m00 + ty * this.m01;
311 this.m12 = tx * this.m10 + ty * this.m11;
312 if (this.m02 != 0.0 || this.m12 != 0.0) {
317 this.m02 = ty * this.m01 + this.m02;
318 this.m12 = tx * this.m10 + this.m12;
319 if (this.m02 == 0.0 && this.m12 == 0.0) {
321 if (this.type != -1) {
325 this.m02 = ty * this.m01;
326 this.m12 = tx * this.m10;
327 if (this.m02 != 0.0 || this.m12 != 0.0) {
332 this.m02 = tx * this.m00 + this.m02;
333 this.m12 = ty * this.m11 + this.m12;
334 if (this.m02 == 0.0 && this.m12 == 0.0) {
336 if (this.type != -1) {
340 this.m02 = tx * this.m00;
341 this.m12 = ty * this.m11;
342 if (this.m02 != 0.0 || this.m12 != 0.0) {
347 this.m02 = tx + this.m02;
348 this.m12 = ty + this.m12;
349 if (this.m02 == 0.0 && this.m12 == 0.0) {
356 if (tx != 0.0 || ty != 0.0) {
362 Clazz.defineMethod (c$, "rotate90",
370 var state = java.awt.geom.AffineTransform.rot90conversion[this.state];
371 if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) {
376 Clazz.defineMethod (c$, "rotate180",
378 this.m00 = -this.m00;
379 this.m11 = -this.m11;
380 var state = this.state;
381 if ((state & (4)) != 0) {
382 this.m01 = -this.m01;
383 this.m10 = -this.m10;
385 if (this.m00 == 1.0 && this.m11 == 1.0) {
386 this.state = state & -3;
388 this.state = state | 2;
391 Clazz.defineMethod (c$, "rotate270",
394 this.m00 = -this.m01;
397 this.m10 = -this.m11;
399 var state = java.awt.geom.AffineTransform.rot90conversion[this.state];
400 if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) {
405 Clazz.defineMethod (c$, "rotate",
407 var sin = Math.sin (theta);
410 } else if (sin == -1.0) {
413 var cos = Math.cos (theta);
416 } else if (cos != 1.0) {
421 this.m00 = cos * M0 + sin * M1;
422 this.m01 = -sin * M0 + cos * M1;
425 this.m10 = cos * M0 + sin * M1;
426 this.m11 = -sin * M0 + cos * M1;
429 Clazz.defineMethod (c$, "rotate",
430 function (theta, anchorx, anchory) {
431 this.translate (anchorx, anchory);
433 this.translate (-anchorx, -anchory);
435 Clazz.defineMethod (c$, "rotate",
436 function (vecx, vecy) {
440 }} else if (vecx == 0.0) {
446 var len = Math.sqrt (vecx * vecx + vecy * vecy);
447 var sin = vecy / len;
448 var cos = vecx / len;
453 this.m00 = cos * M0 + sin * M1;
454 this.m01 = -sin * M0 + cos * M1;
457 this.m10 = cos * M0 + sin * M1;
458 this.m11 = -sin * M0 + cos * M1;
461 Clazz.defineMethod (c$, "rotate",
462 function (vecx, vecy, anchorx, anchory) {
463 this.translate (anchorx, anchory);
464 this.rotate (vecx, vecy);
465 this.translate (-anchorx, -anchory);
467 Clazz.defineMethod (c$, "quadrantRotate",
468 function (numquadrants) {
469 switch (numquadrants & 3) {
483 Clazz.defineMethod (c$, "quadrantRotate",
484 function (numquadrants, anchorx, anchory) {
485 switch (numquadrants & 3) {
489 this.m02 += anchorx * (this.m00 - this.m01) + anchory * (this.m01 + this.m00);
490 this.m12 += anchorx * (this.m10 - this.m11) + anchory * (this.m11 + this.m10);
494 this.m02 += anchorx * (this.m00 + this.m00) + anchory * (this.m01 + this.m01);
495 this.m12 += anchorx * (this.m10 + this.m10) + anchory * (this.m11 + this.m11);
499 this.m02 += anchorx * (this.m00 + this.m01) + anchory * (this.m01 - this.m00);
500 this.m12 += anchorx * (this.m10 + this.m11) + anchory * (this.m11 - this.m10);
504 if (this.m02 == 0.0 && this.m12 == 0.0) {
509 Clazz.defineMethod (c$, "scale",
511 var state = this.state;
523 if (this.m01 == 0 && this.m10 == 0) {
525 if (this.m00 == 1.0 && this.m11 == 1.0) {
526 this.type = (state == 0 ? 0 : 1);
536 if (this.m00 == 1.0 && this.m11 == 1.0) {
537 this.state = (state &= 1);
538 this.type = (state == 0 ? 0 : 1);
546 if (sx != 1.0 || sy != 1.0) {
547 this.state = state | 2;
552 Clazz.defineMethod (c$, "shear",
553 function (shx, shy) {
554 var state = this.state;
564 this.m00 = M0 + M1 * shy;
565 this.m01 = M0 * shx + M1;
568 this.m10 = M0 + M1 * shy;
569 this.m11 = M0 * shx + M1;
574 this.m00 = this.m01 * shy;
575 this.m11 = this.m10 * shx;
576 if (this.m00 != 0.0 || this.m11 != 0.0) {
577 this.state = state | 2;
582 this.m01 = this.m00 * shx;
583 this.m10 = this.m11 * shy;
584 if (this.m01 != 0.0 || this.m10 != 0.0) {
585 this.state = state | 4;
592 if (this.m01 != 0.0 || this.m10 != 0.0) {
593 this.state = state | 2 | 4;
598 Clazz.defineMethod (c$, "setToIdentity",
600 this.m00 = this.m11 = 1.0;
601 this.m10 = this.m01 = this.m02 = this.m12 = 0.0;
605 Clazz.defineMethod (c$, "setToTranslation",
613 if (tx != 0.0 || ty != 0.0) {
620 Clazz.defineMethod (c$, "setToRotation",
622 var sin = Math.sin (theta);
624 if (sin == 1.0 || sin == -1.0) {
629 cos = Math.cos (theta);
634 } else if (cos == 1.0) {
648 Clazz.defineMethod (c$, "setToRotation",
649 function (theta, anchorx, anchory) {
650 this.setToRotation (theta);
652 var oneMinusCos = 1.0 - this.m00;
653 this.m02 = anchorx * oneMinusCos + anchory * sin;
654 this.m12 = anchory * oneMinusCos - anchorx * sin;
655 if (this.m02 != 0.0 || this.m12 != 0.0) {
659 Clazz.defineMethod (c$, "setToRotation",
660 function (vecx, vecy) {
673 }} else if (vecx == 0) {
675 sin = (vecy > 0.0) ? 1.0 : -1.0;
679 var len = Math.sqrt (vecx * vecx + vecy * vecy);
691 Clazz.defineMethod (c$, "setToRotation",
692 function (vecx, vecy, anchorx, anchory) {
693 this.setToRotation (vecx, vecy);
695 var oneMinusCos = 1.0 - this.m00;
696 this.m02 = anchorx * oneMinusCos + anchory * sin;
697 this.m12 = anchory * oneMinusCos - anchorx * sin;
698 if (this.m02 != 0.0 || this.m12 != 0.0) {
702 Clazz.defineMethod (c$, "setToQuadrantRotation",
703 function (numquadrants) {
704 switch (numquadrants & 3) {
747 Clazz.defineMethod (c$, "setToQuadrantRotation",
748 function (numquadrants, anchorx, anchory) {
749 switch (numquadrants & 3) {
765 this.m02 = anchorx + anchory;
766 this.m12 = anchory - anchorx;
767 if (this.m02 == 0.0 && this.m12 == 0.0) {
779 this.m02 = anchorx + anchorx;
780 this.m12 = anchory + anchory;
781 if (this.m02 == 0.0 && this.m12 == 0.0) {
793 this.m02 = anchorx - anchory;
794 this.m12 = anchory + anchorx;
795 if (this.m02 == 0.0 && this.m12 == 0.0) {
804 Clazz.defineMethod (c$, "setToScale",
812 if (sx != 1.0 || sy != 1.0) {
819 Clazz.defineMethod (c$, "setToShear",
820 function (shx, shy) {
827 if (shx != 0.0 || shy != 0.0) {
834 Clazz.defineMethod (c$, "setTransform",
842 this.state = Tx.state;
844 }, "java.awt.geom.AffineTransform");
845 Clazz.defineMethod (c$, "setTransform",
846 function (m00, m10, m01, m11, m02, m12) {
854 }, "~N,~N,~N,~N,~N,~N");
855 Clazz.defineMethod (c$, "concatenate",
865 var mystate = this.state;
866 var txstate = Tx.state;
867 switch ((txstate << 3) | mystate) {
886 this.state = txstate;
895 this.state = txstate;
904 this.m00 = this.m11 = 0.0;
905 this.state = txstate;
915 this.translate (Tx.m02, Tx.m12);
924 this.scale (Tx.m00, Tx.m11);
931 this.m00 = this.m01 * T10;
934 this.m10 = this.m11 * T10;
940 this.m00 = this.m01 * Tx.m10;
942 this.m11 = this.m10 * Tx.m01;
944 this.state = mystate ^ (6);
949 this.m01 = this.m00 * Tx.m01;
951 this.m10 = this.m11 * Tx.m10;
953 this.state = mystate ^ (6);
975 this.state = mystate | txstate;
979 this.m00 = T00 * M0 + T10 * M1;
980 this.m01 = T01 * M0 + T11 * M1;
981 this.m02 += T02 * M0 + T12 * M1;
984 this.m10 = T00 * M0 + T10 * M1;
985 this.m11 = T01 * M0 + T11 * M1;
986 this.m12 += T02 * M0 + T12 * M1;
994 this.m02 += T12 * M0;
998 this.m12 += T02 * M0;
1003 this.m00 = T00 * M0;
1004 this.m01 = T01 * M0;
1005 this.m02 += T02 * M0;
1007 this.m10 = T10 * M0;
1008 this.m11 = T11 * M0;
1009 this.m12 += T12 * M0;
1018 this.state = txstate | 1;
1022 this.updateState ();
1023 }, "java.awt.geom.AffineTransform");
1024 Clazz.defineMethod (c$, "preConcatenate",
1034 var mystate = this.state;
1035 var txstate = Tx.state;
1036 switch ((txstate << 3) | mystate) {
1052 this.state = mystate | 1;
1059 this.m02 = this.m02 + Tx.m02;
1060 this.m12 = this.m12 + Tx.m12;
1064 this.state = mystate | 2;
1073 if ((mystate & 4) != 0) {
1074 this.m01 = this.m01 * T00;
1075 this.m10 = this.m10 * T11;
1076 if ((mystate & 2) != 0) {
1077 this.m00 = this.m00 * T00;
1078 this.m11 = this.m11 * T11;
1080 this.m00 = this.m00 * T00;
1081 this.m11 = this.m11 * T11;
1082 }if ((mystate & 1) != 0) {
1083 this.m02 = this.m02 * T00;
1084 this.m12 = this.m12 * T11;
1089 mystate = mystate | 2;
1094 this.state = mystate ^ 4;
1100 this.m00 = this.m10 * T01;
1101 this.m10 = M0 * T10;
1103 this.m01 = this.m11 * T01;
1104 this.m11 = M0 * T10;
1106 this.m02 = this.m12 * T01;
1107 this.m12 = M0 * T10;
1123 T02 += M0 * T00 + M1 * T01;
1124 T12 += M0 * T10 + M1 * T11;
1130 this.m00 = M0 * T00 + M1 * T01;
1131 this.m10 = M0 * T10 + M1 * T11;
1134 this.m01 = M0 * T00 + M1 * T01;
1135 this.m11 = M0 * T10 + M1 * T11;
1140 T02 += M0 * T00 + M1 * T01;
1141 T12 += M0 * T10 + M1 * T11;
1146 this.m00 = M0 * T01;
1147 this.m10 = M0 * T11;
1149 this.m01 = M0 * T00;
1150 this.m11 = M0 * T10;
1155 T02 += M0 * T00 + M1 * T01;
1156 T12 += M0 * T10 + M1 * T11;
1161 this.m00 = M0 * T00;
1162 this.m10 = M0 * T10;
1164 this.m01 = M0 * T01;
1165 this.m11 = M0 * T11;
1170 T02 += M0 * T00 + M1 * T01;
1171 T12 += M0 * T10 + M1 * T11;
1179 this.state = mystate | txstate;
1183 this.updateState ();
1184 }, "java.awt.geom.AffineTransform");
1185 Clazz.defineMethod (c$, "createInverse",
1188 switch (this.state) {
1192 det = this.m00 * this.m11 - this.m01 * this.m10;
1193 if (Math.abs (det) <= 4.9E-324) {
1194 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1195 }return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, (this.m01 * this.m12 - this.m11 * this.m02) / det, (this.m10 * this.m02 - this.m00 * this.m12) / det, (7));
1197 det = this.m00 * this.m11 - this.m01 * this.m10;
1198 if (Math.abs (det) <= 4.9E-324) {
1199 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1200 }return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, 0.0, 0.0, (6));
1202 if (this.m01 == 0.0 || this.m10 == 0.0) {
1203 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1204 }return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, -this.m12 / this.m10, -this.m02 / this.m01, (5));
1206 if (this.m01 == 0.0 || this.m10 == 0.0) {
1207 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1208 }return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, 0.0, 0.0, (4));
1210 if (this.m00 == 0.0 || this.m11 == 0.0) {
1211 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1212 }return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, -this.m02 / this.m00, -this.m12 / this.m11, (3));
1214 if (this.m00 == 0.0 || this.m11 == 0.0) {
1215 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1216 }return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, 0.0, 0.0, (2));
1218 return new java.awt.geom.AffineTransform (1.0, 0.0, 0.0, 1.0, -this.m02, -this.m12, (1));
1220 return new java.awt.geom.AffineTransform ();
1223 Clazz.defineMethod (c$, "invert",
1232 switch (this.state) {
1242 det = M00 * M11 - M01 * M10;
1243 if (Math.abs (det) <= 4.9E-324) {
1244 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1245 }this.m00 = M11 / det;
1246 this.m10 = -M10 / det;
1247 this.m01 = -M01 / det;
1248 this.m11 = M00 / det;
1249 this.m02 = (M01 * M12 - M11 * M02) / det;
1250 this.m12 = (M10 * M02 - M00 * M12) / det;
1257 det = M00 * M11 - M01 * M10;
1258 if (Math.abs (det) <= 4.9E-324) {
1259 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1260 }this.m00 = M11 / det;
1261 this.m10 = -M10 / det;
1262 this.m01 = -M01 / det;
1263 this.m11 = M00 / det;
1270 if (M01 == 0.0 || M10 == 0.0) {
1271 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1272 }this.m10 = 1.0 / M01;
1273 this.m01 = 1.0 / M10;
1274 this.m02 = -M12 / M10;
1275 this.m12 = -M02 / M01;
1280 if (M01 == 0.0 || M10 == 0.0) {
1281 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1282 }this.m10 = 1.0 / M01;
1283 this.m01 = 1.0 / M10;
1290 if (M00 == 0.0 || M11 == 0.0) {
1291 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1292 }this.m00 = 1.0 / M00;
1293 this.m11 = 1.0 / M11;
1294 this.m02 = -M02 / M00;
1295 this.m12 = -M12 / M11;
1300 if (M00 == 0.0 || M11 == 0.0) {
1301 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1302 }this.m00 = 1.0 / M00;
1303 this.m11 = 1.0 / M11;
1306 this.m02 = -this.m02;
1307 this.m12 = -this.m12;
1313 Clazz.defineMethod (c$, "transform",
1314 function (ptSrc, ptDst) {
1315 if (ptDst == null) {
1316 if (Clazz.instanceOf (ptSrc, java.awt.geom.Point2D.Double)) {
1317 ptDst = new java.awt.geom.Point2D.Double ();
1319 ptDst = new java.awt.geom.Point2D.Float ();
1320 }}var x = ptSrc.getX ();
1321 var y = ptSrc.getY ();
1322 switch (this.state) {
1326 ptDst.setLocation (x * this.m00 + y * this.m01 + this.m02, x * this.m10 + y * this.m11 + this.m12);
1329 ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11);
1332 ptDst.setLocation (y * this.m01 + this.m02, x * this.m10 + this.m12);
1335 ptDst.setLocation (y * this.m01, x * this.m10);
1338 ptDst.setLocation (x * this.m00 + this.m02, y * this.m11 + this.m12);
1341 ptDst.setLocation (x * this.m00, y * this.m11);
1344 ptDst.setLocation (x + this.m02, y + this.m12);
1347 ptDst.setLocation (x, y);
1350 }, "java.awt.geom.Point2D,java.awt.geom.Point2D");
1351 Clazz.defineMethod (c$, "transform",
1352 function (srcPts, srcOff, dstPts, dstOff, numPts) {
1353 if (numPts == 0) return;
1354 if (!JU.AU.isAD (srcPts)) {
1357 this.transform (src, srcOff, dst, dstOff, numPts);
1365 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1366 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1368 }switch (this.state) {
1378 while (--numPts >= 0) {
1379 var x = srcPts[srcOff++];
1380 var y = srcPts[srcOff++];
1381 dstPts[dstOff++] = M00 * x + M01 * y + M02;
1382 dstPts[dstOff++] = M10 * x + M11 * y + M12;
1390 while (--numPts >= 0) {
1391 var x = srcPts[srcOff++];
1392 var y = srcPts[srcOff++];
1393 dstPts[dstOff++] = M00 * x + M01 * y;
1394 dstPts[dstOff++] = M10 * x + M11 * y;
1402 while (--numPts >= 0) {
1403 var x = srcPts[srcOff++];
1404 dstPts[dstOff++] = M01 * srcPts[srcOff++] + M02;
1405 dstPts[dstOff++] = M10 * x + M12;
1411 while (--numPts >= 0) {
1412 var x = srcPts[srcOff++];
1413 dstPts[dstOff++] = M01 * srcPts[srcOff++];
1414 dstPts[dstOff++] = M10 * x;
1422 while (--numPts >= 0) {
1423 dstPts[dstOff++] = M00 * srcPts[srcOff++] + M02;
1424 dstPts[dstOff++] = M11 * srcPts[srcOff++] + M12;
1430 while (--numPts >= 0) {
1431 dstPts[dstOff++] = M00 * srcPts[srcOff++];
1432 dstPts[dstOff++] = M11 * srcPts[srcOff++];
1438 while (--numPts >= 0) {
1439 dstPts[dstOff++] = srcPts[srcOff++] + M02;
1440 dstPts[dstOff++] = srcPts[srcOff++] + M12;
1444 if (srcPts !== dstPts || srcOff != dstOff) {
1445 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1448 }, "~A,~N,~A,~N,~N");
1449 Clazz.defineMethod (c$, "inverseTransform",
1450 function (ptSrc, ptDst) {
1451 if (ptDst == null) {
1452 if (Clazz.instanceOf (ptSrc, java.awt.geom.Point2D.Double)) {
1453 ptDst = new java.awt.geom.Point2D.Double ();
1455 ptDst = new java.awt.geom.Point2D.Float ();
1456 }}var x = ptSrc.getX ();
1457 var y = ptSrc.getY ();
1458 switch (this.state) {
1465 var det = this.m00 * this.m11 - this.m01 * this.m10;
1466 if (Math.abs (det) <= 4.9E-324) {
1467 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1468 }ptDst.setLocation ((x * this.m11 - y * this.m01) / det, (y * this.m00 - x * this.m10) / det);
1474 if (this.m01 == 0.0 || this.m10 == 0.0) {
1475 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1476 }ptDst.setLocation (y / this.m10, x / this.m01);
1482 if (this.m00 == 0.0 || this.m11 == 0.0) {
1483 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1484 }ptDst.setLocation (x / this.m00, y / this.m11);
1487 ptDst.setLocation (x - this.m02, y - this.m12);
1490 ptDst.setLocation (x, y);
1493 }, "java.awt.geom.Point2D,java.awt.geom.Point2D");
1494 Clazz.defineMethod (c$, "inverseTransform",
1495 function (srcPts, srcOff, dstPts, dstOff, numPts) {
1503 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1504 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1506 }switch (this.state) {
1516 det = M00 * M11 - M01 * M10;
1517 if (Math.abs (det) <= 4.9E-324) {
1518 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1519 }while (--numPts >= 0) {
1520 var x = srcPts[srcOff++] - M02;
1521 var y = srcPts[srcOff++] - M12;
1522 dstPts[dstOff++] = (x * M11 - y * M01) / det;
1523 dstPts[dstOff++] = (y * M00 - x * M10) / det;
1531 det = M00 * M11 - M01 * M10;
1532 if (Math.abs (det) <= 4.9E-324) {
1533 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det);
1534 }while (--numPts >= 0) {
1535 var x = srcPts[srcOff++];
1536 var y = srcPts[srcOff++];
1537 dstPts[dstOff++] = (x * M11 - y * M01) / det;
1538 dstPts[dstOff++] = (y * M00 - x * M10) / det;
1546 if (M01 == 0.0 || M10 == 0.0) {
1547 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1548 }while (--numPts >= 0) {
1549 var x = srcPts[srcOff++] - M02;
1550 dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M10;
1551 dstPts[dstOff++] = x / M01;
1557 if (M01 == 0.0 || M10 == 0.0) {
1558 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1559 }while (--numPts >= 0) {
1560 var x = srcPts[srcOff++];
1561 dstPts[dstOff++] = srcPts[srcOff++] / M10;
1562 dstPts[dstOff++] = x / M01;
1570 if (M00 == 0.0 || M11 == 0.0) {
1571 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1572 }while (--numPts >= 0) {
1573 dstPts[dstOff++] = (srcPts[srcOff++] - M02) / M00;
1574 dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M11;
1580 if (M00 == 0.0 || M11 == 0.0) {
1581 throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0");
1582 }while (--numPts >= 0) {
1583 dstPts[dstOff++] = srcPts[srcOff++] / M00;
1584 dstPts[dstOff++] = srcPts[srcOff++] / M11;
1590 while (--numPts >= 0) {
1591 dstPts[dstOff++] = srcPts[srcOff++] - M02;
1592 dstPts[dstOff++] = srcPts[srcOff++] - M12;
1596 if (srcPts !== dstPts || srcOff != dstOff) {
1597 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1600 }, "~A,~N,~A,~N,~N");
1601 Clazz.defineMethod (c$, "deltaTransform",
1602 function (ptSrc, ptDst) {
1603 if (ptDst == null) {
1604 if (Clazz.instanceOf (ptSrc, java.awt.geom.Point2D.Double)) {
1605 ptDst = new java.awt.geom.Point2D.Double ();
1607 ptDst = new java.awt.geom.Point2D.Float ();
1608 }}var x = ptSrc.getX ();
1609 var y = ptSrc.getY ();
1610 switch (this.state) {
1615 ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11);
1619 ptDst.setLocation (y * this.m01, x * this.m10);
1623 ptDst.setLocation (x * this.m00, y * this.m11);
1627 ptDst.setLocation (x, y);
1630 }, "java.awt.geom.Point2D,java.awt.geom.Point2D");
1631 Clazz.defineMethod (c$, "deltaTransform",
1632 function (srcPts, srcOff, dstPts, dstOff, numPts) {
1637 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1638 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1640 }switch (this.state) {
1649 while (--numPts >= 0) {
1650 var x = srcPts[srcOff++];
1651 var y = srcPts[srcOff++];
1652 dstPts[dstOff++] = x * M00 + y * M01;
1653 dstPts[dstOff++] = x * M10 + y * M11;
1660 while (--numPts >= 0) {
1661 var x = srcPts[srcOff++];
1662 dstPts[dstOff++] = srcPts[srcOff++] * M01;
1663 dstPts[dstOff++] = x * M10;
1670 while (--numPts >= 0) {
1671 dstPts[dstOff++] = srcPts[srcOff++] * M00;
1672 dstPts[dstOff++] = srcPts[srcOff++] * M11;
1677 if (srcPts !== dstPts || srcOff != dstOff) {
1678 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1681 }, "~A,~N,~A,~N,~N");
1682 Clazz.defineMethod (c$, "createTransformedShape",
1686 }return new java.awt.geom.Path2D.Double (pSrc, this);
1687 }, "java.awt.Shape");
1688 c$._matround = Clazz.defineMethod (c$, "_matround",
1690 return Math.rint (matval * 1E15) / 1E15;
1692 Clazz.overrideMethod (c$, "toString",
1694 return ("AffineTransform[[" + java.awt.geom.AffineTransform._matround (this.m00) + ", " + java.awt.geom.AffineTransform._matround (this.m01) + ", " + java.awt.geom.AffineTransform._matround (this.m02) + "], [" + java.awt.geom.AffineTransform._matround (this.m10) + ", " + java.awt.geom.AffineTransform._matround (this.m11) + ", " + java.awt.geom.AffineTransform._matround (this.m12) + "]]");
1696 Clazz.defineMethod (c$, "isIdentity",
1698 return (this.state == 0 || (this.getType () == 0));
1700 Clazz.defineMethod (c$, "clone",
1703 return Clazz.superCall (this, java.awt.geom.AffineTransform, "clone", []);
1705 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
1706 throw new InternalError ();
1712 Clazz.overrideMethod (c$, "hashCode",
1714 var bits = Double.doubleToLongBits (this.m00);
1715 bits = bits * 31 + Double.doubleToLongBits (this.m01);
1716 bits = bits * 31 + Double.doubleToLongBits (this.m02);
1717 bits = bits * 31 + Double.doubleToLongBits (this.m10);
1718 bits = bits * 31 + Double.doubleToLongBits (this.m11);
1719 bits = bits * 31 + Double.doubleToLongBits (this.m12);
1720 return ((bits) ^ ((bits >> 32)));
1722 Clazz.overrideMethod (c$, "equals",
1724 if (!(Clazz.instanceOf (obj, java.awt.geom.AffineTransform))) {
1727 return ((this.m00 == a.m00) && (this.m01 == a.m01) && (this.m02 == a.m02) && (this.m10 == a.m10) && (this.m11 == a.m11) && (this.m12 == a.m12));
1729 Clazz.defineStatics (c$,
1732 "TYPE_TRANSLATION", 1,
1733 "TYPE_UNIFORM_SCALE", 2,
1734 "TYPE_GENERAL_SCALE", 4,
1735 "TYPE_MASK_SCALE", (6),
1737 "TYPE_QUADRANT_ROTATION", 8,
1738 "TYPE_GENERAL_ROTATION", 16,
1739 "TYPE_MASK_ROTATION", (24),
1740 "TYPE_GENERAL_TRANSFORM", 32,
1741 "APPLY_IDENTITY", 0,
1742 "APPLY_TRANSLATE", 1,
1750 "rot90conversion", Clazz.newIntArray (-1, [4, 5, 4, 5, 2, 3, 6, 7]));