JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / javajs / swing / Cell.js
1 Clazz.declarePackage ("javajs.swing");\r
2 c$ = Clazz.decorateAsClass (function () {\r
3 this.component = null;\r
4 this.colspan = 0;\r
5 this.rowspan = 0;\r
6 this.textAlign = 0;\r
7 this.c = null;\r
8 Clazz.instantialize (this, arguments);\r
9 }, javajs.swing, "Cell");\r
10 Clazz.makeConstructor (c$, \r
11 function (btn, c) {\r
12 this.component = btn;\r
13 this.colspan = c.gridwidth;\r
14 this.rowspan = c.gridheight;\r
15 this.c = c;\r
16 }, "javajs.swing.JComponent,javajs.swing.GridBagConstraints");\r
17 Clazz.defineMethod (c$, "toHTML", \r
18 function (id) {\r
19 var style = this.c.getStyle (false);\r
20 return "<td id='" + id + "' " + (this.colspan < 2 ? "" : "colspan='" + this.colspan + "' ") + style + "><span " + this.c.getStyle (true) + ">" + this.component.toHTML () + "</span></td>";\r
21 }, "~S");\r