X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjava%2Fawt%2Fgeom%2FPoint2D.js;fp=site%2Fj2s%2Fjava%2Fawt%2Fgeom%2FPoint2D.js;h=42fad1980fd4883e27c4f5f3e667cb463edc9f9b;hp=12f1548a6cd3b8fa8ac6e2d7df7f43a2d78a8e12;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/java/awt/geom/Point2D.js b/site/j2s/java/awt/geom/Point2D.js index 12f1548..42fad19 100644 --- a/site/j2s/java/awt/geom/Point2D.js +++ b/site/j2s/java/awt/geom/Point2D.js @@ -1,145 +1,145 @@ -Clazz.declarePackage ("java.awt.geom"); -Clazz.load (null, "java.awt.geom.Point2D", ["java.lang.Double", "$.InternalError"], function () { -c$ = Clazz.declareType (java.awt.geom, "Point2D", null, Cloneable); -Clazz.makeConstructor (c$, -function () { -}); -Clazz.defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.distanceSq = Clazz.defineMethod (c$, "distanceSq", -function (x1, y1, x2, y2) { -x1 -= x2; -y1 -= y2; -return (x1 * x1 + y1 * y1); -}, "~N,~N,~N,~N"); -c$.distance = Clazz.defineMethod (c$, "distance", -function (x1, y1, x2, y2) { -x1 -= x2; -y1 -= y2; -return Math.sqrt (x1 * x1 + y1 * y1); -}, "~N,~N,~N,~N"); -Clazz.defineMethod (c$, "distanceSq", -function (px, py) { -px -= this.getX (); -py -= this.getY (); -return (px * px + py * py); -}, "~N,~N"); -Clazz.defineMethod (c$, "distanceSq", -function (pt) { -var px = pt.getX () - this.getX (); -var py = pt.getY () - this.getY (); -return (px * px + py * py); -}, "java.awt.geom.Point2D"); -Clazz.defineMethod (c$, "distance", -function (px, py) { -px -= this.getX (); -py -= this.getY (); -return Math.sqrt (px * px + py * py); -}, "~N,~N"); -Clazz.defineMethod (c$, "distance", -function (pt) { -var px = pt.getX () - this.getX (); -var py = pt.getY () - this.getY (); -return Math.sqrt (px * px + py * py); -}, "java.awt.geom.Point2D"); -Clazz.defineMethod (c$, "clone", -function () { -try { -return Clazz.superCall (this, java.awt.geom.Point2D, "clone", []); -} catch (e) { -if (Clazz.exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz.overrideMethod (c$, "hashCode", -function () { -var bits = java.lang.Double.doubleToLongBits (this.getX ()); -bits ^= java.lang.Double.doubleToLongBits (this.getY ()) * 31; -return ((bits) ^ ((bits >> 32))); -}); -Clazz.defineMethod (c$, "equals", -function (obj) { -if (Clazz.instanceOf (obj, java.awt.geom.Point2D)) { -var p2d = obj; -return (this.getX () == p2d.getX ()) && (this.getY () == p2d.getY ()); -}return Clazz.superCall (this, java.awt.geom.Point2D, "equals", [obj]); -}, "~O"); -Clazz.pu$h(self.c$); -c$ = Clazz.decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz.instantialize (this, arguments); -}, java.awt.geom.Point2D, "Float", java.awt.geom.Point2D); -Clazz.makeConstructor (c$, -function () { -Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []); -}); -Clazz.makeConstructor (c$, -function (a, b) { -Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []); -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz.overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz.overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz.defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz.defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz.overrideMethod (c$, "toString", -function () { -return "Point2D.Float[" + this.x + ", " + this.y + "]"; -}); -c$ = Clazz.p0p (); -Clazz.pu$h(self.c$); -c$ = Clazz.decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz.instantialize (this, arguments); -}, java.awt.geom.Point2D, "Double", java.awt.geom.Point2D); -Clazz.makeConstructor (c$, -function () { -Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []); -}); -Clazz.makeConstructor (c$, -function (a, b) { -Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []); -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz.overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz.overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz.defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz.overrideMethod (c$, "toString", -function () { -return "Point2D.Double[" + this.x + ", " + this.y + "]"; -}); -c$ = Clazz.p0p (); -}); +Clazz.declarePackage ("java.awt.geom"); +Clazz.load (null, "java.awt.geom.Point2D", ["java.lang.Double", "$.InternalError"], function () { +c$ = Clazz.declareType (java.awt.geom, "Point2D", null, Cloneable); +Clazz.makeConstructor (c$, +function () { +}); +Clazz.defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.distanceSq = Clazz.defineMethod (c$, "distanceSq", +function (x1, y1, x2, y2) { +x1 -= x2; +y1 -= y2; +return (x1 * x1 + y1 * y1); +}, "~N,~N,~N,~N"); +c$.distance = Clazz.defineMethod (c$, "distance", +function (x1, y1, x2, y2) { +x1 -= x2; +y1 -= y2; +return Math.sqrt (x1 * x1 + y1 * y1); +}, "~N,~N,~N,~N"); +Clazz.defineMethod (c$, "distanceSq", +function (px, py) { +px -= this.getX (); +py -= this.getY (); +return (px * px + py * py); +}, "~N,~N"); +Clazz.defineMethod (c$, "distanceSq", +function (pt) { +var px = pt.getX () - this.getX (); +var py = pt.getY () - this.getY (); +return (px * px + py * py); +}, "java.awt.geom.Point2D"); +Clazz.defineMethod (c$, "distance", +function (px, py) { +px -= this.getX (); +py -= this.getY (); +return Math.sqrt (px * px + py * py); +}, "~N,~N"); +Clazz.defineMethod (c$, "distance", +function (pt) { +var px = pt.getX () - this.getX (); +var py = pt.getY () - this.getY (); +return Math.sqrt (px * px + py * py); +}, "java.awt.geom.Point2D"); +Clazz.defineMethod (c$, "clone", +function () { +try { +return Clazz.superCall (this, java.awt.geom.Point2D, "clone", []); +} catch (e) { +if (Clazz.exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz.overrideMethod (c$, "hashCode", +function () { +var bits = java.lang.Double.doubleToLongBits (this.getX ()); +bits ^= java.lang.Double.doubleToLongBits (this.getY ()) * 31; +return ((bits) ^ ((bits >> 32))); +}); +Clazz.defineMethod (c$, "equals", +function (obj) { +if (Clazz.instanceOf (obj, java.awt.geom.Point2D)) { +var p2d = obj; +return (this.getX () == p2d.getX ()) && (this.getY () == p2d.getY ()); +}return Clazz.superCall (this, java.awt.geom.Point2D, "equals", [obj]); +}, "~O"); +Clazz.pu$h(self.c$); +c$ = Clazz.decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz.instantialize (this, arguments); +}, java.awt.geom.Point2D, "Float", java.awt.geom.Point2D); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []); +}); +Clazz.makeConstructor (c$, +function (a, b) { +Clazz.superConstructor (this, java.awt.geom.Point2D.Float, []); +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz.overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz.overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz.defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz.defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz.overrideMethod (c$, "toString", +function () { +return "Point2D.Float[" + this.x + ", " + this.y + "]"; +}); +c$ = Clazz.p0p (); +Clazz.pu$h(self.c$); +c$ = Clazz.decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz.instantialize (this, arguments); +}, java.awt.geom.Point2D, "Double", java.awt.geom.Point2D); +Clazz.makeConstructor (c$, +function () { +Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []); +}); +Clazz.makeConstructor (c$, +function (a, b) { +Clazz.superConstructor (this, java.awt.geom.Point2D.Double, []); +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz.overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz.overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz.defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz.overrideMethod (c$, "toString", +function () { +return "Point2D.Double[" + this.x + ", " + this.y + "]"; +}); +c$ = Clazz.p0p (); +});