1 Clazz.declarePackage ("java.awt.geom");
2 Clazz.load (null, "java.awt.geom.Point2D", ["java.lang.Double", "$.InternalError"], function () {
3 c$ = Clazz.declareType (java.awt.geom, "Point2D", null, Cloneable);
4 Clazz.makeConstructor (c$,
7 Clazz.defineMethod (c$, "setLocation",
9 this.setLocation (p.getX (), p.getY ());
10 }, "java.awt.geom.Point2D");
11 c$.distanceSq = Clazz.defineMethod (c$, "distanceSq",
12 function (x1, y1, x2, y2) {
15 return (x1 * x1 + y1 * y1);
17 c$.distance = Clazz.defineMethod (c$, "distance",
18 function (x1, y1, x2, y2) {
21 return Math.sqrt (x1 * x1 + y1 * y1);
23 Clazz.defineMethod (c$, "distanceSq",
27 return (px * px + py * py);
29 Clazz.defineMethod (c$, "distanceSq",
31 var px = pt.getX () - this.getX ();
32 var py = pt.getY () - this.getY ();
33 return (px * px + py * py);
34 }, "java.awt.geom.Point2D");
35 Clazz.defineMethod (c$, "distance",
39 return Math.sqrt (px * px + py * py);
41 Clazz.defineMethod (c$, "distance",
43 var px = pt.getX () - this.getX ();
44 var py = pt.getY () - this.getY ();
45 return Math.sqrt (px * px + py * py);
46 }, "java.awt.geom.Point2D");
47 Clazz.defineMethod (c$, "clone",
50 return Clazz.superCall (this, java.awt.geom.Point2D, "clone", []);
52 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
53 throw new InternalError ();
59 Clazz.overrideMethod (c$, "hashCode",
61 var bits = java.lang.Double.doubleToLongBits (this.getX ());
62 bits ^= java.lang.Double.doubleToLongBits (this.getY ()) * 31;
63 return ((bits) ^ ((bits >> 32)));
65 Clazz.defineMethod (c$, "equals",
67 if (Clazz.instanceOf (obj, java.awt.geom.Point2D)) {
69 return (this.getX () == p2d.getX ()) && (this.getY () == p2d.getY ());
70 }return Clazz.superCall (this, java.awt.geom.Point2D, "equals", [obj]);
73 c$ = Clazz.decorateAsClass (function () {
76 Clazz.instantialize (this, arguments);
77 }, java.awt.geom.Point2D, "Float", java.awt.geom.Point2D);
78 Clazz.makeConstructor (c$,
80 Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []);
82 Clazz.makeConstructor (c$,
84 Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []);
88 Clazz.overrideMethod (c$, "getX",
92 Clazz.overrideMethod (c$, "getY",
96 Clazz.defineMethod (c$, "setLocation",
101 Clazz.defineMethod (c$, "setLocation",
106 Clazz.overrideMethod (c$, "toString",
108 return "Point2D.Float[" + this.x + ", " + this.y + "]";
112 c$ = Clazz.decorateAsClass (function () {
115 Clazz.instantialize (this, arguments);
116 }, java.awt.geom.Point2D, "Double", java.awt.geom.Point2D);
117 Clazz.makeConstructor (c$,
119 Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []);
121 Clazz.makeConstructor (c$,
123 Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []);
127 Clazz.overrideMethod (c$, "getX",
131 Clazz.overrideMethod (c$, "getY",
135 Clazz.defineMethod (c$, "setLocation",
140 Clazz.overrideMethod (c$, "toString",
142 return "Point2D.Double[" + this.x + ", " + this.y + "]";