X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjava%2Fawt%2FPoint.js;fp=site%2Fj2s%2Fjava%2Fawt%2FPoint.js;h=5d239e3ba3ef13ecd373000774799c454450d69c;hp=8e76877b06977c3b19d473d824aad22f9c2eb9db;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/java/awt/Point.js b/site/j2s/java/awt/Point.js index 8e76877..5d239e3 100644 --- a/site/j2s/java/awt/Point.js +++ b/site/j2s/java/awt/Point.js @@ -1,64 +1,64 @@ -Clazz.declarePackage ("java.awt"); -Clazz.load (["java.awt.geom.Point2D"], "java.awt.Point", null, function () { -c$ = Clazz.decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz.instantialize (this, arguments); -}, java.awt, "Point", java.awt.geom.Point2D); -Clazz.makeConstructor (c$, -function () { -this.construct (0, 0); -}); -Clazz.makeConstructor (c$, -function (p) { -this.construct (p.x, p.y); -}, "java.awt.Point"); -Clazz.makeConstructor (c$, -function (x, y) { -Clazz.superConstructor (this, java.awt.Point, []); -this.x = x; -this.y = y; -}, "~N,~N"); -Clazz.overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz.overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz.defineMethod (c$, "getLocation", -function () { -return new java.awt.Point (this.x, this.y); -}); -Clazz.defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.x, p.y); -}, "java.awt.Point"); -Clazz.defineMethod (c$, "setLocation", -function (x, y) { -this.x = Clazz.doubleToInt (Math.floor (x + 0.5)); -this.y = Clazz.doubleToInt (Math.floor (y + 0.5)); -}, "~N,~N"); -Clazz.defineMethod (c$, "move", -function (x, y) { -this.x = x; -this.y = y; -}, "~N,~N"); -Clazz.defineMethod (c$, "translate", -function (dx, dy) { -this.x += dx; -this.y += dy; -}, "~N,~N"); -Clazz.defineMethod (c$, "equals", -function (obj) { -if (Clazz.instanceOf (obj, java.awt.Point)) { -var pt = obj; -return (this.x == pt.x) && (this.y == pt.y); -}return Clazz.superCall (this, java.awt.Point, "equals", [obj]); -}, "~O"); -Clazz.overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + "]"; -}); -}); +Clazz.declarePackage ("java.awt"); +Clazz.load (["java.awt.geom.Point2D"], "java.awt.Point", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz.instantialize (this, arguments); +}, java.awt, "Point", java.awt.geom.Point2D); +Clazz.makeConstructor (c$, +function () { +this.construct (0, 0); +}); +Clazz.makeConstructor (c$, +function (p) { +this.construct (p.x, p.y); +}, "java.awt.Point"); +Clazz.makeConstructor (c$, +function (x, y) { +Clazz.superConstructor (this, java.awt.Point, []); +this.x = x; +this.y = y; +}, "~N,~N"); +Clazz.overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz.overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz.defineMethod (c$, "getLocation", +function () { +return new java.awt.Point (this.x, this.y); +}); +Clazz.defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.x, p.y); +}, "java.awt.Point"); +Clazz.defineMethod (c$, "setLocation", +function (x, y) { +this.x = Clazz.doubleToInt (Math.floor (x + 0.5)); +this.y = Clazz.doubleToInt (Math.floor (y + 0.5)); +}, "~N,~N"); +Clazz.defineMethod (c$, "move", +function (x, y) { +this.x = x; +this.y = y; +}, "~N,~N"); +Clazz.defineMethod (c$, "translate", +function (dx, dy) { +this.x += dx; +this.y += dy; +}, "~N,~N"); +Clazz.defineMethod (c$, "equals", +function (obj) { +if (Clazz.instanceOf (obj, java.awt.Point)) { +var pt = obj; +return (this.x == pt.x) && (this.y == pt.y); +}return Clazz.superCall (this, java.awt.Point, "equals", [obj]); +}, "~O"); +Clazz.overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + "]"; +}); +});