JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / src / javajs / swing / Cell.java
1 package javajs.swing;\r
2 \r
3 public class Cell {\r
4 \r
5         private JComponent component;\r
6         private int colspan;\r
7         private int rowspan;\r
8         int textAlign;\r
9         private GridBagConstraints c;\r
10 \r
11         public Cell(JComponent btn, GridBagConstraints c) {\r
12                 this.component = btn;\r
13                 colspan = c.gridwidth;\r
14                 rowspan = c.gridheight;  // ignoring for now\r
15                 this.c = c;\r
16         }\r
17 \r
18         public String toHTML(String id) {\r
19                 String style = c.getStyle(false); \r
20                 return "<td id='" + id +"' " + (colspan < 2 ? "" : "colspan='" + colspan + "' ") \r
21                 + style + "><span " + c.getStyle(true) + ">" + component.toHTML() + "</span></td>";\r
22         }\r
23 \r
24 \r
25 }\r