X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fj2s%2Fswingjs%2Fplaf%2FJSScrollPaneUI.js;fp=site%2Fj2s%2Fswingjs%2Fplaf%2FJSScrollPaneUI.js;h=26ae2220e08ee3f815866f969c3592bf614b228b;hb=4231d40261fef32ce4570a6bbad0d35df44e8baf;hp=0000000000000000000000000000000000000000;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/site/j2s/swingjs/plaf/JSScrollPaneUI.js b/site/j2s/swingjs/plaf/JSScrollPaneUI.js new file mode 100644 index 0000000..26ae222 --- /dev/null +++ b/site/j2s/swingjs/plaf/JSScrollPaneUI.js @@ -0,0 +1,45 @@ +Clazz.declarePackage ("swingjs.plaf"); +Clazz.load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSScrollPaneUI", ["swingjs.JSToolkit", "swingjs.api.DOMNode"], function () { +c$ = Clazz.decorateAsClass (function () { +this.scrolledComponent = null; +this.scrollpane = null; +this.viewport = null; +this.scrolledUI = null; +Clazz.instantialize (this, arguments); +}, swingjs.plaf, "JSScrollPaneUI", swingjs.plaf.JSComponentUI); +Clazz.overrideMethod (c$, "getDOMObject", +function () { +this.isContainer = true; +this.scrollpane = this.c; +if (this.domNode == null) { +this.domNode = this.createDOMObject ("div", this.id, []); +}var v = this.scrollpane.getViewport (); +if (v != null) { +this.viewport = v; +System.out.println ("JSScrollPaneUI v=" + v); +var sc = null; +try { +sc = v.getComponent (0); +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +} else { +throw e; +} +} +if (sc != null && sc !== this.scrolledComponent) { +this.scrolledComponent = sc; +this.scrolledUI = swingjs.JSToolkit.getUI (sc, false); +this.scrollNode = this.scrolledUI.outerNode; +if (this.scrollNode == null) this.scrollNode = this.scrolledUI.setHTMLElement (); +swingjs.api.DOMNode.setSize (this.scrollNode, this.c.getWidth (), this.c.getHeight ()); +this.scrolledUI.scrollerNode = this; +this.components = Clazz.newArray (-1, [this.scrolledComponent]); +}}return this.domNode; +}); +Clazz.overrideMethod (c$, "installJSUI", +function () { +}); +Clazz.overrideMethod (c$, "uninstallJSUI", +function () { +}); +});