1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["java.awt.LayoutManager2", "javax.swing.AbstractAction", "$.JComponent"], "javax.swing.JRootPane", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.BorderLayout", "$.Dimension", "$.IllegalComponentStateException", "javax.swing.JLayeredPane", "$.JPanel", "$.SwingUtilities", "$.UIManager", "jssun.awt.AppContext"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.windowDecorationStyle = 0;
6 this.contentPane = null;
7 this.layeredPane = null;
9 this.defaultButton = null;
10 this.defaultPressAction = null;
11 this.defaultReleaseAction = null;
12 this.useTrueDoubleBuffering = true;
13 if (!Clazz.isClassDefined ("javax.swing.JRootPane.RootLayout")) {
14 javax.swing.JRootPane.$JRootPane$RootLayout$ ();
16 Clazz.instantialize (this, arguments);
17 }, javax.swing, "JRootPane", javax.swing.JComponent);
18 Clazz.makeConstructor (c$,
20 Clazz.superConstructor (this, javax.swing.JRootPane, []);
21 var appletName = jssun.awt.AppContext.getAppContext ().getThreadGroup ().getName ();
22 this.setName (appletName + ".JRootPane");
23 this.setGlassPane (this.createGlassPane ());
24 this.setLayeredPane (this.createLayeredPane ());
25 this.setContentPane (this.createContentPane ());
26 this.setLayout (this.createRootLayout ());
29 Clazz.overrideMethod (c$, "setDoubleBuffered",
32 Clazz.defineMethod (c$, "getWindowDecorationStyle",
34 return this.windowDecorationStyle;
36 Clazz.defineMethod (c$, "setWindowDecorationStyle",
37 function (windowDecorationStyle) {
38 if (windowDecorationStyle < 0 || windowDecorationStyle > 8) {
39 throw new IllegalArgumentException ("Invalid decoration style");
40 }var oldWindowDecorationStyle = this.getWindowDecorationStyle ();
41 this.windowDecorationStyle = windowDecorationStyle;
42 this.firePropertyChangeInt ("windowDecorationStyle", oldWindowDecorationStyle, windowDecorationStyle);
44 Clazz.overrideMethod (c$, "getUI",
48 Clazz.overrideMethod (c$, "updateUI",
50 this.setUI (javax.swing.UIManager.getUI (this));
52 Clazz.overrideMethod (c$, "getUIClassID",
56 Clazz.defineMethod (c$, "createLayeredPane",
58 var p = new javax.swing.JLayeredPane ();
59 p.setName (this.getName () + ".layeredPane");
62 Clazz.defineMethod (c$, "createContentPane",
64 var c = new javax.swing.JPanel ();
65 c.setName (this.getName () + ".contentPane");
66 c.setLayout (((Clazz.isClassDefined ("javax.swing.JRootPane$1") ? 0 : javax.swing.JRootPane.$JRootPane$1$ ()), Clazz.innerTypeInstance (javax.swing.JRootPane$1, this, null)));
69 Clazz.defineMethod (c$, "createGlassPane",
71 var c = new javax.swing.JPanel ();
72 c.setName (this.getName () + ".glassPane");
74 (c).setOpaque (false);
77 Clazz.defineMethod (c$, "createRootLayout",
79 return Clazz.innerTypeInstance (javax.swing.JRootPane.RootLayout, this, null);
81 Clazz.defineMethod (c$, "setJMenuBar",
83 if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar);
85 if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER);
86 }, "javax.swing.JMenuBar");
87 Clazz.defineMethod (c$, "setMenuBar",
89 if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar);
91 if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER);
92 }, "javax.swing.JMenuBar");
93 Clazz.defineMethod (c$, "getJMenuBar",
97 Clazz.defineMethod (c$, "getMenuBar",
101 Clazz.defineMethod (c$, "setContentPane",
103 if (content == null) throw new java.awt.IllegalComponentStateException ("contentPane cannot be set to null.");
104 if (this.contentPane != null && this.contentPane.getParent () === this.layeredPane) this.layeredPane.remove (this.contentPane);
105 this.contentPane = content;
106 this.layeredPane.add (this.contentPane, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER);
107 }, "java.awt.Container");
108 Clazz.defineMethod (c$, "getContentPane",
110 return this.contentPane;
112 Clazz.defineMethod (c$, "setLayeredPane",
114 if (layered == null) throw new java.awt.IllegalComponentStateException ("layeredPane cannot be set to null.");
115 if (this.layeredPane != null && this.layeredPane.getParent () === this) this.remove (this.layeredPane);
116 this.layeredPane = layered;
117 this.add (this.layeredPane, -1);
118 }, "javax.swing.JLayeredPane");
119 Clazz.defineMethod (c$, "getLayeredPane",
121 return this.layeredPane;
123 Clazz.defineMethod (c$, "setGlassPane",
126 throw new NullPointerException ("glassPane cannot be set to null.");
127 }var visible = false;
128 if (this.glassPane != null && this.glassPane.getParent () === this) {
129 this.remove (this.glassPane);
130 visible = this.glassPane.isVisible ();
131 }glass.setVisible (visible);
132 this.glassPane = glass;
133 this.add (this.glassPane, 0);
136 }}, "java.awt.Component");
137 Clazz.defineMethod (c$, "getGlassPane",
139 return this.glassPane;
141 Clazz.overrideMethod (c$, "isValidateRoot",
145 Clazz.overrideMethod (c$, "isOptimizedDrawingEnabled",
147 return !this.glassPane.isVisible ();
149 Clazz.defineMethod (c$, "addNotify",
151 Clazz.superCall (this, javax.swing.JRootPane, "addNotify", []);
152 this.enableEvents (8);
154 Clazz.defineMethod (c$, "setDefaultButton",
155 function (defaultButton) {
156 var oldDefault = this.defaultButton;
157 if (oldDefault !== defaultButton) {
158 this.defaultButton = defaultButton;
159 if (oldDefault != null) {
160 oldDefault.repaint ();
161 }if (defaultButton != null) {
162 defaultButton.repaint ();
163 }}this.firePropertyChangeObject ("defaultButton", oldDefault, defaultButton);
164 }, "javax.swing.JButton");
165 Clazz.defineMethod (c$, "getDefaultButton",
167 return this.defaultButton;
169 Clazz.defineMethod (c$, "setUseTrueDoubleBuffering",
170 function (useTrueDoubleBuffering) {
171 this.useTrueDoubleBuffering = useTrueDoubleBuffering;
173 Clazz.defineMethod (c$, "getUseTrueDoubleBuffering",
175 return this.useTrueDoubleBuffering;
177 Clazz.defineMethod (c$, "disableTrueDoubleBuffering",
180 Clazz.overrideMethod (c$, "addImpl",
181 function (comp, constraints, index) {
182 this.addImplSAEM (comp, constraints, index);
183 if (this.glassPane != null && this.glassPane.getParent () === this && this.getComponent (0) !== this.glassPane) {
184 this.add (this.glassPane, 0);
186 }, "java.awt.Component,~O,~N");
187 c$.$JRootPane$RootLayout$ = function () {
189 c$ = Clazz.decorateAsClass (function () {
190 Clazz.prepareCallback (this, arguments);
191 Clazz.instantialize (this, arguments);
192 }, javax.swing.JRootPane, "RootLayout", null, java.awt.LayoutManager2);
193 Clazz.overrideMethod (c$, "preferredLayoutSize",
197 var d = this.b$["javax.swing.JRootPane"].getInsets ();
198 if (this.b$["javax.swing.JRootPane"].contentPane != null) {
199 b = this.b$["javax.swing.JRootPane"].contentPane.getPreferredSize ();
202 }if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) {
203 c = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize ();
205 c = new java.awt.Dimension (0, 0);
206 }return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom);
207 }, "java.awt.Container");
208 Clazz.overrideMethod (c$, "minimumLayoutSize",
212 var d = this.b$["javax.swing.JRootPane"].getInsets ();
213 if (this.b$["javax.swing.JRootPane"].contentPane != null) {
214 b = this.b$["javax.swing.JRootPane"].contentPane.getMinimumSize ();
217 }if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) {
218 c = this.b$["javax.swing.JRootPane"].menuBar.getMinimumSize ();
220 c = new java.awt.Dimension (0, 0);
221 }return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom);
222 }, "java.awt.Container");
223 Clazz.overrideMethod (c$, "maximumLayoutSize",
227 var d = this.b$["javax.swing.JRootPane"].getInsets ();
228 if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) {
229 c = this.b$["javax.swing.JRootPane"].menuBar.getMaximumSize ();
231 c = new java.awt.Dimension (0, 0);
232 }if (this.b$["javax.swing.JRootPane"].contentPane != null) {
233 b = this.b$["javax.swing.JRootPane"].contentPane.getMaximumSize ();
235 b = new java.awt.Dimension (2147483647, 2147483647 - d.top - d.bottom - c.height - 1);
236 }return new java.awt.Dimension (Math.min (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom);
237 }, "java.awt.Container");
238 Clazz.overrideMethod (c$, "layoutContainer",
240 var b = a.getBounds ();
241 var c = this.b$["javax.swing.JRootPane"].getInsets ();
243 var e = b.width - c.right - c.left;
244 var f = b.height - c.top - c.bottom;
245 if (this.b$["javax.swing.JRootPane"].layeredPane != null) {
246 this.b$["javax.swing.JRootPane"].layeredPane.setBounds (c.left, c.top, e, f);
247 }if (this.b$["javax.swing.JRootPane"].glassPane != null) {
248 this.b$["javax.swing.JRootPane"].glassPane.setBounds (c.left, c.top, e, f);
249 }if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) {
250 var g = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize ();
251 this.b$["javax.swing.JRootPane"].menuBar.setBounds (0, 0, e, g.height);
253 }if (this.b$["javax.swing.JRootPane"].contentPane != null) {
254 this.b$["javax.swing.JRootPane"].contentPane.setBounds (0, d, e, f - d);
255 }}, "java.awt.Container");
256 Clazz.defineMethod (c$, "addLayoutComponent",
258 }, "~S,java.awt.Component");
259 Clazz.overrideMethod (c$, "removeLayoutComponent",
261 }, "java.awt.Component");
262 Clazz.defineMethod (c$, "addLayoutComponent",
264 }, "java.awt.Component,~O");
265 Clazz.overrideMethod (c$, "getLayoutAlignmentX",
268 }, "java.awt.Container");
269 Clazz.overrideMethod (c$, "getLayoutAlignmentY",
272 }, "java.awt.Container");
273 Clazz.overrideMethod (c$, "invalidateLayout",
275 }, "java.awt.Container");
278 c$.$JRootPane$1$ = function () {
280 c$ = Clazz.declareAnonymous (javax.swing, "JRootPane$1", java.awt.BorderLayout);
281 Clazz.defineMethod (c$, "addLayoutComponent",
282 function (comp, constraints) {
283 if (constraints == null) {
284 constraints = "Center";
285 }Clazz.superCall (this, javax.swing.JRootPane$1, "addLayoutComponent", [comp, constraints]);
286 }, "java.awt.Component,~O");
290 c$ = Clazz.decorateAsClass (function () {
294 Clazz.instantialize (this, arguments);
295 }, javax.swing.JRootPane, "DefaultAction", javax.swing.AbstractAction);
296 Clazz.makeConstructor (c$,
298 Clazz.superConstructor (this, javax.swing.JRootPane.DefaultAction, []);
301 }, "javax.swing.JRootPane,~B");
302 Clazz.defineMethod (c$, "setOwner",
305 }, "javax.swing.JButton");
306 Clazz.overrideMethod (c$, "actionPerformed",
308 if (this.owner != null && javax.swing.SwingUtilities.getRootPane (this.owner) === this.root) {
309 var b = this.owner.getModel ();
314 b.setPressed (false);
315 }}}, "java.awt.event.ActionEvent");
316 Clazz.overrideMethod (c$, "isEnabled",
318 return this.owner.getModel ().isEnabled ();
321 Clazz.defineStatics (c$,
322 "$uiClassID", "RootPaneUI",
326 "INFORMATION_DIALOG", 3,
328 "COLOR_CHOOSER_DIALOG", 5,
329 "FILE_CHOOSER_DIALOG", 6,
330 "QUESTION_DIALOG", 7,
331 "WARNING_DIALOG", 8);