1 Clazz.declarePackage ("javax.swing.colorchooser");
\r
2 Clazz.load (["javax.swing.JPanel", "javax.swing.event.ChangeListener"], "javax.swing.colorchooser.AbstractColorChooserPanel", ["java.lang.RuntimeException", "javax.swing.UIManager"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
5 this.colorListener = null;
\r
7 if (!Clazz.isClassDefined ("javax.swing.colorchooser.AbstractColorChooserPanel.ModelListener")) {
\r
8 javax.swing.colorchooser.AbstractColorChooserPanel.$AbstractColorChooserPanel$ModelListener$ ();
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, javax.swing.colorchooser, "AbstractColorChooserPanel", javax.swing.JPanel);
\r
12 Clazz.defineMethod (c$, "getMnemonic",
\r
16 Clazz.defineMethod (c$, "getDisplayedMnemonicIndex",
\r
20 Clazz.defineMethod (c$, "installChooserPanel",
\r
21 function (enclosingChooser) {
\r
22 if (this.chooser != null) {
\r
23 throw new RuntimeException ("This chooser panel is already installed");
\r
24 }this.chooser = enclosingChooser;
\r
25 this.buildChooser ();
\r
26 this.updateChooser ();
\r
27 this.colorListener = Clazz.innerTypeInstance (javax.swing.colorchooser.AbstractColorChooserPanel.ModelListener, this, null);
\r
28 this.getColorSelectionModel ().addChangeListener (this.colorListener);
\r
29 }, "javax.swing.JColorChooser");
\r
30 Clazz.defineMethod (c$, "uninstallChooserPanel",
\r
31 function (enclosingChooser) {
\r
32 this.getColorSelectionModel ().removeChangeListener (this.colorListener);
\r
33 this.chooser = null;
\r
34 }, "javax.swing.JColorChooser");
\r
35 Clazz.defineMethod (c$, "getColorSelectionModel",
\r
37 return this.chooser.getSelectionModel ();
\r
39 Clazz.defineMethod (c$, "getColorFromModel",
\r
41 return this.getColorSelectionModel ().getSelectedColor ();
\r
43 Clazz.defineMethod (c$, "paint",
\r
46 this.updateChooser ();
\r
48 }Clazz.superCall (this, javax.swing.colorchooser.AbstractColorChooserPanel, "paint", [g]);
\r
49 }, "java.awt.Graphics");
\r
50 c$.getInt = Clazz.defineMethod (c$, "getInt",
\r
51 function (key, defaultValue) {
\r
52 var value = javax.swing.UIManager.get (key);
\r
53 if (Clazz.instanceOf (value, Integer)) {
\r
54 return (value).intValue ();
\r
55 }if (Clazz.instanceOf (value, String)) {
\r
57 return Integer.parseInt (value);
\r
59 if (Clazz.exceptionOf (nfe, NumberFormatException)) {
\r
64 }return defaultValue;
\r
66 c$.$AbstractColorChooserPanel$ModelListener$ = function () {
\r
67 Clazz.pu$h(self.c$);
\r
68 c$ = Clazz.decorateAsClass (function () {
\r
69 Clazz.prepareCallback (this, arguments);
\r
70 Clazz.instantialize (this, arguments);
\r
71 }, javax.swing.colorchooser.AbstractColorChooserPanel, "ModelListener", null, javax.swing.event.ChangeListener);
\r
72 Clazz.overrideMethod (c$, "stateChanged",
\r
74 if (this.b$["javax.swing.colorchooser.AbstractColorChooserPanel"].isShowing ()) {
\r
75 this.b$["javax.swing.colorchooser.AbstractColorChooserPanel"].updateChooser ();
\r
76 this.b$["javax.swing.colorchooser.AbstractColorChooserPanel"].dirty = false;
\r
78 this.b$["javax.swing.colorchooser.AbstractColorChooserPanel"].dirty = true;
\r
79 }}, "javax.swing.event.ChangeEvent");
\r