Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / geom / AffineTransform.js
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 () {
4 this.m00 = 0;
5 this.m10 = 0;
6 this.m01 = 0;
7 this.m11 = 0;
8 this.m02 = 0;
9 this.m12 = 0;
10 this.state = 0;
11 this.type = 0;
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) {
16 {
17 switch (arguments.length) { case 0: this.m00 = this.m11 = 1.0;
18 return;
19 case 1:
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;
25 } else {
26 var flatmatrix = m00;
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];
34 }
35 this.updateState();
36 }
37 return;
38 case 6:
39 this.m00 = m00;
40 this.m10 = m10;
41 this.m01 = m01;
42 this.m11 = m11;
43 this.m02 = m02;
44 this.m12 = m12;
45 this.updateState();
46 return;
47 }
48 }this.m00 = m00;
49 this.m10 = m10;
50 this.m01 = m01;
51 this.m11 = m11;
52 this.m02 = m02;
53 this.m12 = m12;
54 this.state = state;
55 this.type = -1;
56 }, "~N,~N,~N,~N,~N,~N,~N");
57 c$.getTranslateInstance = Clazz.defineMethod (c$, "getTranslateInstance", 
58 function (tx, ty) {
59 var Tx =  new java.awt.geom.AffineTransform ();
60 Tx.setToTranslation (tx, ty);
61 return Tx;
62 }, "~N,~N");
63 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance", 
64 function (theta) {
65 var Tx =  new java.awt.geom.AffineTransform ();
66 Tx.setToRotation (theta);
67 return Tx;
68 }, "~N");
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);
73 return Tx;
74 }, "~N,~N,~N");
75 c$.getRotateInstance = Clazz.defineMethod (c$, "getRotateInstance", 
76 function (vecx, vecy) {
77 var Tx =  new java.awt.geom.AffineTransform ();
78 Tx.setToRotation (vecx, vecy);
79 return Tx;
80 }, "~N,~N");
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);
85 return Tx;
86 }, "~N,~N,~N,~N");
87 c$.getQuadrantRotateInstance = Clazz.defineMethod (c$, "getQuadrantRotateInstance", 
88 function (numquadrants) {
89 var Tx =  new java.awt.geom.AffineTransform ();
90 Tx.setToQuadrantRotation (numquadrants);
91 return Tx;
92 }, "~N");
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);
97 return Tx;
98 }, "~N,~N,~N");
99 c$.getScaleInstance = Clazz.defineMethod (c$, "getScaleInstance", 
100 function (sx, sy) {
101 var Tx =  new java.awt.geom.AffineTransform ();
102 Tx.setToScale (sx, sy);
103 return Tx;
104 }, "~N,~N");
105 c$.getShearInstance = Clazz.defineMethod (c$, "getShearInstance", 
106 function (shx, shy) {
107 var Tx =  new java.awt.geom.AffineTransform ();
108 Tx.setToShear (shx, shy);
109 return Tx;
110 }, "~N,~N");
111 Clazz.defineMethod (c$, "getType", 
112 function () {
113 if (this.type == -1) {
114 this.calculateType ();
115 }return this.type;
116 });
117 Clazz.defineMethod (c$, "calculateType", 
118  function () {
119 var ret = 0;
120 var sgn0;
121 var sgn1;
122 var M0;
123 var M1;
124 var M2;
125 var M3;
126 this.updateState ();
127 switch (this.state) {
128 default:
129 this.stateError ();
130 case (7):
131 ret = 1;
132 case (6):
133 if ((M0 = this.m00) * (M2 = this.m01) + (M3 = this.m10) * (M1 = this.m11) != 0) {
134 this.type = 32;
135 return;
136 }sgn0 = (M0 >= 0.0);
137 sgn1 = (M1 >= 0.0);
138 if (sgn0 == sgn1) {
139 if (M0 != M1 || M2 != -M3) {
140 ret |= (20);
141 } else if (M0 * M1 - M2 * M3 != 1.0) {
142 ret |= (18);
143 } else {
144 ret |= 16;
145 }} else {
146 if (M0 != -M1 || M2 != M3) {
147 ret |= (84);
148 } else if (M0 * M1 - M2 * M3 != 1.0) {
149 ret |= (82);
150 } else {
151 ret |= (80);
152 }}break;
153 case (5):
154 ret = 1;
155 case (4):
156 sgn0 = ((M0 = this.m01) >= 0.0);
157 sgn1 = ((M1 = this.m10) >= 0.0);
158 if (sgn0 != sgn1) {
159 if (M0 != -M1) {
160 ret |= (12);
161 } else if (M0 != 1.0 && M0 != -1.0) {
162 ret |= (10);
163 } else {
164 ret |= 8;
165 }} else {
166 if (M0 == M1) {
167 ret |= (74);
168 } else {
169 ret |= (76);
170 }}break;
171 case (3):
172 ret = 1;
173 case (2):
174 sgn0 = ((M0 = this.m00) >= 0.0);
175 sgn1 = ((M1 = this.m11) >= 0.0);
176 if (sgn0 == sgn1) {
177 if (sgn0) {
178 if (M0 == M1) {
179 ret |= 2;
180 } else {
181 ret |= 4;
182 }} else {
183 if (M0 != M1) {
184 ret |= (12);
185 } else if (M0 != -1.0) {
186 ret |= (10);
187 } else {
188 ret |= 8;
189 }}} else {
190 if (M0 == -M1) {
191 if (M0 == 1.0 || M0 == -1.0) {
192 ret |= 64;
193 } else {
194 ret |= (66);
195 }} else {
196 ret |= (68);
197 }}break;
198 case (1):
199 ret = 1;
200 break;
201 case (0):
202 break;
203 }
204 this.type = ret;
205 });
206 Clazz.defineMethod (c$, "getDeterminant", 
207 function () {
208 switch (this.state) {
209 default:
210 this.stateError ();
211 case (7):
212 case (6):
213 return this.m00 * this.m11 - this.m01 * this.m10;
214 case (5):
215 case (4):
216 return -(this.m01 * this.m10);
217 case (3):
218 case (2):
219 return this.m00 * this.m11;
220 case (1):
221 case (0):
222 return 1.0;
223 }
224 });
225 Clazz.defineMethod (c$, "updateState", 
226 function () {
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) {
230 this.state = 0;
231 this.type = 0;
232 } else {
233 this.state = 1;
234 this.type = 1;
235 }} else {
236 if (this.m02 == 0.0 && this.m12 == 0.0) {
237 this.state = 2;
238 this.type = -1;
239 } else {
240 this.state = (3);
241 this.type = -1;
242 }}} else {
243 if (this.m00 == 0.0 && this.m11 == 0.0) {
244 if (this.m02 == 0.0 && this.m12 == 0.0) {
245 this.state = 4;
246 this.type = -1;
247 } else {
248 this.state = (5);
249 this.type = -1;
250 }} else {
251 if (this.m02 == 0.0 && this.m12 == 0.0) {
252 this.state = (6);
253 this.type = -1;
254 } else {
255 this.state = (7);
256 this.type = -1;
257 }}}});
258 Clazz.defineMethod (c$, "stateError", 
259  function () {
260 throw  new InternalError ("missing case in transform state switch");
261 });
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;
271 }}, "~A");
272 Clazz.defineMethod (c$, "getScaleX", 
273 function () {
274 return this.m00;
275 });
276 Clazz.defineMethod (c$, "getScaleY", 
277 function () {
278 return this.m11;
279 });
280 Clazz.defineMethod (c$, "getShearX", 
281 function () {
282 return this.m01;
283 });
284 Clazz.defineMethod (c$, "getShearY", 
285 function () {
286 return this.m10;
287 });
288 Clazz.defineMethod (c$, "getTranslateX", 
289 function () {
290 return this.m02;
291 });
292 Clazz.defineMethod (c$, "getTranslateY", 
293 function () {
294 return this.m12;
295 });
296 Clazz.defineMethod (c$, "translate", 
297 function (tx, ty) {
298 switch (this.state) {
299 default:
300 this.stateError ();
301 case (7):
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) {
305 this.state = 6;
306 if (this.type != -1) {
307 this.type -= 1;
308 }}return;
309 case (6):
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) {
313 this.state = 7;
314 this.type |= 1;
315 }return;
316 case (5):
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) {
320 this.state = 4;
321 if (this.type != -1) {
322 this.type -= 1;
323 }}return;
324 case (4):
325 this.m02 = ty * this.m01;
326 this.m12 = tx * this.m10;
327 if (this.m02 != 0.0 || this.m12 != 0.0) {
328 this.state = 5;
329 this.type |= 1;
330 }return;
331 case (3):
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) {
335 this.state = 2;
336 if (this.type != -1) {
337 this.type -= 1;
338 }}return;
339 case (2):
340 this.m02 = tx * this.m00;
341 this.m12 = ty * this.m11;
342 if (this.m02 != 0.0 || this.m12 != 0.0) {
343 this.state = 3;
344 this.type |= 1;
345 }return;
346 case (1):
347 this.m02 = tx + this.m02;
348 this.m12 = ty + this.m12;
349 if (this.m02 == 0.0 && this.m12 == 0.0) {
350 this.state = 0;
351 this.type = 0;
352 }return;
353 case (0):
354 this.m02 = tx;
355 this.m12 = ty;
356 if (tx != 0.0 || ty != 0.0) {
357 this.state = 1;
358 this.type = 1;
359 }return;
360 }
361 }, "~N,~N");
362 Clazz.defineMethod (c$, "rotate90", 
363  function () {
364 var M0 = this.m00;
365 this.m00 = this.m01;
366 this.m01 = -M0;
367 M0 = this.m10;
368 this.m10 = this.m11;
369 this.m11 = -M0;
370 var state = java.awt.geom.AffineTransform.rot90conversion[this.state];
371 if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) {
372 state -= 2;
373 }this.state = state;
374 this.type = -1;
375 });
376 Clazz.defineMethod (c$, "rotate180", 
377  function () {
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;
384 } else {
385 if (this.m00 == 1.0 && this.m11 == 1.0) {
386 this.state = state & -3;
387 } else {
388 this.state = state | 2;
389 }}this.type = -1;
390 });
391 Clazz.defineMethod (c$, "rotate270", 
392  function () {
393 var M0 = this.m00;
394 this.m00 = -this.m01;
395 this.m01 = M0;
396 M0 = this.m10;
397 this.m10 = -this.m11;
398 this.m11 = M0;
399 var state = java.awt.geom.AffineTransform.rot90conversion[this.state];
400 if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) {
401 state -= 2;
402 }this.state = state;
403 this.type = -1;
404 });
405 Clazz.defineMethod (c$, "rotate", 
406 function (theta) {
407 var sin = Math.sin (theta);
408 if (sin == 1.0) {
409 this.rotate90 ();
410 } else if (sin == -1.0) {
411 this.rotate270 ();
412 } else {
413 var cos = Math.cos (theta);
414 if (cos == -1.0) {
415 this.rotate180 ();
416 } else if (cos != 1.0) {
417 var M0;
418 var M1;
419 M0 = this.m00;
420 M1 = this.m01;
421 this.m00 = cos * M0 + sin * M1;
422 this.m01 = -sin * M0 + cos * M1;
423 M0 = this.m10;
424 M1 = this.m11;
425 this.m10 = cos * M0 + sin * M1;
426 this.m11 = -sin * M0 + cos * M1;
427 this.updateState ();
428 }}}, "~N");
429 Clazz.defineMethod (c$, "rotate", 
430 function (theta, anchorx, anchory) {
431 this.translate (anchorx, anchory);
432 this.rotate (theta);
433 this.translate (-anchorx, -anchory);
434 }, "~N,~N,~N");
435 Clazz.defineMethod (c$, "rotate", 
436 function (vecx, vecy) {
437 if (vecy == 0.0) {
438 if (vecx < 0.0) {
439 this.rotate180 ();
440 }} else if (vecx == 0.0) {
441 if (vecy > 0.0) {
442 this.rotate90 ();
443 } else {
444 this.rotate270 ();
445 }} else {
446 var len = Math.sqrt (vecx * vecx + vecy * vecy);
447 var sin = vecy / len;
448 var cos = vecx / len;
449 var M0;
450 var M1;
451 M0 = this.m00;
452 M1 = this.m01;
453 this.m00 = cos * M0 + sin * M1;
454 this.m01 = -sin * M0 + cos * M1;
455 M0 = this.m10;
456 M1 = this.m11;
457 this.m10 = cos * M0 + sin * M1;
458 this.m11 = -sin * M0 + cos * M1;
459 this.updateState ();
460 }}, "~N,~N");
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);
466 }, "~N,~N,~N,~N");
467 Clazz.defineMethod (c$, "quadrantRotate", 
468 function (numquadrants) {
469 switch (numquadrants & 3) {
470 case 0:
471 break;
472 case 1:
473 this.rotate90 ();
474 break;
475 case 2:
476 this.rotate180 ();
477 break;
478 case 3:
479 this.rotate270 ();
480 break;
481 }
482 }, "~N");
483 Clazz.defineMethod (c$, "quadrantRotate", 
484 function (numquadrants, anchorx, anchory) {
485 switch (numquadrants & 3) {
486 case 0:
487 return;
488 case 1:
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);
491 this.rotate90 ();
492 break;
493 case 2:
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);
496 this.rotate180 ();
497 break;
498 case 3:
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);
501 this.rotate270 ();
502 break;
503 }
504 if (this.m02 == 0.0 && this.m12 == 0.0) {
505 this.state &= -2;
506 } else {
507 this.state |= 1;
508 }}, "~N,~N,~N");
509 Clazz.defineMethod (c$, "scale", 
510 function (sx, sy) {
511 var state = this.state;
512 switch (state) {
513 default:
514 this.stateError ();
515 case (7):
516 case (6):
517 this.m00 *= sx;
518 this.m11 *= sy;
519 case (5):
520 case (4):
521 this.m01 *= sy;
522 this.m10 *= sx;
523 if (this.m01 == 0 && this.m10 == 0) {
524 state &= 1;
525 if (this.m00 == 1.0 && this.m11 == 1.0) {
526 this.type = (state == 0 ? 0 : 1);
527 } else {
528 state |= 2;
529 this.type = -1;
530 }this.state = state;
531 }return;
532 case (3):
533 case (2):
534 this.m00 *= sx;
535 this.m11 *= sy;
536 if (this.m00 == 1.0 && this.m11 == 1.0) {
537 this.state = (state &= 1);
538 this.type = (state == 0 ? 0 : 1);
539 } else {
540 this.type = -1;
541 }return;
542 case (1):
543 case (0):
544 this.m00 = sx;
545 this.m11 = sy;
546 if (sx != 1.0 || sy != 1.0) {
547 this.state = state | 2;
548 this.type = -1;
549 }return;
550 }
551 }, "~N,~N");
552 Clazz.defineMethod (c$, "shear", 
553 function (shx, shy) {
554 var state = this.state;
555 switch (state) {
556 default:
557 this.stateError ();
558 case (7):
559 case (6):
560 var M0;
561 var M1;
562 M0 = this.m00;
563 M1 = this.m01;
564 this.m00 = M0 + M1 * shy;
565 this.m01 = M0 * shx + M1;
566 M0 = this.m10;
567 M1 = this.m11;
568 this.m10 = M0 + M1 * shy;
569 this.m11 = M0 * shx + M1;
570 this.updateState ();
571 return;
572 case (5):
573 case (4):
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;
578 }this.type = -1;
579 return;
580 case (3):
581 case (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;
586 }this.type = -1;
587 return;
588 case (1):
589 case (0):
590 this.m01 = shx;
591 this.m10 = shy;
592 if (this.m01 != 0.0 || this.m10 != 0.0) {
593 this.state = state | 2 | 4;
594 this.type = -1;
595 }return;
596 }
597 }, "~N,~N");
598 Clazz.defineMethod (c$, "setToIdentity", 
599 function () {
600 this.m00 = this.m11 = 1.0;
601 this.m10 = this.m01 = this.m02 = this.m12 = 0.0;
602 this.state = 0;
603 this.type = 0;
604 });
605 Clazz.defineMethod (c$, "setToTranslation", 
606 function (tx, ty) {
607 this.m00 = 1.0;
608 this.m10 = 0.0;
609 this.m01 = 0.0;
610 this.m11 = 1.0;
611 this.m02 = tx;
612 this.m12 = ty;
613 if (tx != 0.0 || ty != 0.0) {
614 this.state = 1;
615 this.type = 1;
616 } else {
617 this.state = 0;
618 this.type = 0;
619 }}, "~N,~N");
620 Clazz.defineMethod (c$, "setToRotation", 
621 function (theta) {
622 var sin = Math.sin (theta);
623 var cos;
624 if (sin == 1.0 || sin == -1.0) {
625 cos = 0.0;
626 this.state = 4;
627 this.type = 8;
628 } else {
629 cos = Math.cos (theta);
630 if (cos == -1.0) {
631 sin = 0.0;
632 this.state = 2;
633 this.type = 8;
634 } else if (cos == 1.0) {
635 sin = 0.0;
636 this.state = 0;
637 this.type = 0;
638 } else {
639 this.state = 6;
640 this.type = 16;
641 }}this.m00 = cos;
642 this.m10 = sin;
643 this.m01 = -sin;
644 this.m11 = cos;
645 this.m02 = 0.0;
646 this.m12 = 0.0;
647 }, "~N");
648 Clazz.defineMethod (c$, "setToRotation", 
649 function (theta, anchorx, anchory) {
650 this.setToRotation (theta);
651 var sin = this.m10;
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) {
656 this.state |= 1;
657 this.type |= 1;
658 }}, "~N,~N,~N");
659 Clazz.defineMethod (c$, "setToRotation", 
660 function (vecx, vecy) {
661 var sin;
662 var cos;
663 if (vecy == 0) {
664 sin = 0.0;
665 if (vecx < 0.0) {
666 cos = -1.0;
667 this.state = 2;
668 this.type = 8;
669 } else {
670 cos = 1.0;
671 this.state = 0;
672 this.type = 0;
673 }} else if (vecx == 0) {
674 cos = 0.0;
675 sin = (vecy > 0.0) ? 1.0 : -1.0;
676 this.state = 4;
677 this.type = 8;
678 } else {
679 var len = Math.sqrt (vecx * vecx + vecy * vecy);
680 cos = vecx / len;
681 sin = vecy / len;
682 this.state = 6;
683 this.type = 16;
684 }this.m00 = cos;
685 this.m10 = sin;
686 this.m01 = -sin;
687 this.m11 = cos;
688 this.m02 = 0.0;
689 this.m12 = 0.0;
690 }, "~N,~N");
691 Clazz.defineMethod (c$, "setToRotation", 
692 function (vecx, vecy, anchorx, anchory) {
693 this.setToRotation (vecx, vecy);
694 var sin = this.m10;
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) {
699 this.state |= 1;
700 this.type |= 1;
701 }}, "~N,~N,~N,~N");
702 Clazz.defineMethod (c$, "setToQuadrantRotation", 
703 function (numquadrants) {
704 switch (numquadrants & 3) {
705 case 0:
706 this.m00 = 1.0;
707 this.m10 = 0.0;
708 this.m01 = 0.0;
709 this.m11 = 1.0;
710 this.m02 = 0.0;
711 this.m12 = 0.0;
712 this.state = 0;
713 this.type = 0;
714 break;
715 case 1:
716 this.m00 = 0.0;
717 this.m10 = 1.0;
718 this.m01 = -1.0;
719 this.m11 = 0.0;
720 this.m02 = 0.0;
721 this.m12 = 0.0;
722 this.state = 4;
723 this.type = 8;
724 break;
725 case 2:
726 this.m00 = -1.0;
727 this.m10 = 0.0;
728 this.m01 = 0.0;
729 this.m11 = -1.0;
730 this.m02 = 0.0;
731 this.m12 = 0.0;
732 this.state = 2;
733 this.type = 8;
734 break;
735 case 3:
736 this.m00 = 0.0;
737 this.m10 = -1.0;
738 this.m01 = 1.0;
739 this.m11 = 0.0;
740 this.m02 = 0.0;
741 this.m12 = 0.0;
742 this.state = 4;
743 this.type = 8;
744 break;
745 }
746 }, "~N");
747 Clazz.defineMethod (c$, "setToQuadrantRotation", 
748 function (numquadrants, anchorx, anchory) {
749 switch (numquadrants & 3) {
750 case 0:
751 this.m00 = 1.0;
752 this.m10 = 0.0;
753 this.m01 = 0.0;
754 this.m11 = 1.0;
755 this.m02 = 0.0;
756 this.m12 = 0.0;
757 this.state = 0;
758 this.type = 0;
759 break;
760 case 1:
761 this.m00 = 0.0;
762 this.m10 = 1.0;
763 this.m01 = -1.0;
764 this.m11 = 0.0;
765 this.m02 = anchorx + anchory;
766 this.m12 = anchory - anchorx;
767 if (this.m02 == 0.0 && this.m12 == 0.0) {
768 this.state = 4;
769 this.type = 8;
770 } else {
771 this.state = 5;
772 this.type = 9;
773 }break;
774 case 2:
775 this.m00 = -1.0;
776 this.m10 = 0.0;
777 this.m01 = 0.0;
778 this.m11 = -1.0;
779 this.m02 = anchorx + anchorx;
780 this.m12 = anchory + anchory;
781 if (this.m02 == 0.0 && this.m12 == 0.0) {
782 this.state = 2;
783 this.type = 8;
784 } else {
785 this.state = 3;
786 this.type = 9;
787 }break;
788 case 3:
789 this.m00 = 0.0;
790 this.m10 = -1.0;
791 this.m01 = 1.0;
792 this.m11 = 0.0;
793 this.m02 = anchorx - anchory;
794 this.m12 = anchory + anchorx;
795 if (this.m02 == 0.0 && this.m12 == 0.0) {
796 this.state = 4;
797 this.type = 8;
798 } else {
799 this.state = 5;
800 this.type = 9;
801 }break;
802 }
803 }, "~N,~N,~N");
804 Clazz.defineMethod (c$, "setToScale", 
805 function (sx, sy) {
806 this.m00 = sx;
807 this.m10 = 0.0;
808 this.m01 = 0.0;
809 this.m11 = sy;
810 this.m02 = 0.0;
811 this.m12 = 0.0;
812 if (sx != 1.0 || sy != 1.0) {
813 this.state = 2;
814 this.type = -1;
815 } else {
816 this.state = 0;
817 this.type = 0;
818 }}, "~N,~N");
819 Clazz.defineMethod (c$, "setToShear", 
820 function (shx, shy) {
821 this.m00 = 1.0;
822 this.m01 = shx;
823 this.m10 = shy;
824 this.m11 = 1.0;
825 this.m02 = 0.0;
826 this.m12 = 0.0;
827 if (shx != 0.0 || shy != 0.0) {
828 this.state = (6);
829 this.type = -1;
830 } else {
831 this.state = 0;
832 this.type = 0;
833 }}, "~N,~N");
834 Clazz.defineMethod (c$, "setTransform", 
835 function (Tx) {
836 this.m00 = Tx.m00;
837 this.m10 = Tx.m10;
838 this.m01 = Tx.m01;
839 this.m11 = Tx.m11;
840 this.m02 = Tx.m02;
841 this.m12 = Tx.m12;
842 this.state = Tx.state;
843 this.type = Tx.type;
844 }, "java.awt.geom.AffineTransform");
845 Clazz.defineMethod (c$, "setTransform", 
846 function (m00, m10, m01, m11, m02, m12) {
847 this.m00 = m00;
848 this.m10 = m10;
849 this.m01 = m01;
850 this.m11 = m11;
851 this.m02 = m02;
852 this.m12 = m12;
853 this.updateState ();
854 }, "~N,~N,~N,~N,~N,~N");
855 Clazz.defineMethod (c$, "concatenate", 
856 function (Tx) {
857 var M0;
858 var M1;
859 var T00;
860 var T01;
861 var T10;
862 var T11;
863 var T02;
864 var T12;
865 var mystate = this.state;
866 var txstate = Tx.state;
867 switch ((txstate << 3) | mystate) {
868 case (0):
869 case (1):
870 case (2):
871 case (3):
872 case (4):
873 case (5):
874 case (6):
875 case (7):
876 return;
877 case (56):
878 this.m01 = Tx.m01;
879 this.m10 = Tx.m10;
880 case (24):
881 this.m00 = Tx.m00;
882 this.m11 = Tx.m11;
883 case (8):
884 this.m02 = Tx.m02;
885 this.m12 = Tx.m12;
886 this.state = txstate;
887 this.type = Tx.type;
888 return;
889 case (48):
890 this.m01 = Tx.m01;
891 this.m10 = Tx.m10;
892 case (16):
893 this.m00 = Tx.m00;
894 this.m11 = Tx.m11;
895 this.state = txstate;
896 this.type = Tx.type;
897 return;
898 case (40):
899 this.m02 = Tx.m02;
900 this.m12 = Tx.m12;
901 case (32):
902 this.m01 = Tx.m01;
903 this.m10 = Tx.m10;
904 this.m00 = this.m11 = 0.0;
905 this.state = txstate;
906 this.type = Tx.type;
907 return;
908 case (15):
909 case (14):
910 case (13):
911 case (12):
912 case (11):
913 case (10):
914 case (9):
915 this.translate (Tx.m02, Tx.m12);
916 return;
917 case (23):
918 case (22):
919 case (21):
920 case (20):
921 case (19):
922 case (18):
923 case (17):
924 this.scale (Tx.m00, Tx.m11);
925 return;
926 case (39):
927 case (38):
928 T01 = Tx.m01;
929 T10 = Tx.m10;
930 M0 = this.m00;
931 this.m00 = this.m01 * T10;
932 this.m01 = M0 * T01;
933 M0 = this.m10;
934 this.m10 = this.m11 * T10;
935 this.m11 = M0 * T01;
936 this.type = -1;
937 return;
938 case (37):
939 case (36):
940 this.m00 = this.m01 * Tx.m10;
941 this.m01 = 0.0;
942 this.m11 = this.m10 * Tx.m01;
943 this.m10 = 0.0;
944 this.state = mystate ^ (6);
945 this.type = -1;
946 return;
947 case (35):
948 case (34):
949 this.m01 = this.m00 * Tx.m01;
950 this.m00 = 0.0;
951 this.m10 = this.m11 * Tx.m10;
952 this.m11 = 0.0;
953 this.state = mystate ^ (6);
954 this.type = -1;
955 return;
956 case (33):
957 this.m00 = 0.0;
958 this.m01 = Tx.m01;
959 this.m10 = Tx.m10;
960 this.m11 = 0.0;
961 this.state = 5;
962 this.type = -1;
963 return;
964 }
965 T00 = Tx.m00;
966 T01 = Tx.m01;
967 T02 = Tx.m02;
968 T10 = Tx.m10;
969 T11 = Tx.m11;
970 T12 = Tx.m12;
971 switch (mystate) {
972 default:
973 this.stateError ();
974 case (6):
975 this.state = mystate | txstate;
976 case (7):
977 M0 = this.m00;
978 M1 = this.m01;
979 this.m00 = T00 * M0 + T10 * M1;
980 this.m01 = T01 * M0 + T11 * M1;
981 this.m02 += T02 * M0 + T12 * M1;
982 M0 = this.m10;
983 M1 = this.m11;
984 this.m10 = T00 * M0 + T10 * M1;
985 this.m11 = T01 * M0 + T11 * M1;
986 this.m12 += T02 * M0 + T12 * M1;
987 this.type = -1;
988 return;
989 case (5):
990 case (4):
991 M0 = this.m01;
992 this.m00 = T10 * M0;
993 this.m01 = T11 * M0;
994 this.m02 += T12 * M0;
995 M0 = this.m10;
996 this.m10 = T00 * M0;
997 this.m11 = T01 * M0;
998 this.m12 += T02 * M0;
999 break;
1000 case (3):
1001 case (2):
1002 M0 = this.m00;
1003 this.m00 = T00 * M0;
1004 this.m01 = T01 * M0;
1005 this.m02 += T02 * M0;
1006 M0 = this.m11;
1007 this.m10 = T10 * M0;
1008 this.m11 = T11 * M0;
1009 this.m12 += T12 * M0;
1010 break;
1011 case (1):
1012 this.m00 = T00;
1013 this.m01 = T01;
1014 this.m02 += T02;
1015 this.m10 = T10;
1016 this.m11 = T11;
1017 this.m12 += T12;
1018 this.state = txstate | 1;
1019 this.type = -1;
1020 return;
1021 }
1022 this.updateState ();
1023 }, "java.awt.geom.AffineTransform");
1024 Clazz.defineMethod (c$, "preConcatenate", 
1025 function (Tx) {
1026 var M0;
1027 var M1;
1028 var T00;
1029 var T01;
1030 var T10;
1031 var T11;
1032 var T02;
1033 var T12;
1034 var mystate = this.state;
1035 var txstate = Tx.state;
1036 switch ((txstate << 3) | mystate) {
1037 case (0):
1038 case (1):
1039 case (2):
1040 case (3):
1041 case (4):
1042 case (5):
1043 case (6):
1044 case (7):
1045 return;
1046 case (8):
1047 case (10):
1048 case (12):
1049 case (14):
1050 this.m02 = Tx.m02;
1051 this.m12 = Tx.m12;
1052 this.state = mystate | 1;
1053 this.type |= 1;
1054 return;
1055 case (9):
1056 case (11):
1057 case (13):
1058 case (15):
1059 this.m02 = this.m02 + Tx.m02;
1060 this.m12 = this.m12 + Tx.m12;
1061 return;
1062 case (17):
1063 case (16):
1064 this.state = mystate | 2;
1065 case (23):
1066 case (22):
1067 case (21):
1068 case (20):
1069 case (19):
1070 case (18):
1071 T00 = Tx.m00;
1072 T11 = Tx.m11;
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;
1079 }} else {
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;
1085 }this.type = -1;
1086 return;
1087 case (37):
1088 case (36):
1089 mystate = mystate | 2;
1090 case (33):
1091 case (32):
1092 case (35):
1093 case (34):
1094 this.state = mystate ^ 4;
1095 case (39):
1096 case (38):
1097 T01 = Tx.m01;
1098 T10 = Tx.m10;
1099 M0 = this.m00;
1100 this.m00 = this.m10 * T01;
1101 this.m10 = M0 * T10;
1102 M0 = this.m01;
1103 this.m01 = this.m11 * T01;
1104 this.m11 = M0 * T10;
1105 M0 = this.m02;
1106 this.m02 = this.m12 * T01;
1107 this.m12 = M0 * T10;
1108 this.type = -1;
1109 return;
1110 }
1111 T00 = Tx.m00;
1112 T01 = Tx.m01;
1113 T02 = Tx.m02;
1114 T10 = Tx.m10;
1115 T11 = Tx.m11;
1116 T12 = Tx.m12;
1117 switch (mystate) {
1118 default:
1119 this.stateError ();
1120 case (7):
1121 M0 = this.m02;
1122 M1 = this.m12;
1123 T02 += M0 * T00 + M1 * T01;
1124 T12 += M0 * T10 + M1 * T11;
1125 case (6):
1126 this.m02 = T02;
1127 this.m12 = T12;
1128 M0 = this.m00;
1129 M1 = this.m10;
1130 this.m00 = M0 * T00 + M1 * T01;
1131 this.m10 = M0 * T10 + M1 * T11;
1132 M0 = this.m01;
1133 M1 = this.m11;
1134 this.m01 = M0 * T00 + M1 * T01;
1135 this.m11 = M0 * T10 + M1 * T11;
1136 break;
1137 case (5):
1138 M0 = this.m02;
1139 M1 = this.m12;
1140 T02 += M0 * T00 + M1 * T01;
1141 T12 += M0 * T10 + M1 * T11;
1142 case (4):
1143 this.m02 = T02;
1144 this.m12 = T12;
1145 M0 = this.m10;
1146 this.m00 = M0 * T01;
1147 this.m10 = M0 * T11;
1148 M0 = this.m01;
1149 this.m01 = M0 * T00;
1150 this.m11 = M0 * T10;
1151 break;
1152 case (3):
1153 M0 = this.m02;
1154 M1 = this.m12;
1155 T02 += M0 * T00 + M1 * T01;
1156 T12 += M0 * T10 + M1 * T11;
1157 case (2):
1158 this.m02 = T02;
1159 this.m12 = T12;
1160 M0 = this.m00;
1161 this.m00 = M0 * T00;
1162 this.m10 = M0 * T10;
1163 M0 = this.m11;
1164 this.m01 = M0 * T01;
1165 this.m11 = M0 * T11;
1166 break;
1167 case (1):
1168 M0 = this.m02;
1169 M1 = this.m12;
1170 T02 += M0 * T00 + M1 * T01;
1171 T12 += M0 * T10 + M1 * T11;
1172 case (0):
1173 this.m02 = T02;
1174 this.m12 = T12;
1175 this.m00 = T00;
1176 this.m10 = T10;
1177 this.m01 = T01;
1178 this.m11 = T11;
1179 this.state = mystate | txstate;
1180 this.type = -1;
1181 return;
1182 }
1183 this.updateState ();
1184 }, "java.awt.geom.AffineTransform");
1185 Clazz.defineMethod (c$, "createInverse", 
1186 function () {
1187 var det;
1188 switch (this.state) {
1189 default:
1190 this.stateError ();
1191 case (7):
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));
1196 case (6):
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));
1201 case (5):
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));
1205 case (4):
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));
1209 case (3):
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));
1213 case (2):
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));
1217 case (1):
1218 return  new java.awt.geom.AffineTransform (1.0, 0.0, 0.0, 1.0, -this.m02, -this.m12, (1));
1219 case (0):
1220 return  new java.awt.geom.AffineTransform ();
1221 }
1222 });
1223 Clazz.defineMethod (c$, "invert", 
1224 function () {
1225 var M00;
1226 var M01;
1227 var M02;
1228 var M10;
1229 var M11;
1230 var M12;
1231 var det;
1232 switch (this.state) {
1233 default:
1234 this.stateError ();
1235 case (7):
1236 M00 = this.m00;
1237 M01 = this.m01;
1238 M02 = this.m02;
1239 M10 = this.m10;
1240 M11 = this.m11;
1241 M12 = this.m12;
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;
1251 break;
1252 case (6):
1253 M00 = this.m00;
1254 M01 = this.m01;
1255 M10 = this.m10;
1256 M11 = this.m11;
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;
1264 break;
1265 case (5):
1266 M01 = this.m01;
1267 M02 = this.m02;
1268 M10 = this.m10;
1269 M12 = this.m12;
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;
1276 break;
1277 case (4):
1278 M01 = this.m01;
1279 M10 = this.m10;
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;
1284 break;
1285 case (3):
1286 M00 = this.m00;
1287 M02 = this.m02;
1288 M11 = this.m11;
1289 M12 = this.m12;
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;
1296 break;
1297 case (2):
1298 M00 = this.m00;
1299 M11 = this.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;
1304 break;
1305 case (1):
1306 this.m02 = -this.m02;
1307 this.m12 = -this.m12;
1308 break;
1309 case (0):
1310 break;
1311 }
1312 });
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 ();
1318 } else {
1319 ptDst =  new java.awt.geom.Point2D.Float ();
1320 }}var x = ptSrc.getX ();
1321 var y = ptSrc.getY ();
1322 switch (this.state) {
1323 default:
1324 this.stateError ();
1325 case (7):
1326 ptDst.setLocation (x * this.m00 + y * this.m01 + this.m02, x * this.m10 + y * this.m11 + this.m12);
1327 return ptDst;
1328 case (6):
1329 ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11);
1330 return ptDst;
1331 case (5):
1332 ptDst.setLocation (y * this.m01 + this.m02, x * this.m10 + this.m12);
1333 return ptDst;
1334 case (4):
1335 ptDst.setLocation (y * this.m01, x * this.m10);
1336 return ptDst;
1337 case (3):
1338 ptDst.setLocation (x * this.m00 + this.m02, y * this.m11 + this.m12);
1339 return ptDst;
1340 case (2):
1341 ptDst.setLocation (x * this.m00, y * this.m11);
1342 return ptDst;
1343 case (1):
1344 ptDst.setLocation (x + this.m02, y + this.m12);
1345 return ptDst;
1346 case (0):
1347 ptDst.setLocation (x, y);
1348 return ptDst;
1349 }
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)) {
1355 var src = srcPts;
1356 var dst = dstPts;
1357 this.transform (src, srcOff, dst, dstOff, numPts);
1358 return;
1359 }var M00;
1360 var M01;
1361 var M02;
1362 var M10;
1363 var M11;
1364 var M12;
1365 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1366 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1367 srcOff = dstOff;
1368 }switch (this.state) {
1369 default:
1370 this.stateError ();
1371 case (7):
1372 M00 = this.m00;
1373 M01 = this.m01;
1374 M02 = this.m02;
1375 M10 = this.m10;
1376 M11 = this.m11;
1377 M12 = this.m12;
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;
1383 }
1384 return;
1385 case (6):
1386 M00 = this.m00;
1387 M01 = this.m01;
1388 M10 = this.m10;
1389 M11 = this.m11;
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;
1395 }
1396 return;
1397 case (5):
1398 M01 = this.m01;
1399 M02 = this.m02;
1400 M10 = this.m10;
1401 M12 = this.m12;
1402 while (--numPts >= 0) {
1403 var x = srcPts[srcOff++];
1404 dstPts[dstOff++] = M01 * srcPts[srcOff++] + M02;
1405 dstPts[dstOff++] = M10 * x + M12;
1406 }
1407 return;
1408 case (4):
1409 M01 = this.m01;
1410 M10 = this.m10;
1411 while (--numPts >= 0) {
1412 var x = srcPts[srcOff++];
1413 dstPts[dstOff++] = M01 * srcPts[srcOff++];
1414 dstPts[dstOff++] = M10 * x;
1415 }
1416 return;
1417 case (3):
1418 M00 = this.m00;
1419 M02 = this.m02;
1420 M11 = this.m11;
1421 M12 = this.m12;
1422 while (--numPts >= 0) {
1423 dstPts[dstOff++] = M00 * srcPts[srcOff++] + M02;
1424 dstPts[dstOff++] = M11 * srcPts[srcOff++] + M12;
1425 }
1426 return;
1427 case (2):
1428 M00 = this.m00;
1429 M11 = this.m11;
1430 while (--numPts >= 0) {
1431 dstPts[dstOff++] = M00 * srcPts[srcOff++];
1432 dstPts[dstOff++] = M11 * srcPts[srcOff++];
1433 }
1434 return;
1435 case (1):
1436 M02 = this.m02;
1437 M12 = this.m12;
1438 while (--numPts >= 0) {
1439 dstPts[dstOff++] = srcPts[srcOff++] + M02;
1440 dstPts[dstOff++] = srcPts[srcOff++] + M12;
1441 }
1442 return;
1443 case (0):
1444 if (srcPts !== dstPts || srcOff != dstOff) {
1445 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1446 }return;
1447 }
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 ();
1454 } else {
1455 ptDst =  new java.awt.geom.Point2D.Float ();
1456 }}var x = ptSrc.getX ();
1457 var y = ptSrc.getY ();
1458 switch (this.state) {
1459 default:
1460 this.stateError ();
1461 case (7):
1462 x -= this.m02;
1463 y -= this.m12;
1464 case (6):
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);
1469 return ptDst;
1470 case (5):
1471 x -= this.m02;
1472 y -= this.m12;
1473 case (4):
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);
1477 return ptDst;
1478 case (3):
1479 x -= this.m02;
1480 y -= this.m12;
1481 case (2):
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);
1485 return ptDst;
1486 case (1):
1487 ptDst.setLocation (x - this.m02, y - this.m12);
1488 return ptDst;
1489 case (0):
1490 ptDst.setLocation (x, y);
1491 return ptDst;
1492 }
1493 }, "java.awt.geom.Point2D,java.awt.geom.Point2D");
1494 Clazz.defineMethod (c$, "inverseTransform", 
1495 function (srcPts, srcOff, dstPts, dstOff, numPts) {
1496 var M00;
1497 var M01;
1498 var M02;
1499 var M10;
1500 var M11;
1501 var M12;
1502 var det;
1503 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1504 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1505 srcOff = dstOff;
1506 }switch (this.state) {
1507 default:
1508 this.stateError ();
1509 case (7):
1510 M00 = this.m00;
1511 M01 = this.m01;
1512 M02 = this.m02;
1513 M10 = this.m10;
1514 M11 = this.m11;
1515 M12 = this.m12;
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;
1524 }
1525 return;
1526 case (6):
1527 M00 = this.m00;
1528 M01 = this.m01;
1529 M10 = this.m10;
1530 M11 = this.m11;
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;
1539 }
1540 return;
1541 case (5):
1542 M01 = this.m01;
1543 M02 = this.m02;
1544 M10 = this.m10;
1545 M12 = this.m12;
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;
1552 }
1553 return;
1554 case (4):
1555 M01 = this.m01;
1556 M10 = this.m10;
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;
1563 }
1564 return;
1565 case (3):
1566 M00 = this.m00;
1567 M02 = this.m02;
1568 M11 = this.m11;
1569 M12 = this.m12;
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;
1575 }
1576 return;
1577 case (2):
1578 M00 = this.m00;
1579 M11 = this.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;
1585 }
1586 return;
1587 case (1):
1588 M02 = this.m02;
1589 M12 = this.m12;
1590 while (--numPts >= 0) {
1591 dstPts[dstOff++] = srcPts[srcOff++] - M02;
1592 dstPts[dstOff++] = srcPts[srcOff++] - M12;
1593 }
1594 return;
1595 case (0):
1596 if (srcPts !== dstPts || srcOff != dstOff) {
1597 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1598 }return;
1599 }
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 ();
1606 } else {
1607 ptDst =  new java.awt.geom.Point2D.Float ();
1608 }}var x = ptSrc.getX ();
1609 var y = ptSrc.getY ();
1610 switch (this.state) {
1611 default:
1612 this.stateError ();
1613 case (7):
1614 case (6):
1615 ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11);
1616 return ptDst;
1617 case (5):
1618 case (4):
1619 ptDst.setLocation (y * this.m01, x * this.m10);
1620 return ptDst;
1621 case (3):
1622 case (2):
1623 ptDst.setLocation (x * this.m00, y * this.m11);
1624 return ptDst;
1625 case (1):
1626 case (0):
1627 ptDst.setLocation (x, y);
1628 return ptDst;
1629 }
1630 }, "java.awt.geom.Point2D,java.awt.geom.Point2D");
1631 Clazz.defineMethod (c$, "deltaTransform", 
1632 function (srcPts, srcOff, dstPts, dstOff, numPts) {
1633 var M00;
1634 var M01;
1635 var M10;
1636 var M11;
1637 if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) {
1638 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1639 srcOff = dstOff;
1640 }switch (this.state) {
1641 default:
1642 this.stateError ();
1643 case (7):
1644 case (6):
1645 M00 = this.m00;
1646 M01 = this.m01;
1647 M10 = this.m10;
1648 M11 = this.m11;
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;
1654 }
1655 return;
1656 case (5):
1657 case (4):
1658 M01 = this.m01;
1659 M10 = this.m10;
1660 while (--numPts >= 0) {
1661 var x = srcPts[srcOff++];
1662 dstPts[dstOff++] = srcPts[srcOff++] * M01;
1663 dstPts[dstOff++] = x * M10;
1664 }
1665 return;
1666 case (3):
1667 case (2):
1668 M00 = this.m00;
1669 M11 = this.m11;
1670 while (--numPts >= 0) {
1671 dstPts[dstOff++] = srcPts[srcOff++] * M00;
1672 dstPts[dstOff++] = srcPts[srcOff++] * M11;
1673 }
1674 return;
1675 case (1):
1676 case (0):
1677 if (srcPts !== dstPts || srcOff != dstOff) {
1678 System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2);
1679 }return;
1680 }
1681 }, "~A,~N,~A,~N,~N");
1682 Clazz.defineMethod (c$, "createTransformedShape", 
1683 function (pSrc) {
1684 if (pSrc == null) {
1685 return null;
1686 }return  new java.awt.geom.Path2D.Double (pSrc, this);
1687 }, "java.awt.Shape");
1688 c$._matround = Clazz.defineMethod (c$, "_matround", 
1689  function (matval) {
1690 return Math.rint (matval * 1E15) / 1E15;
1691 }, "~N");
1692 Clazz.overrideMethod (c$, "toString", 
1693 function () {
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) + "]]");
1695 });
1696 Clazz.defineMethod (c$, "isIdentity", 
1697 function () {
1698 return (this.state == 0 || (this.getType () == 0));
1699 });
1700 Clazz.defineMethod (c$, "clone", 
1701 function () {
1702 try {
1703 return Clazz.superCall (this, java.awt.geom.AffineTransform, "clone", []);
1704 } catch (e) {
1705 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
1706 throw  new InternalError ();
1707 } else {
1708 throw e;
1709 }
1710 }
1711 });
1712 Clazz.overrideMethod (c$, "hashCode", 
1713 function () {
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)));
1721 });
1722 Clazz.overrideMethod (c$, "equals", 
1723 function (obj) {
1724 if (!(Clazz.instanceOf (obj, java.awt.geom.AffineTransform))) {
1725 return false;
1726 }var a = obj;
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));
1728 }, "~O");
1729 Clazz.defineStatics (c$,
1730 "TYPE_UNKNOWN", -1,
1731 "TYPE_IDENTITY", 0,
1732 "TYPE_TRANSLATION", 1,
1733 "TYPE_UNIFORM_SCALE", 2,
1734 "TYPE_GENERAL_SCALE", 4,
1735 "TYPE_MASK_SCALE", (6),
1736 "TYPE_FLIP", 64,
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,
1743 "APPLY_SCALE", 2,
1744 "APPLY_SHEAR", 4,
1745 "HI_SHIFT", 3,
1746 "HI_IDENTITY", 0,
1747 "HI_TRANSLATE", 8,
1748 "HI_SCALE", 16,
1749 "HI_SHEAR", 32,
1750 "rot90conversion",  Clazz.newIntArray (-1, [4, 5, 4, 5, 2, 3, 6, 7]));
1751 });