X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjavajs%2Fawt%2FComponent.js;h=20f1f1a2db269c88ee3c83b1c0596a3cd1dd1c95;hp=f17a3eb4720f2b053d99172bbafb19b6314e2632;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/javajs/awt/Component.js b/bin/javajs/awt/Component.js index f17a3eb..20f1f1a 100644 --- a/bin/javajs/awt/Component.js +++ b/bin/javajs/awt/Component.js @@ -1,120 +1,120 @@ -Clazz.declarePackage ("javajs.awt"); -Clazz.load (null, "javajs.awt.Component", ["javajs.util.CU"], function () { -c$ = Clazz.decorateAsClass (function () { -this.visible = false; -this.enabled = true; -this.text = null; -this.name = null; -this.width = 0; -this.height = 0; -this.id = null; -this.parent = null; -this.mouseListener = null; -this.bgcolor = null; -this.minWidth = 30; -this.minHeight = 30; -this.renderWidth = 0; -this.renderHeight = 0; -Clazz.instantialize (this, arguments); -}, javajs.awt, "Component"); -Clazz.defineMethod (c$, "setParent", -function (p) { -this.parent = p; -}, "~O"); -Clazz.makeConstructor (c$, -function (type) { -this.id = javajs.awt.Component.newID (type); -if (type == null) return; -{ -SwingController.register(this, type); -}}, "~S"); -c$.newID = Clazz.defineMethod (c$, "newID", -function (type) { -return type + ("" + Math.random ()).substring (3, 10); -}, "~S"); -Clazz.defineMethod (c$, "setBackground", -function (color) { -this.bgcolor = color; -}, "javajs.api.GenericColor"); -Clazz.defineMethod (c$, "setText", -function (text) { -this.text = text; -{ -SwingController.setText(this); -}}, "~S"); -Clazz.defineMethod (c$, "setName", -function (name) { -this.name = name; -}, "~S"); -Clazz.defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz.defineMethod (c$, "getParent", -function () { -return this.parent; -}); -Clazz.defineMethod (c$, "setPreferredSize", -function (dimension) { -this.width = dimension.width; -this.height = dimension.height; -}, "javajs.awt.Dimension"); -Clazz.defineMethod (c$, "addMouseListener", -function (listener) { -this.mouseListener = listener; -}, "~O"); -Clazz.defineMethod (c$, "getText", -function () { -return this.text; -}); -Clazz.defineMethod (c$, "isEnabled", -function () { -return this.enabled; -}); -Clazz.defineMethod (c$, "setEnabled", -function (enabled) { -this.enabled = enabled; -{ -SwingController.setEnabled(this); -}}, "~B"); -Clazz.defineMethod (c$, "isVisible", -function () { -return this.visible; -}); -Clazz.defineMethod (c$, "setVisible", -function (visible) { -this.visible = visible; -{ -SwingController.setVisible(this); -}}, "~B"); -Clazz.defineMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz.defineMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz.defineMethod (c$, "setMinimumSize", -function (d) { -this.minWidth = d.width; -this.minHeight = d.height; -}, "javajs.awt.Dimension"); -Clazz.defineMethod (c$, "getSubcomponentWidth", -function () { -return this.width; -}); -Clazz.defineMethod (c$, "getSubcomponentHeight", -function () { -return this.height; -}); -Clazz.defineMethod (c$, "getCSSstyle", -function (defaultPercentW, defaultPercentH) { -var width = (this.renderWidth > 0 ? this.renderWidth : this.getSubcomponentWidth ()); -var height = (this.renderHeight > 0 ? this.renderHeight : this.getSubcomponentHeight ()); -return (width > 0 ? "width:" + width + "px;" : defaultPercentW > 0 ? "width:" + defaultPercentW + "%;" : "") + (height > 0 ? "height:" + height + "px;" : defaultPercentH > 0 ? "height:" + defaultPercentH + "%;" : "") + (this.bgcolor == null ? "" : "background-color:" + javajs.util.CU.toCSSString (this.bgcolor) + ";"); -}, "~N,~N"); -Clazz.defineMethod (c$, "repaint", -function () { -}); -}); +Clazz.declarePackage ("javajs.awt"); +Clazz.load (null, "javajs.awt.Component", ["javajs.util.CU"], function () { +c$ = Clazz.decorateAsClass (function () { +this.visible = false; +this.enabled = true; +this.text = null; +this.name = null; +this.width = 0; +this.height = 0; +this.id = null; +this.parent = null; +this.mouseListener = null; +this.bgcolor = null; +this.minWidth = 30; +this.minHeight = 30; +this.renderWidth = 0; +this.renderHeight = 0; +Clazz.instantialize (this, arguments); +}, javajs.awt, "Component"); +Clazz.defineMethod (c$, "setParent", +function (p) { +this.parent = p; +}, "~O"); +Clazz.makeConstructor (c$, +function (type) { +this.id = javajs.awt.Component.newID (type); +if (type == null) return; +{ +SwingController.register(this, type); +}}, "~S"); +c$.newID = Clazz.defineMethod (c$, "newID", +function (type) { +return type + ("" + Math.random ()).substring (3, 10); +}, "~S"); +Clazz.defineMethod (c$, "setBackground", +function (color) { +this.bgcolor = color; +}, "javajs.api.GenericColor"); +Clazz.defineMethod (c$, "setText", +function (text) { +this.text = text; +{ +SwingController.setText(this); +}}, "~S"); +Clazz.defineMethod (c$, "setName", +function (name) { +this.name = name; +}, "~S"); +Clazz.defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz.defineMethod (c$, "getParent", +function () { +return this.parent; +}); +Clazz.defineMethod (c$, "setPreferredSize", +function (dimension) { +this.width = dimension.width; +this.height = dimension.height; +}, "javajs.awt.Dimension"); +Clazz.defineMethod (c$, "addMouseListener", +function (listener) { +this.mouseListener = listener; +}, "~O"); +Clazz.defineMethod (c$, "getText", +function () { +return this.text; +}); +Clazz.defineMethod (c$, "isEnabled", +function () { +return this.enabled; +}); +Clazz.defineMethod (c$, "setEnabled", +function (enabled) { +this.enabled = enabled; +{ +SwingController.setEnabled(this); +}}, "~B"); +Clazz.defineMethod (c$, "isVisible", +function () { +return this.visible; +}); +Clazz.defineMethod (c$, "setVisible", +function (visible) { +this.visible = visible; +{ +SwingController.setVisible(this); +}}, "~B"); +Clazz.defineMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz.defineMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz.defineMethod (c$, "setMinimumSize", +function (d) { +this.minWidth = d.width; +this.minHeight = d.height; +}, "javajs.awt.Dimension"); +Clazz.defineMethod (c$, "getSubcomponentWidth", +function () { +return this.width; +}); +Clazz.defineMethod (c$, "getSubcomponentHeight", +function () { +return this.height; +}); +Clazz.defineMethod (c$, "getCSSstyle", +function (defaultPercentW, defaultPercentH) { +var width = (this.renderWidth > 0 ? this.renderWidth : this.getSubcomponentWidth ()); +var height = (this.renderHeight > 0 ? this.renderHeight : this.getSubcomponentHeight ()); +return (width > 0 ? "width:" + width + "px;" : defaultPercentW > 0 ? "width:" + defaultPercentW + "%;" : "") + (height > 0 ? "height:" + height + "px;" : defaultPercentH > 0 ? "height:" + defaultPercentH + "%;" : "") + (this.bgcolor == null ? "" : "background-color:" + javajs.util.CU.toCSSString (this.bgcolor) + ";"); +}, "~N,~N"); +Clazz.defineMethod (c$, "repaint", +function () { +}); +});