JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / javajs / swing / GridBagConstraints.js
1 Clazz.declarePackage ("javajs.swing");\r
2 Clazz.load (null, "javajs.swing.GridBagConstraints", ["javajs.swing.Insets"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.gridx = 0;\r
5 this.gridy = 0;\r
6 this.gridwidth = 0;\r
7 this.gridheight = 0;\r
8 this.weightx = 0;\r
9 this.weighty = 0;\r
10 this.anchor = 0;\r
11 this.fill = 0;\r
12 this.insets = null;\r
13 this.ipadx = 0;\r
14 this.ipady = 0;\r
15 Clazz.instantialize (this, arguments);\r
16 }, javajs.swing, "GridBagConstraints");\r
17 Clazz.makeConstructor (c$, \r
18 function (gridx, gridy, gridwidth, gridheight, weightx, weighty, anchor, fill, insets, ipadx, ipady) {\r
19 this.gridx = gridx;\r
20 this.gridy = gridy;\r
21 this.gridwidth = gridwidth;\r
22 this.gridheight = gridheight;\r
23 this.weightx = weightx;\r
24 this.weighty = weighty;\r
25 this.anchor = anchor;\r
26 this.fill = fill;\r
27 if (insets == null) insets =  new javajs.swing.Insets (0, 0, 0, 0);\r
28 this.insets = insets;\r
29 this.ipadx = ipadx;\r
30 this.ipady = ipady;\r
31 }, "~N,~N,~N,~N,~N,~N,~N,~N,javajs.swing.Insets,~N,~N");\r
32 Clazz.defineMethod (c$, "getStyle", \r
33 function (margins) {\r
34 return "style='" + (margins ? "margin:" + this.insets.top + "px " + (this.ipady + this.insets.right) + "px " + this.insets.bottom + "px " + (this.ipadx + this.insets.left) + "px;" : "text-align:" + (this.anchor == 13 ? "right" : this.anchor == 17 ? "left" : "center")) + "'";\r
35 }, "~B");\r
36 Clazz.defineStatics (c$,\r
37 "NONE", 0,\r
38 "CENTER", 10,\r
39 "WEST", 17,\r
40 "EAST", 13);\r
41 });\r