JAL-1807 test
[jalviewjs.git] / bin / javajs / swing / GridBagConstraints.js
1 Clazz.declarePackage ("javajs.swing");
2 Clazz.load (null, "javajs.swing.GridBagConstraints", ["javajs.swing.Insets"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.gridx = 0;
5 this.gridy = 0;
6 this.gridwidth = 0;
7 this.gridheight = 0;
8 this.weightx = 0;
9 this.weighty = 0;
10 this.anchor = 0;
11 this.fill = 0;
12 this.insets = null;
13 this.ipadx = 0;
14 this.ipady = 0;
15 Clazz.instantialize (this, arguments);
16 }, javajs.swing, "GridBagConstraints");
17 Clazz.makeConstructor (c$, 
18 function (gridx, gridy, gridwidth, gridheight, weightx, weighty, anchor, fill, insets, ipadx, ipady) {
19 this.gridx = gridx;
20 this.gridy = gridy;
21 this.gridwidth = gridwidth;
22 this.gridheight = gridheight;
23 this.weightx = weightx;
24 this.weighty = weighty;
25 this.anchor = anchor;
26 this.fill = fill;
27 if (insets == null) insets =  new javajs.swing.Insets (0, 0, 0, 0);
28 this.insets = insets;
29 this.ipadx = ipadx;
30 this.ipady = ipady;
31 }, "~N,~N,~N,~N,~N,~N,~N,~N,javajs.swing.Insets,~N,~N");
32 Clazz.defineMethod (c$, "getStyle", 
33 function (margins) {
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")) + "'";
35 }, "~B");
36 Clazz.defineStatics (c$,
37 "NONE", 0,
38 "CENTER", 10,
39 "WEST", 17,
40 "EAST", 13);
41 });