c8da5ee5a5cf192441f7cbf138ac0e3f65cd1f0c
[jalviewjs.git] / site / j2s / javax / swing / JSeparator.js
1 Clazz.declarePackage ("javax.swing");\r
2 Clazz.load (["javax.swing.JComponent", "$.SwingConstants"], "javax.swing.JSeparator", ["java.lang.IllegalArgumentException", "javax.swing.UIManager"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.orientation = 0;\r
5 Clazz.instantialize (this, arguments);\r
6 }, javax.swing, "JSeparator", javax.swing.JComponent, javax.swing.SwingConstants);\r
7 Clazz.makeConstructor (c$, \r
8 function () {\r
9 this.construct (0);\r
10 });\r
11 Clazz.makeConstructor (c$, \r
12 function (orientation) {\r
13 Clazz.superConstructor (this, javax.swing.JSeparator, []);\r
14 this.checkOrientation (orientation);\r
15 this.orientation = orientation;\r
16 this.setFocusable (false);\r
17 this.updateUI ();\r
18 }, "~N");\r
19 Clazz.overrideMethod (c$, "getUI", \r
20 function () {\r
21 return this.ui;\r
22 });\r
23 Clazz.overrideMethod (c$, "updateUI", \r
24 function () {\r
25 this.setUI (javax.swing.UIManager.getUI (this));\r
26 });\r
27 Clazz.overrideMethod (c$, "getUIClassID", \r
28 function () {\r
29 return "SeparatorUI";\r
30 });\r
31 Clazz.defineMethod (c$, "getOrientation", \r
32 function () {\r
33 return this.orientation;\r
34 });\r
35 Clazz.defineMethod (c$, "setOrientation", \r
36 function (orientation) {\r
37 if (this.orientation == orientation) {\r
38 return;\r
39 }var oldValue = this.orientation;\r
40 this.checkOrientation (orientation);\r
41 this.orientation = orientation;\r
42 this.firePropertyChangeInt ("orientation", oldValue, orientation);\r
43 this.revalidate ();\r
44 this.repaint ();\r
45 }, "~N");\r
46 Clazz.defineMethod (c$, "checkOrientation", \r
47  function (orientation) {\r
48 switch (orientation) {\r
49 case 1:\r
50 case 0:\r
51 break;\r
52 default:\r
53 throw  new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL");\r
54 }\r
55 }, "~N");\r
56 Clazz.defineMethod (c$, "paramString", \r
57 function () {\r
58 var orientationString = (this.orientation == 0 ? "HORIZONTAL" : "VERTICAL");\r
59 return Clazz.superCall (this, javax.swing.JSeparator, "paramString", []) + ",orientation=" + orientationString;\r
60 });\r
61 Clazz.defineStatics (c$,\r
62 "$uiClassID", "SeparatorUI");\r
63 });\r