X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fswingjs%2Fplaf%2FJSRadioButtonUI.js;fp=site%2Fj2s%2Fswingjs%2Fplaf%2FJSRadioButtonUI.js;h=f6a831236ea0bb0023c0790bf84016789defd507;hp=ea16d757a91c0f1439ae92b7a9511dedfdc7889c;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/swingjs/plaf/JSRadioButtonUI.js b/site/j2s/swingjs/plaf/JSRadioButtonUI.js index ea16d75..f6a8312 100644 --- a/site/j2s/swingjs/plaf/JSRadioButtonUI.js +++ b/site/j2s/swingjs/plaf/JSRadioButtonUI.js @@ -1,63 +1,63 @@ -Clazz.declarePackage ("swingjs.plaf"); -Clazz.load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSRadioButtonUI", ["java.util.HashMap", "javax.swing.DefaultButtonModel", "swingjs.api.DOMNode"], function () { -c$ = Clazz.decorateAsClass (function () { -this.label = null; -Clazz.instantialize (this, arguments); -}, swingjs.plaf, "JSRadioButtonUI", swingjs.plaf.JSButtonUI); -Clazz.overrideMethod (c$, "getDOMObject", -function () { -return this.getButtonObject ("radio"); -}); -Clazz.overrideMethod (c$, "getPropertyPrefix", -function () { -return "RadioButton."; -}); -Clazz.overrideMethod (c$, "setHTMLSize", -function (obj, addCSS) { -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", null]); -swingjs.api.DOMNode.setStyles (this.label, ["position", null]); -var d = this.setHTMLSize1 (obj, addCSS, false); -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); -swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute"]); -return d; -}, "swingjs.api.DOMNode,~B"); -Clazz.defineMethod (c$, "getButtonObject", -function (myType) { -var b = this.c; -var isNew = false; -var doAll = false; -if (this.domNode == null) { -doAll = true; -if (swingjs.plaf.JSRadioButtonUI.groupNames == null) swingjs.plaf.JSRadioButtonUI.groupNames = new java.util.HashMap (); -var bg = null; -var name = this.id; -isNew = true; -if (Clazz.instanceOf (b.getModel (), javax.swing.DefaultButtonModel)) { -bg = (b.getModel ()).getGroup (); -name = swingjs.plaf.JSRadioButtonUI.groupNames.get (bg); -if (name == null) swingjs.plaf.JSRadioButtonUI.groupNames.put (bg, name = this.id); - else isNew = false; -}this.domBtn = this.enableNode = this.createDOMObject ("input", this.id, ["type", myType, "name", name]); -this.label = this.textNode = this.createDOMObject ("label", this.id + "l", ["htmlFor", this.id]); -}if (b.isSelected () || isNew) swingjs.api.DOMNode.setAttr (this.domBtn, "checked", "true"); -this.setCssFont (swingjs.api.DOMNode.setAttr (this.label, "innerHTML", (this.c).getText ()), this.c.getFont ()); -var drad = this.setHTMLSize1 (this.domBtn, false, false); -this.setHTMLSize1 (this.label, false, false); -var obj = this.wrap ("div", "", [this.domBtn, this.label]); -var dobj = this.setHTMLSize1 (obj, true, true); -swingjs.plaf.JSComponentUI.vCenter (this.domBtn, -75); -swingjs.plaf.JSComponentUI.vCenter (this.label, -50); -swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute", "left", drad.width + "px"]); -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); -if (doAll) { -obj = this.wrap ("div", this.id + "_0", [this.domBtn, this.label]); -swingjs.api.DOMNode.setStyles (obj, ["position", "absolute"]); -} else { -obj = this.domNode; -obj.appendChild (this.domBtn); -obj.appendChild (this.label); -}return swingjs.api.DOMNode.setSize (obj, dobj.width, dobj.height); -}, "~S"); -Clazz.defineStatics (c$, -"groupNames", null); -}); +Clazz.declarePackage ("swingjs.plaf"); +Clazz.load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSRadioButtonUI", ["java.util.HashMap", "javax.swing.DefaultButtonModel", "swingjs.api.DOMNode"], function () { +c$ = Clazz.decorateAsClass (function () { +this.label = null; +Clazz.instantialize (this, arguments); +}, swingjs.plaf, "JSRadioButtonUI", swingjs.plaf.JSButtonUI); +Clazz.overrideMethod (c$, "getDOMObject", +function () { +return this.getButtonObject ("radio"); +}); +Clazz.overrideMethod (c$, "getPropertyPrefix", +function () { +return "RadioButton."; +}); +Clazz.overrideMethod (c$, "setHTMLSize", +function (obj, addCSS) { +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", null]); +swingjs.api.DOMNode.setStyles (this.label, ["position", null]); +var d = this.setHTMLSize1 (obj, addCSS, false); +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); +swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute"]); +return d; +}, "swingjs.api.DOMNode,~B"); +Clazz.defineMethod (c$, "getButtonObject", +function (myType) { +var b = this.c; +var isNew = false; +var doAll = false; +if (this.domNode == null) { +doAll = true; +if (swingjs.plaf.JSRadioButtonUI.groupNames == null) swingjs.plaf.JSRadioButtonUI.groupNames = new java.util.HashMap (); +var bg = null; +var name = this.id; +isNew = true; +if (Clazz.instanceOf (b.getModel (), javax.swing.DefaultButtonModel)) { +bg = (b.getModel ()).getGroup (); +name = swingjs.plaf.JSRadioButtonUI.groupNames.get (bg); +if (name == null) swingjs.plaf.JSRadioButtonUI.groupNames.put (bg, name = this.id); + else isNew = false; +}this.domBtn = this.enableNode = this.createDOMObject ("input", this.id, ["type", myType, "name", name]); +this.label = this.textNode = this.createDOMObject ("label", this.id + "l", ["htmlFor", this.id]); +}if (b.isSelected () || isNew) swingjs.api.DOMNode.setAttr (this.domBtn, "checked", "true"); +this.setCssFont (swingjs.api.DOMNode.setAttr (this.label, "innerHTML", (this.c).getText ()), this.c.getFont ()); +var drad = this.setHTMLSize1 (this.domBtn, false, false); +this.setHTMLSize1 (this.label, false, false); +var obj = this.wrap ("div", "", [this.domBtn, this.label]); +var dobj = this.setHTMLSize1 (obj, true, true); +swingjs.plaf.JSComponentUI.vCenter (this.domBtn, -75); +swingjs.plaf.JSComponentUI.vCenter (this.label, -50); +swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute", "left", drad.width + "px"]); +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); +if (doAll) { +obj = this.wrap ("div", this.id + "_0", [this.domBtn, this.label]); +swingjs.api.DOMNode.setStyles (obj, ["position", "absolute"]); +} else { +obj = this.domNode; +obj.appendChild (this.domBtn); +obj.appendChild (this.label); +}return swingjs.api.DOMNode.setSize (obj, dobj.width, dobj.height); +}, "~S"); +Clazz.defineStatics (c$, +"groupNames", null); +});