Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / javax / swing / JCheckBox.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JToggleButton"], "javax.swing.JCheckBox", ["java.lang.Boolean", "javax.swing.UIManager"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.flat = false;
5 Clazz.instantialize (this, arguments);
6 }, javax.swing, "JCheckBox", javax.swing.JToggleButton);
7 Clazz.makeConstructor (c$, 
8 function () {
9 this.construct (null, null, false);
10 });
11 Clazz.makeConstructor (c$, 
12 function (icon) {
13 this.construct (null, icon, false);
14 }, "javax.swing.Icon");
15 Clazz.makeConstructor (c$, 
16 function (icon, selected) {
17 this.construct (null, icon, selected);
18 }, "javax.swing.Icon,~B");
19 Clazz.makeConstructor (c$, 
20 function (text) {
21 this.construct (text, null, false);
22 }, "~S");
23 Clazz.makeConstructor (c$, 
24 function (a) {
25 this.construct ();
26 this.setAction (a);
27 }, "javax.swing.Action");
28 Clazz.makeConstructor (c$, 
29 function (text, selected) {
30 this.construct (text, null, selected);
31 }, "~S,~B");
32 Clazz.makeConstructor (c$, 
33 function (text, icon) {
34 this.construct (text, icon, false);
35 }, "~S,javax.swing.Icon");
36 Clazz.makeConstructor (c$, 
37 function (text, icon, selected) {
38 Clazz.superConstructor (this, javax.swing.JCheckBox, [text, icon, selected]);
39 this.setUIProperty ("borderPainted", Boolean.FALSE);
40 this.setHorizontalAlignment (10);
41 }, "~S,javax.swing.Icon,~B");
42 Clazz.defineMethod (c$, "setBorderPaintedFlat", 
43 function (b) {
44 var oldValue = this.flat;
45 this.flat = b;
46 this.firePropertyChangeBool ("borderPaintedFlat", oldValue, this.flat);
47 if (b != oldValue) {
48 this.revalidate ();
49 this.repaint ();
50 }}, "~B");
51 Clazz.defineMethod (c$, "isBorderPaintedFlat", 
52 function () {
53 return this.flat;
54 });
55 Clazz.overrideMethod (c$, "updateUI", 
56 function () {
57 this.setUI (javax.swing.UIManager.getUI (this));
58 });
59 Clazz.overrideMethod (c$, "getUIClassID", 
60 function () {
61 return "CheckBoxUI";
62 });
63 Clazz.overrideMethod (c$, "setIconFromAction", 
64 function (a) {
65 }, "javax.swing.Action");
66 Clazz.defineStatics (c$,
67 "BORDER_PAINTED_FLAT_CHANGED_PROPERTY", "borderPaintedFlat",
68 "$$uiClassID", "CheckBoxUI");
69 });