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