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