9f6138e118bf499537f81aa048711a4dc0ec60e2
[jalviewjs.git] / site / j2s / javax / swing / Box.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JComponent"], "javax.swing.Box", ["java.awt.AWTError", "$.Dimension", "javax.swing.BoxLayout"], function () {
3 c$ = Clazz.declareType (javax.swing, "Box", javax.swing.JComponent);
4 Clazz.makeConstructor (c$, 
5 function (axis) {
6 Clazz.superConstructor (this, javax.swing.Box);
7 Clazz.superCall (this, javax.swing.Box, "setLayout", [ new javax.swing.BoxLayout (this, axis)]);
8 }, "~N");
9 c$.createHorizontalBox = Clazz.defineMethod (c$, "createHorizontalBox", 
10 function () {
11 return  new javax.swing.Box (0);
12 });
13 c$.createVerticalBox = Clazz.defineMethod (c$, "createVerticalBox", 
14 function () {
15 return  new javax.swing.Box (1);
16 });
17 c$.createRigidArea = Clazz.defineMethod (c$, "createRigidArea", 
18 function (d) {
19 return  new javax.swing.Box.Filler (d, d, d);
20 }, "java.awt.Dimension");
21 c$.createHorizontalStrut = Clazz.defineMethod (c$, "createHorizontalStrut", 
22 function (width) {
23 return  new javax.swing.Box.Filler ( new java.awt.Dimension (width, 0),  new java.awt.Dimension (width, 0),  new java.awt.Dimension (width, 32767));
24 }, "~N");
25 c$.createVerticalStrut = Clazz.defineMethod (c$, "createVerticalStrut", 
26 function (height) {
27 return  new javax.swing.Box.Filler ( new java.awt.Dimension (0, height),  new java.awt.Dimension (0, height),  new java.awt.Dimension (32767, height));
28 }, "~N");
29 c$.createGlue = Clazz.defineMethod (c$, "createGlue", 
30 function () {
31 return  new javax.swing.Box.Filler ( new java.awt.Dimension (0, 0),  new java.awt.Dimension (0, 0),  new java.awt.Dimension (32767, 32767));
32 });
33 c$.createHorizontalGlue = Clazz.defineMethod (c$, "createHorizontalGlue", 
34 function () {
35 return  new javax.swing.Box.Filler ( new java.awt.Dimension (0, 0),  new java.awt.Dimension (0, 0),  new java.awt.Dimension (32767, 0));
36 });
37 c$.createVerticalGlue = Clazz.defineMethod (c$, "createVerticalGlue", 
38 function () {
39 return  new javax.swing.Box.Filler ( new java.awt.Dimension (0, 0),  new java.awt.Dimension (0, 0),  new java.awt.Dimension (0, 32767));
40 });
41 Clazz.defineMethod (c$, "setLayout", 
42 function (l) {
43 throw  new java.awt.AWTError ("Illegal request");
44 }, "java.awt.LayoutManager");
45 Clazz.defineMethod (c$, "paintComponent", 
46 function (g) {
47 if (this.ui != null) {
48 Clazz.superCall (this, javax.swing.Box, "paintComponent", [g]);
49 } else if (this.isOpaque ()) {
50 g.setColor (this.getBackground ());
51 g.fillRect (0, 0, this.getWidth (), this.getHeight ());
52 }}, "java.awt.Graphics");
53 Clazz.pu$h(self.c$);
54 c$ = Clazz.declareType (javax.swing.Box, "Filler", javax.swing.JComponent);
55 Clazz.makeConstructor (c$, 
56 function (a, b, c) {
57 Clazz.superConstructor (this, javax.swing.Box.Filler, []);
58 this.setMinimumSize (a);
59 this.setPreferredSize (b);
60 this.setMaximumSize (c);
61 }, "java.awt.Dimension,java.awt.Dimension,java.awt.Dimension");
62 Clazz.defineMethod (c$, "changeShape", 
63 function (a, b, c) {
64 this.setMinimumSize (a);
65 this.setPreferredSize (b);
66 this.setMaximumSize (c);
67 this.revalidate ();
68 }, "java.awt.Dimension,java.awt.Dimension,java.awt.Dimension");
69 Clazz.defineMethod (c$, "paintComponent", 
70 function (a) {
71 if (this.ui != null) {
72 Clazz.superCall (this, javax.swing.Box.Filler, "paintComponent", [a]);
73 } else if (this.isOpaque ()) {
74 a.setColor (this.getBackground ());
75 a.fillRect (0, 0, this.getWidth (), this.getHeight ());
76 }}, "java.awt.Graphics");
77 c$ = Clazz.p0p ();
78 });