Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / geom / Path2D.js
1 Clazz.declarePackage ("java.awt.geom");
2 Clazz.load (["java.awt.Shape", "java.awt.geom.PathIterator"], "java.awt.geom.Path2D", ["java.lang.Double", "$.IllegalArgumentException", "java.util.Arrays", "java.awt.geom.FlatteningPathIterator", "$.IllegalPathStateException", "$.Point2D", "$.Rectangle2D", "jssun.awt.geom.Curve"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.pointTypes = null;
5 this.numTypes = 0;
6 this.numCoords = 0;
7 this.windingRule = 0;
8 Clazz.instantialize (this, arguments);
9 }, java.awt.geom, "Path2D", null, [java.awt.Shape, Cloneable]);
10 Clazz.makeConstructor (c$, 
11 function () {
12 });
13 Clazz.makeConstructor (c$, 
14 function (rule, initialTypes) {
15 this.setWindingRule (rule);
16 this.pointTypes =  Clazz.newByteArray (initialTypes, 0);
17 }, "~N,~N");
18 Clazz.defineMethod (c$, "closePath", 
19 function () {
20 if (this.numTypes == 0 || this.pointTypes[this.numTypes - 1] != 4) {
21 this.needRoom (true, 0);
22 this.pointTypes[this.numTypes++] = 4;
23 }});
24 Clazz.defineMethod (c$, "append", 
25 function (s, connect) {
26 this.append (s.getPathIterator (null), connect);
27 }, "java.awt.Shape,~B");
28 Clazz.defineMethod (c$, "getWindingRule", 
29 function () {
30 return this.windingRule;
31 });
32 Clazz.defineMethod (c$, "setWindingRule", 
33 function (rule) {
34 if (rule != 0 && rule != 1) {
35 throw  new IllegalArgumentException ("winding rule must be WIND_EVEN_ODD or WIND_NON_ZERO");
36 }this.windingRule = rule;
37 }, "~N");
38 Clazz.defineMethod (c$, "getCurrentPoint", 
39 function () {
40 var index = this.numCoords;
41 if (this.numTypes < 1 || index < 1) {
42 return null;
43 }if (this.pointTypes[this.numTypes - 1] == 4) {
44 loop : for (var i = this.numTypes - 2; i > 0; i--) {
45 switch (this.pointTypes[i]) {
46 case 0:
47 break loop;
48 case 1:
49 index -= 2;
50 break;
51 case 2:
52 index -= 4;
53 break;
54 case 3:
55 index -= 6;
56 break;
57 case 4:
58 break;
59 }
60 }
61 }return this.getPoint (index - 2);
62 });
63 Clazz.defineMethod (c$, "reset", 
64 function () {
65 this.numTypes = this.numCoords = 0;
66 });
67 Clazz.defineMethod (c$, "createTransformedShape", 
68 function (at) {
69 var p2d = this.clone ();
70 if (at != null) {
71 p2d.transform (at);
72 }return p2d;
73 }, "java.awt.geom.AffineTransform");
74 Clazz.overrideMethod (c$, "getBounds", 
75 function () {
76 return this.getBounds2D ().getBounds ();
77 });
78 c$.contains = Clazz.defineMethod (c$, "contains", 
79 function (pi, x, y) {
80 if (x * 0.0 + y * 0.0 == 0.0) {
81 var mask = (pi.getWindingRule () == 1 ? -1 : 1);
82 var cross = jssun.awt.geom.Curve.pointCrossingsForPath (pi, x, y);
83 return ((cross & mask) != 0);
84 } else {
85 return false;
86 }}, "java.awt.geom.PathIterator,~N,~N");
87 c$.contains = Clazz.defineMethod (c$, "contains", 
88 function (pi, p) {
89 return java.awt.geom.Path2D.contains (pi, p.getX (), p.getY ());
90 }, "java.awt.geom.PathIterator,java.awt.geom.Point2D");
91 Clazz.defineMethod (c$, "contains", 
92 function (x, y) {
93 if (x * 0.0 + y * 0.0 == 0.0) {
94 if (this.numTypes < 2) {
95 return false;
96 }var mask = (this.windingRule == 1 ? -1 : 1);
97 return ((this.pointCrossings (x, y) & mask) != 0);
98 } else {
99 return false;
100 }}, "~N,~N");
101 Clazz.defineMethod (c$, "contains", 
102 function (p) {
103 return this.contains (p.getX (), p.getY ());
104 }, "java.awt.geom.Point2D");
105 c$.contains = Clazz.defineMethod (c$, "contains", 
106 function (pi, x, y, w, h) {
107 if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) {
108 return false;
109 }if (w <= 0 || h <= 0) {
110 return false;
111 }var mask = (pi.getWindingRule () == 1 ? -1 : 2);
112 var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h);
113 return (crossings != -2147483648 && (crossings & mask) != 0);
114 }, "java.awt.geom.PathIterator,~N,~N,~N,~N");
115 c$.contains = Clazz.defineMethod (c$, "contains", 
116 function (pi, r) {
117 return java.awt.geom.Path2D.contains (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ());
118 }, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D");
119 Clazz.defineMethod (c$, "contains", 
120 function (x, y, w, h) {
121 if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) {
122 return false;
123 }if (w <= 0 || h <= 0) {
124 return false;
125 }var mask = (this.windingRule == 1 ? -1 : 2);
126 var crossings = this.rectCrossings (x, y, x + w, y + h);
127 return (crossings != -2147483648 && (crossings & mask) != 0);
128 }, "~N,~N,~N,~N");
129 Clazz.defineMethod (c$, "contains", 
130 function (r) {
131 return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
132 }, "java.awt.geom.Rectangle2D");
133 c$.intersects = Clazz.defineMethod (c$, "intersects", 
134 function (pi, x, y, w, h) {
135 if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) {
136 return false;
137 }if (w <= 0 || h <= 0) {
138 return false;
139 }var mask = (pi.getWindingRule () == 1 ? -1 : 2);
140 var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h);
141 return (crossings == -2147483648 || (crossings & mask) != 0);
142 }, "java.awt.geom.PathIterator,~N,~N,~N,~N");
143 c$.intersects = Clazz.defineMethod (c$, "intersects", 
144 function (pi, r) {
145 return java.awt.geom.Path2D.intersects (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ());
146 }, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D");
147 Clazz.defineMethod (c$, "intersects", 
148 function (x, y, w, h) {
149 if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) {
150 return false;
151 }if (w <= 0 || h <= 0) {
152 return false;
153 }var mask = (this.windingRule == 1 ? -1 : 2);
154 var crossings = this.rectCrossings (x, y, x + w, y + h);
155 return (crossings == -2147483648 || (crossings & mask) != 0);
156 }, "~N,~N,~N,~N");
157 Clazz.defineMethod (c$, "intersects", 
158 function (r) {
159 return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ());
160 }, "java.awt.geom.Rectangle2D");
161 Clazz.overrideMethod (c$, "getPathIterator", 
162 function (at, flatness) {
163 return  new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness);
164 }, "java.awt.geom.AffineTransform,~N");
165 Clazz.pu$h(self.c$);
166 c$ = Clazz.decorateAsClass (function () {
167 this.typeIdx = 0;
168 this.pointIdx = 0;
169 this.path = null;
170 Clazz.instantialize (this, arguments);
171 }, java.awt.geom.Path2D, "Iterator", null, java.awt.geom.PathIterator);
172 Clazz.makeConstructor (c$, 
173 function (a) {
174 this.path = a;
175 }, "java.awt.geom.Path2D");
176 Clazz.overrideMethod (c$, "getWindingRule", 
177 function () {
178 return this.path.getWindingRule ();
179 });
180 Clazz.overrideMethod (c$, "isDone", 
181 function () {
182 return (this.typeIdx >= this.path.numTypes);
183 });
184 Clazz.overrideMethod (c$, "next", 
185 function () {
186 var a = this.path.pointTypes[this.typeIdx++];
187 this.pointIdx += java.awt.geom.Path2D.Iterator.curvecoords[a];
188 });
189 Clazz.defineStatics (c$,
190 "curvecoords",  Clazz.newIntArray (-1, [2, 2, 4, 6, 0]));
191 c$ = Clazz.p0p ();
192 Clazz.pu$h(self.c$);
193 c$ = Clazz.decorateAsClass (function () {
194 this.floatCoords = null;
195 Clazz.instantialize (this, arguments);
196 }, java.awt.geom.Path2D, "Float", java.awt.geom.Path2D);
197 Clazz.makeConstructor (c$, 
198 function () {
199 this.construct (1, 20);
200 });
201 Clazz.makeConstructor (c$, 
202 function (a) {
203 this.construct (a, 20);
204 }, "~N");
205 Clazz.makeConstructor (c$, 
206 function (a, b) {
207 Clazz.superConstructor (this, java.awt.geom.Path2D.Float, []);
208 this.setWindingRule (a);
209 this.pointTypes =  Clazz.newByteArray (b, 0);
210 this.floatCoords =  Clazz.newFloatArray (b * 2, 0);
211 }, "~N,~N");
212 Clazz.makeConstructor (c$, 
213 function (a) {
214 this.construct (a, null);
215 }, "java.awt.Shape");
216 Clazz.makeConstructor (c$, 
217 function (a, b) {
218 Clazz.superConstructor (this, java.awt.geom.Path2D.Float, []);
219 this.setPath (a, b);
220 }, "java.awt.Shape,java.awt.geom.AffineTransform");
221 Clazz.defineMethod (c$, "setPath", 
222  function (a, b) {
223 if (Clazz.instanceOf (a, java.awt.geom.Path2D)) {
224 var c = a;
225 this.setWindingRule (c.windingRule);
226 this.numTypes = c.numTypes;
227 this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length);
228 this.numCoords = c.numCoords;
229 this.floatCoords = c.cloneCoordsFloat (b);
230 } else {
231 var c = a.getPathIterator (b);
232 this.setWindingRule (c.getWindingRule ());
233 this.pointTypes =  Clazz.newByteArray (20, 0);
234 this.floatCoords =  Clazz.newFloatArray (40, 0);
235 this.append (c, false);
236 }}, "java.awt.Shape,java.awt.geom.AffineTransform");
237 Clazz.defineMethod (c$, "cloneCoordsFloat", 
238 function (a) {
239 var b;
240 if (a == null) {
241 b = java.util.Arrays.copyOf (this.floatCoords, this.floatCoords.length);
242 } else {
243 b =  Clazz.newFloatArray (this.floatCoords.length, 0);
244 a.transform (this.floatCoords, 0, b, 0, Clazz.doubleToInt (this.numCoords / 2));
245 }return b;
246 }, "java.awt.geom.AffineTransform");
247 Clazz.overrideMethod (c$, "cloneCoordsDouble", 
248 function (a) {
249 var b =  Clazz.newDoubleArray (this.floatCoords.length, 0);
250 if (a == null) {
251 for (var c = 0; c < this.numCoords; c++) {
252 b[c] = this.floatCoords[c];
253 }
254 } else {
255 a.transform (this.floatCoords, 0, b, 0, Clazz.doubleToInt (this.numCoords / 2));
256 }return b;
257 }, "java.awt.geom.AffineTransform");
258 Clazz.defineMethod (c$, "append", 
259 function (a, b) {
260 {
261 if (typeof pi == "number") {
262 this.floatCoords[this.numCoords++] = pi;
263 this.floatCoords[this.numCoords++] = connect;
264 return;
265 }
266 }var c =  Clazz.newFloatArray (6, 0);
267 while (!a.isDone ()) {
268 switch (a.currentSegment (c)) {
269 case 0:
270 if (!b || this.numTypes < 1 || this.numCoords < 1) {
271 this.moveTo (c[0], c[1]);
272 break;
273 }if (this.pointTypes[this.numTypes - 1] != 4 && this.floatCoords[this.numCoords - 2] == c[0] && this.floatCoords[this.numCoords - 1] == c[1]) {
274 break;
275 }case 1:
276 this.lineTo (c[0], c[1]);
277 break;
278 case 2:
279 this.quadTo (c[0], c[1], c[2], c[3]);
280 break;
281 case 3:
282 this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]);
283 break;
284 case 4:
285 this.closePath ();
286 break;
287 }
288 a.next ();
289 b = false;
290 }
291 }, "java.awt.geom.PathIterator,~B");
292 Clazz.overrideMethod (c$, "getPoint", 
293 function (a) {
294 return  new java.awt.geom.Point2D.Float (this.floatCoords[a], this.floatCoords[a + 1]);
295 }, "~N");
296 Clazz.overrideMethod (c$, "needRoom", 
297 function (a, b) {
298 if (a && this.numTypes == 0) {
299 throw  new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition");
300 }var c = this.pointTypes.length;
301 if (this.numTypes >= c) {
302 var d = c;
303 if (d > 500) {
304 d = 500;
305 }this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d);
306 }c = this.floatCoords.length;
307 if (this.numCoords + b > c) {
308 var d = c;
309 if (d > 1000) {
310 d = 1000;
311 }if (d < b) {
312 d = b;
313 }this.floatCoords = java.util.Arrays.copyOf (this.floatCoords, c + d);
314 }}, "~B,~N");
315 Clazz.defineMethod (c$, "moveTo", 
316 function (a, b) {
317 if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) {
318 this.floatCoords[this.numCoords - 2] = a;
319 this.floatCoords[this.numCoords - 1] = b;
320 } else {
321 this.needRoom (false, 2);
322 this.pointTypes[this.numTypes++] = 0;
323 this.floatCoords[this.numCoords++] = a;
324 this.floatCoords[this.numCoords++] = b;
325 }}, "~N,~N");
326 Clazz.defineMethod (c$, "moveTo", 
327 function (a, b) {
328 if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) {
329 this.floatCoords[this.numCoords - 2] = a;
330 this.floatCoords[this.numCoords - 1] = b;
331 } else {
332 this.needRoom (false, 2);
333 this.pointTypes[this.numTypes++] = 0;
334 this.floatCoords[this.numCoords++] = a;
335 this.floatCoords[this.numCoords++] = b;
336 }}, "~N,~N");
337 Clazz.defineMethod (c$, "lineTo", 
338 function (a, b) {
339 this.needRoom (true, 2);
340 this.pointTypes[this.numTypes++] = 1;
341 this.floatCoords[this.numCoords++] = a;
342 this.floatCoords[this.numCoords++] = b;
343 }, "~N,~N");
344 Clazz.defineMethod (c$, "lineTo", 
345 function (a, b) {
346 this.needRoom (true, 2);
347 this.pointTypes[this.numTypes++] = 1;
348 this.floatCoords[this.numCoords++] = a;
349 this.floatCoords[this.numCoords++] = b;
350 }, "~N,~N");
351 Clazz.defineMethod (c$, "quadTo", 
352 function (a, b, c, d) {
353 this.needRoom (true, 4);
354 this.pointTypes[this.numTypes++] = 2;
355 this.floatCoords[this.numCoords++] = a;
356 this.floatCoords[this.numCoords++] = b;
357 this.floatCoords[this.numCoords++] = c;
358 this.floatCoords[this.numCoords++] = d;
359 }, "~N,~N,~N,~N");
360 Clazz.defineMethod (c$, "quadTo", 
361 function (a, b, c, d) {
362 this.needRoom (true, 4);
363 this.pointTypes[this.numTypes++] = 2;
364 this.floatCoords[this.numCoords++] = a;
365 this.floatCoords[this.numCoords++] = b;
366 this.floatCoords[this.numCoords++] = c;
367 this.floatCoords[this.numCoords++] = d;
368 }, "~N,~N,~N,~N");
369 Clazz.defineMethod (c$, "curveTo", 
370 function (a, b, c, d, e, f) {
371 this.needRoom (true, 6);
372 this.pointTypes[this.numTypes++] = 3;
373 this.floatCoords[this.numCoords++] = a;
374 this.floatCoords[this.numCoords++] = b;
375 this.floatCoords[this.numCoords++] = c;
376 this.floatCoords[this.numCoords++] = d;
377 this.floatCoords[this.numCoords++] = e;
378 this.floatCoords[this.numCoords++] = f;
379 }, "~N,~N,~N,~N,~N,~N");
380 Clazz.defineMethod (c$, "curveTo", 
381 function (a, b, c, d, e, f) {
382 this.needRoom (true, 6);
383 this.pointTypes[this.numTypes++] = 3;
384 this.floatCoords[this.numCoords++] = a;
385 this.floatCoords[this.numCoords++] = b;
386 this.floatCoords[this.numCoords++] = c;
387 this.floatCoords[this.numCoords++] = d;
388 this.floatCoords[this.numCoords++] = e;
389 this.floatCoords[this.numCoords++] = f;
390 }, "~N,~N,~N,~N,~N,~N");
391 Clazz.overrideMethod (c$, "pointCrossings", 
392 function (a, b) {
393 var c;
394 var d;
395 var e;
396 var f;
397 var g;
398 var h;
399 var i = this.floatCoords;
400 e = c = i[0];
401 f = d = i[1];
402 var j = 0;
403 var k = 2;
404 for (var l = 1; l < this.numTypes; l++) {
405 switch (this.pointTypes[l]) {
406 case 0:
407 if (f != d) {
408 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
409 }c = e = i[k++];
410 d = f = i[k++];
411 break;
412 case 1:
413 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]);
414 e = g;
415 f = h;
416 break;
417 case 2:
418 j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0);
419 e = g;
420 f = h;
421 break;
422 case 3:
423 j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0);
424 e = g;
425 f = h;
426 break;
427 case 4:
428 if (f != d) {
429 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
430 }e = c;
431 f = d;
432 break;
433 }
434 }
435 if (f != d) {
436 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
437 }return j;
438 }, "~N,~N");
439 Clazz.overrideMethod (c$, "rectCrossings", 
440 function (a, b, c, d) {
441 var e = this.floatCoords;
442 var f;
443 var g;
444 var h;
445 var i;
446 var j;
447 var k;
448 f = h = e[0];
449 g = i = e[1];
450 var l = 0;
451 var m = 2;
452 for (var n = 1; l != -2147483648 && n < this.numTypes; n++) {
453 switch (this.pointTypes[n]) {
454 case 0:
455 if (f != h || g != i) {
456 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
457 }h = f = e[m++];
458 i = g = e[m++];
459 break;
460 case 1:
461 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j = e[m++], k = e[m++]);
462 f = j;
463 g = k;
464 break;
465 case 2:
466 l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0);
467 f = j;
468 g = k;
469 break;
470 case 3:
471 l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0);
472 f = j;
473 g = k;
474 break;
475 case 4:
476 if (f != h || g != i) {
477 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
478 }f = h;
479 g = i;
480 break;
481 }
482 }
483 if (l != -2147483648 && (f != h || g != i)) {
484 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
485 }return l;
486 }, "~N,~N,~N,~N");
487 Clazz.overrideMethod (c$, "transform", 
488 function (a) {
489 a.transform (this.floatCoords, 0, this.floatCoords, 0, Clazz.doubleToInt (this.numCoords / 2));
490 }, "java.awt.geom.AffineTransform");
491 Clazz.overrideMethod (c$, "getBounds2D", 
492 function () {
493 var a;
494 var b;
495 var c;
496 var d;
497 var e = this.numCoords;
498 if (e > 0) {
499 b = d = this.floatCoords[--e];
500 a = c = this.floatCoords[--e];
501 while (e > 0) {
502 var f = this.floatCoords[--e];
503 var g = this.floatCoords[--e];
504 if (g < a) a = g;
505 if (f < b) b = f;
506 if (g > c) c = g;
507 if (f > d) d = f;
508 }
509 } else {
510 a = b = c = d = 0.0;
511 }return  new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b);
512 });
513 Clazz.defineMethod (c$, "getPathIterator", 
514 function (a) {
515 if (a == null) {
516 return  new java.awt.geom.Path2D.Float.CopyIterator (this);
517 } else {
518 return  new java.awt.geom.Path2D.Float.TxIterator (this, a);
519 }}, "java.awt.geom.AffineTransform");
520 Clazz.overrideMethod (c$, "clone", 
521 function () {
522 return  new java.awt.geom.Path2D.Float (this);
523 });
524 Clazz.pu$h(self.c$);
525 c$ = Clazz.decorateAsClass (function () {
526 this.floatCoords = null;
527 Clazz.instantialize (this, arguments);
528 }, java.awt.geom.Path2D.Float, "CopyIterator", java.awt.geom.Path2D.Iterator);
529 Clazz.makeConstructor (c$, 
530 function (a) {
531 Clazz.superConstructor (this, java.awt.geom.Path2D.Float.CopyIterator, [a]);
532 this.floatCoords = a.floatCoords;
533 }, "java.awt.geom.Path2D.Float");
534 Clazz.defineMethod (c$, "currentSegment", 
535 function (a) {
536 var b = this.path.pointTypes[this.typeIdx];
537 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
538 if (c > 0) {
539 for (var d = 0; d < c; d++) {
540 a[d] = this.floatCoords[this.pointIdx + d];
541 }
542 }return b;
543 }, "~A");
544 c$ = Clazz.p0p ();
545 Clazz.pu$h(self.c$);
546 c$ = Clazz.decorateAsClass (function () {
547 this.floatCoords = null;
548 this.affine = null;
549 Clazz.instantialize (this, arguments);
550 }, java.awt.geom.Path2D.Float, "TxIterator", java.awt.geom.Path2D.Iterator);
551 Clazz.makeConstructor (c$, 
552 function (a, b) {
553 Clazz.superConstructor (this, java.awt.geom.Path2D.Float.TxIterator, [a]);
554 this.floatCoords = a.floatCoords;
555 this.affine = b;
556 }, "java.awt.geom.Path2D.Float,java.awt.geom.AffineTransform");
557 Clazz.defineMethod (c$, "currentSegment", 
558 function (a) {
559 var b = this.path.pointTypes[this.typeIdx];
560 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
561 if (c > 0) {
562 this.affine.transform (this.floatCoords, this.pointIdx, a, 0, Clazz.doubleToInt (c / 2));
563 }return b;
564 }, "~A");
565 c$ = Clazz.p0p ();
566 c$ = Clazz.p0p ();
567 Clazz.pu$h(self.c$);
568 c$ = Clazz.decorateAsClass (function () {
569 this.doubleCoords = null;
570 Clazz.instantialize (this, arguments);
571 }, java.awt.geom.Path2D, "Double", java.awt.geom.Path2D);
572 Clazz.makeConstructor (c$, 
573 function () {
574 this.construct (1, 20);
575 });
576 Clazz.makeConstructor (c$, 
577 function (a) {
578 this.construct (a, 20);
579 }, "~N");
580 Clazz.makeConstructor (c$, 
581 function (a, b) {
582 Clazz.superConstructor (this, java.awt.geom.Path2D.Double, [a, b]);
583 this.doubleCoords =  Clazz.newDoubleArray (b * 2, 0);
584 }, "~N,~N");
585 Clazz.makeConstructor (c$, 
586 function (a) {
587 this.construct (a, null);
588 }, "java.awt.Shape");
589 Clazz.makeConstructor (c$, 
590 function (a, b) {
591 Clazz.superConstructor (this, java.awt.geom.Path2D.Double, []);
592 if (Clazz.instanceOf (a, java.awt.geom.Path2D)) {
593 var c = a;
594 this.setWindingRule (c.windingRule);
595 this.numTypes = c.numTypes;
596 this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length);
597 this.numCoords = c.numCoords;
598 this.doubleCoords = c.cloneCoordsDouble (b);
599 } else {
600 var c = a.getPathIterator (b);
601 this.setWindingRule (c.getWindingRule ());
602 this.pointTypes =  Clazz.newByteArray (20, 0);
603 this.doubleCoords =  Clazz.newDoubleArray (40, 0);
604 this.append (c, false);
605 }}, "java.awt.Shape,java.awt.geom.AffineTransform");
606 Clazz.overrideMethod (c$, "cloneCoordsFloat", 
607 function (a) {
608 var b =  Clazz.newFloatArray (this.doubleCoords.length, 0);
609 if (a == null) {
610 for (var c = 0; c < this.numCoords; c++) {
611 b[c] = this.doubleCoords[c];
612 }
613 } else {
614 a.transform (this.doubleCoords, 0, b, 0, Clazz.doubleToInt (this.numCoords / 2));
615 }return b;
616 }, "java.awt.geom.AffineTransform");
617 Clazz.defineMethod (c$, "cloneCoordsDouble", 
618 function (a) {
619 var b;
620 if (a == null) {
621 b = java.util.Arrays.copyOf (this.doubleCoords, this.doubleCoords.length);
622 } else {
623 b =  Clazz.newDoubleArray (this.doubleCoords.length, 0);
624 a.transform (this.doubleCoords, 0, b, 0, Clazz.doubleToInt (this.numCoords / 2));
625 }return b;
626 }, "java.awt.geom.AffineTransform");
627 Clazz.defineMethod (c$, "append", 
628 function (a, b) {
629 {
630 if (typeof pi == "number") {
631 this.floatCoords[this.numCoords++] = pi;
632 this.floatCoords[this.numCoords++] = connect;
633 return;
634 }
635 }var c =  Clazz.newDoubleArray (6, 0);
636 while (!a.isDone ()) {
637 switch (a.currentSegment (c)) {
638 case 0:
639 if (!b || this.numTypes < 1 || this.numCoords < 1) {
640 this.moveTo (c[0], c[1]);
641 break;
642 }if (this.pointTypes[this.numTypes - 1] != 4 && this.doubleCoords[this.numCoords - 2] == c[0] && this.doubleCoords[this.numCoords - 1] == c[1]) {
643 break;
644 }case 1:
645 this.lineTo (c[0], c[1]);
646 break;
647 case 2:
648 this.quadTo (c[0], c[1], c[2], c[3]);
649 break;
650 case 3:
651 this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]);
652 break;
653 case 4:
654 this.closePath ();
655 break;
656 }
657 a.next ();
658 b = false;
659 }
660 }, "java.awt.geom.PathIterator,~B");
661 Clazz.overrideMethod (c$, "getPoint", 
662 function (a) {
663 return  new java.awt.geom.Point2D.Double (this.doubleCoords[a], this.doubleCoords[a + 1]);
664 }, "~N");
665 Clazz.overrideMethod (c$, "needRoom", 
666 function (a, b) {
667 if (a && this.numTypes == 0) {
668 throw  new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition");
669 }var c = this.pointTypes.length;
670 if (this.numTypes >= c) {
671 var d = c;
672 if (d > 500) {
673 d = 500;
674 }this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d);
675 }c = this.doubleCoords.length;
676 if (this.numCoords + b > c) {
677 var d = c;
678 if (d > 1000) {
679 d = 1000;
680 }if (d < b) {
681 d = b;
682 }this.doubleCoords = java.util.Arrays.copyOf (this.doubleCoords, c + d);
683 }}, "~B,~N");
684 Clazz.overrideMethod (c$, "moveTo", 
685 function (a, b) {
686 if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) {
687 this.doubleCoords[this.numCoords - 2] = a;
688 this.doubleCoords[this.numCoords - 1] = b;
689 } else {
690 this.needRoom (false, 2);
691 this.pointTypes[this.numTypes++] = 0;
692 this.doubleCoords[this.numCoords++] = a;
693 this.doubleCoords[this.numCoords++] = b;
694 }}, "~N,~N");
695 Clazz.overrideMethod (c$, "lineTo", 
696 function (a, b) {
697 this.needRoom (true, 2);
698 this.pointTypes[this.numTypes++] = 1;
699 this.doubleCoords[this.numCoords++] = a;
700 this.doubleCoords[this.numCoords++] = b;
701 }, "~N,~N");
702 Clazz.overrideMethod (c$, "quadTo", 
703 function (a, b, c, d) {
704 this.needRoom (true, 4);
705 this.pointTypes[this.numTypes++] = 2;
706 this.doubleCoords[this.numCoords++] = a;
707 this.doubleCoords[this.numCoords++] = b;
708 this.doubleCoords[this.numCoords++] = c;
709 this.doubleCoords[this.numCoords++] = d;
710 }, "~N,~N,~N,~N");
711 Clazz.overrideMethod (c$, "curveTo", 
712 function (a, b, c, d, e, f) {
713 this.needRoom (true, 6);
714 this.pointTypes[this.numTypes++] = 3;
715 this.doubleCoords[this.numCoords++] = a;
716 this.doubleCoords[this.numCoords++] = b;
717 this.doubleCoords[this.numCoords++] = c;
718 this.doubleCoords[this.numCoords++] = d;
719 this.doubleCoords[this.numCoords++] = e;
720 this.doubleCoords[this.numCoords++] = f;
721 }, "~N,~N,~N,~N,~N,~N");
722 Clazz.overrideMethod (c$, "pointCrossings", 
723 function (a, b) {
724 var c;
725 var d;
726 var e;
727 var f;
728 var g;
729 var h;
730 var i = this.doubleCoords;
731 e = c = i[0];
732 f = d = i[1];
733 var j = 0;
734 var k = 2;
735 for (var l = 1; l < this.numTypes; l++) {
736 switch (this.pointTypes[l]) {
737 case 0:
738 if (f != d) {
739 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
740 }c = e = i[k++];
741 d = f = i[k++];
742 break;
743 case 1:
744 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]);
745 e = g;
746 f = h;
747 break;
748 case 2:
749 j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0);
750 e = g;
751 f = h;
752 break;
753 case 3:
754 j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0);
755 e = g;
756 f = h;
757 break;
758 case 4:
759 if (f != d) {
760 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
761 }e = c;
762 f = d;
763 break;
764 }
765 }
766 if (f != d) {
767 j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d);
768 }return j;
769 }, "~N,~N");
770 Clazz.overrideMethod (c$, "rectCrossings", 
771 function (a, b, c, d) {
772 var e = this.doubleCoords;
773 var f;
774 var g;
775 var h;
776 var i;
777 var j;
778 var k;
779 f = h = e[0];
780 g = i = e[1];
781 var l = 0;
782 var m = 2;
783 for (var n = 1; l != -2147483648 && n < this.numTypes; n++) {
784 switch (this.pointTypes[n]) {
785 case 0:
786 if (f != h || g != i) {
787 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
788 }h = f = e[m++];
789 i = g = e[m++];
790 break;
791 case 1:
792 j = e[m++];
793 k = e[m++];
794 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j, k);
795 f = j;
796 g = k;
797 break;
798 case 2:
799 l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0);
800 f = j;
801 g = k;
802 break;
803 case 3:
804 l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0);
805 f = j;
806 g = k;
807 break;
808 case 4:
809 if (f != h || g != i) {
810 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
811 }f = h;
812 g = i;
813 break;
814 }
815 }
816 if (l != -2147483648 && (f != h || g != i)) {
817 l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i);
818 }return l;
819 }, "~N,~N,~N,~N");
820 Clazz.overrideMethod (c$, "transform", 
821 function (a) {
822 a.transform (this.doubleCoords, 0, this.doubleCoords, 0, Clazz.doubleToInt (this.numCoords / 2));
823 }, "java.awt.geom.AffineTransform");
824 Clazz.overrideMethod (c$, "getBounds2D", 
825 function () {
826 var a;
827 var b;
828 var c;
829 var d;
830 var e = this.numCoords;
831 if (e > 0) {
832 b = d = this.doubleCoords[--e];
833 a = c = this.doubleCoords[--e];
834 while (e > 0) {
835 var f = this.doubleCoords[--e];
836 var g = this.doubleCoords[--e];
837 if (g < a) a = g;
838 if (f < b) b = f;
839 if (g > c) c = g;
840 if (f > d) d = f;
841 }
842 } else {
843 a = b = c = d = 0.0;
844 }return  new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b);
845 });
846 Clazz.defineMethod (c$, "getPathIterator", 
847 function (a) {
848 if (a == null) {
849 return  new java.awt.geom.Path2D.Double.CopyIterator (this);
850 } else {
851 return  new java.awt.geom.Path2D.Double.TxIterator (this, a);
852 }}, "java.awt.geom.AffineTransform");
853 Clazz.overrideMethod (c$, "clone", 
854 function () {
855 return  new java.awt.geom.Path2D.Double (this);
856 });
857 Clazz.pu$h(self.c$);
858 c$ = Clazz.decorateAsClass (function () {
859 this.doubleCoords = null;
860 Clazz.instantialize (this, arguments);
861 }, java.awt.geom.Path2D.Double, "CopyIterator", java.awt.geom.Path2D.Iterator);
862 Clazz.makeConstructor (c$, 
863 function (a) {
864 Clazz.superConstructor (this, java.awt.geom.Path2D.Double.CopyIterator, [a]);
865 this.doubleCoords = a.doubleCoords;
866 }, "java.awt.geom.Path2D.Double");
867 Clazz.defineMethod (c$, "currentSegment", 
868 function (a) {
869 var b = this.path.pointTypes[this.typeIdx];
870 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
871 if (c > 0) {
872 for (var d = 0; d < c; d++) {
873 a[d] = this.doubleCoords[this.pointIdx + d];
874 }
875 }return b;
876 }, "~A");
877 Clazz.defineMethod (c$, "currentSegment", 
878 function (a) {
879 var b = this.path.pointTypes[this.typeIdx];
880 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
881 if (c > 0) {
882 System.arraycopy (this.doubleCoords, this.pointIdx, a, 0, c);
883 }return b;
884 }, "~A");
885 c$ = Clazz.p0p ();
886 Clazz.pu$h(self.c$);
887 c$ = Clazz.decorateAsClass (function () {
888 this.doubleCoords = null;
889 this.affine = null;
890 Clazz.instantialize (this, arguments);
891 }, java.awt.geom.Path2D.Double, "TxIterator", java.awt.geom.Path2D.Iterator);
892 Clazz.makeConstructor (c$, 
893 function (a, b) {
894 Clazz.superConstructor (this, java.awt.geom.Path2D.Double.TxIterator, [a]);
895 this.doubleCoords = a.doubleCoords;
896 this.affine = b;
897 }, "java.awt.geom.Path2D.Double,java.awt.geom.AffineTransform");
898 Clazz.defineMethod (c$, "currentSegment", 
899 function (a) {
900 var b = this.path.pointTypes[this.typeIdx];
901 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
902 if (c > 0) {
903 this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz.doubleToInt (c / 2));
904 }return b;
905 }, "~A");
906 Clazz.defineMethod (c$, "currentSegment", 
907 function (a) {
908 var b = this.path.pointTypes[this.typeIdx];
909 var c = java.awt.geom.Path2D.Iterator.curvecoords[b];
910 if (c > 0) {
911 this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz.doubleToInt (c / 2));
912 }return b;
913 }, "~A");
914 c$ = Clazz.p0p ();
915 c$ = Clazz.p0p ();
916 Clazz.defineStatics (c$,
917 "WIND_EVEN_ODD", 0,
918 "WIND_NON_ZERO", 1,
919 "SEG_MOVETO", 0,
920 "SEG_LINETO", 1,
921 "SEG_QUADTO", 2,
922 "SEG_CUBICTO", 3,
923 "SEG_CLOSE", 4,
924 "INIT_SIZE", 20,
925 "EXPAND_MAX", 500);
926 });