1 Clazz.declarePackage ("java.awt.geom");
\r
2 Clazz.load (["java.awt.geom.RectangularShape"], "java.awt.geom.Ellipse2D", ["java.lang.Double", "java.awt.geom.EllipseIterator", "$.Rectangle2D"], function () {
\r
3 c$ = Clazz.declareType (java.awt.geom, "Ellipse2D", java.awt.geom.RectangularShape);
\r
4 Clazz.makeConstructor (c$,
\r
6 Clazz.superConstructor (this, java.awt.geom.Ellipse2D, []);
\r
8 Clazz.defineMethod (c$, "contains",
\r
10 var ellw = this.getWidth ();
\r
13 }var normx = (x - this.getX ()) / ellw - 0.5;
\r
14 var ellh = this.getHeight ();
\r
17 }var normy = (y - this.getY ()) / ellh - 0.5;
\r
18 return (normx * normx + normy * normy) < 0.25;
\r
20 Clazz.defineMethod (c$, "intersects",
\r
21 function (x, y, w, h) {
\r
22 if (w <= 0.0 || h <= 0.0) {
\r
24 }var ellw = this.getWidth ();
\r
27 }var normx0 = (x - this.getX ()) / ellw - 0.5;
\r
28 var normx1 = normx0 + w / ellw;
\r
29 var ellh = this.getHeight ();
\r
32 }var normy0 = (y - this.getY ()) / ellh - 0.5;
\r
33 var normy1 = normy0 + h / ellh;
\r
38 } else if (normx1 < 0.0) {
\r
42 }if (normy0 > 0.0) {
\r
44 } else if (normy1 < 0.0) {
\r
48 }return (nearx * nearx + neary * neary) < 0.25;
\r
50 Clazz.defineMethod (c$, "contains",
\r
51 function (x, y, w, h) {
\r
52 return (this.contains (x, y) && this.contains (x + w, y) && this.contains (x, y + h) && this.contains (x + w, y + h));
\r
54 Clazz.defineMethod (c$, "getPathIterator",
\r
56 return new java.awt.geom.EllipseIterator (this, at);
\r
57 }, "java.awt.geom.AffineTransform");
\r
58 Clazz.overrideMethod (c$, "hashCode",
\r
60 var bits = java.lang.Double.doubleToLongBits (this.getX ());
\r
61 bits += java.lang.Double.doubleToLongBits (this.getY ()) * 37;
\r
62 bits += java.lang.Double.doubleToLongBits (this.getWidth ()) * 43;
\r
63 bits += java.lang.Double.doubleToLongBits (this.getHeight ()) * 47;
\r
64 return ((bits) ^ ((bits >> 32)));
\r
66 Clazz.overrideMethod (c$, "equals",
\r
70 }if (Clazz.instanceOf (obj, java.awt.geom.Ellipse2D)) {
\r
72 return ((this.getX () == e2d.getX ()) && (this.getY () == e2d.getY ()) && (this.getWidth () == e2d.getWidth ()) && (this.getHeight () == e2d.getHeight ()));
\r
75 Clazz.pu$h(self.c$);
\r
76 c$ = Clazz.decorateAsClass (function () {
\r
81 Clazz.instantialize (this, arguments);
\r
82 }, java.awt.geom.Ellipse2D, "Float", java.awt.geom.Ellipse2D);
\r
83 Clazz.makeConstructor (c$,
\r
85 Clazz.superConstructor (this, java.awt.geom.Ellipse2D.Float, []);
\r
87 Clazz.makeConstructor (c$,
\r
88 function (a, b, c, d) {
\r
89 Clazz.superConstructor (this, java.awt.geom.Ellipse2D.Float, []);
\r
90 this.setFrame (a, b, c, d);
\r
92 Clazz.overrideMethod (c$, "getX",
\r
96 Clazz.overrideMethod (c$, "getY",
\r
100 Clazz.overrideMethod (c$, "getWidth",
\r
104 Clazz.overrideMethod (c$, "getHeight",
\r
106 return this.height;
\r
108 Clazz.overrideMethod (c$, "isEmpty",
\r
110 return (this.width <= 0.0 || this.height <= 0.0);
\r
112 Clazz.defineMethod (c$, "setFrame",
\r
113 function (a, b, c, d) {
\r
119 Clazz.defineMethod (c$, "setFrame",
\r
120 function (a, b, c, d) {
\r
126 Clazz.overrideMethod (c$, "getBounds2D",
\r
128 return new java.awt.geom.Rectangle2D.Float (this.x, this.y, this.width, this.height);
\r
131 Clazz.pu$h(self.c$);
\r
132 c$ = Clazz.decorateAsClass (function () {
\r
137 Clazz.instantialize (this, arguments);
\r
138 }, java.awt.geom.Ellipse2D, "Double", java.awt.geom.Ellipse2D);
\r
139 Clazz.makeConstructor (c$,
\r
141 Clazz.superConstructor (this, java.awt.geom.Ellipse2D.Double, []);
\r
143 Clazz.makeConstructor (c$,
\r
144 function (a, b, c, d) {
\r
145 Clazz.superConstructor (this, java.awt.geom.Ellipse2D.Double, []);
\r
146 this.setFrame (a, b, c, d);
\r
148 Clazz.overrideMethod (c$, "getX",
\r
152 Clazz.overrideMethod (c$, "getY",
\r
156 Clazz.overrideMethod (c$, "getWidth",
\r
160 Clazz.overrideMethod (c$, "getHeight",
\r
162 return this.height;
\r
164 Clazz.overrideMethod (c$, "isEmpty",
\r
166 return (this.width <= 0.0 || this.height <= 0.0);
\r
168 Clazz.defineMethod (c$, "setFrame",
\r
169 function (a, b, c, d) {
\r
175 Clazz.overrideMethod (c$, "getBounds2D",
\r
177 return new java.awt.geom.Rectangle2D.Double (this.x, this.y, this.width, this.height);
\r