1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["java.awt.Frame", "java.awt.event.WindowListener", "javax.swing.SwingConstants"], "javax.swing.SwingUtilities", ["java.lang.Character", "$.Error", "$.Thread", "java.applet.Applet", "java.awt.Component", "$.Container", "$.EventQueue", "$.Point", "$.Rectangle", "$.Window", "java.awt.event.ActionEvent", "$.MouseEvent", "$.MouseWheelEvent", "javax.swing.JComponent", "javax.swing.JComponent.ActionStandin", "javax.swing.JRootPane", "$.RootPaneContainer", "javax.swing.event.MenuDragMouseEvent", "javax.swing.plaf.UIResource", "jssun.awt.AppContext", "jssun.swing.UIAction", "swingjs.api.Interface"], function () {
3 c$ = Clazz.declareType (javax.swing, "SwingUtilities", null, javax.swing.SwingConstants);
4 c$.installSwingDropTargetAsNecessary = Clazz.defineMethod (c$, "installSwingDropTargetAsNecessary",
6 }, "java.awt.Component,javax.swing.TransferHandler");
7 c$.isRectangleContainingRectangle = Clazz.defineMethod (c$, "isRectangleContainingRectangle",
9 if (b.x >= a.x && (b.x + b.width) <= (a.x + a.width) && b.y >= a.y && (b.y + b.height) <= (a.y + a.height)) {
12 }, "java.awt.Rectangle,java.awt.Rectangle");
13 c$.getLocalBounds = Clazz.defineMethod (c$, "getLocalBounds",
14 function (aComponent) {
15 var b = new java.awt.Rectangle (aComponent.getBounds ());
18 }, "java.awt.Component");
19 c$.getWindowAncestor = Clazz.defineMethod (c$, "getWindowAncestor",
21 for (var p = c.getParent (); p != null; p = p.getParent ()) {
22 if (Clazz.instanceOf (p, java.awt.Window)) {
26 }, "java.awt.Component");
27 c$.convertScreenLocationToParent = Clazz.defineMethod (c$, "convertScreenLocationToParent",
28 function (parent, x, y) {
29 for (var p = parent; p != null; p = p.getParent ()) {
30 if (Clazz.instanceOf (p, java.awt.Window)) {
31 var point = new java.awt.Point (x, y);
32 javax.swing.SwingUtilities.convertPointFromScreen (point, parent);
35 throw new Error ("convertScreenLocationToParent: no window ancestor");
36 }, "java.awt.Container,~N,~N");
37 c$.convertPoint = Clazz.defineMethod (c$, "convertPoint",
38 function (source, aPoint, destination) {
40 if (source == null && destination == null) return aPoint;
42 source = javax.swing.SwingUtilities.getWindowAncestor (destination);
43 if (source == null) throw new Error ("Source component not connected to component tree hierarchy");
44 }p = new java.awt.Point (aPoint);
45 javax.swing.SwingUtilities.convertPointToScreen (p, source);
46 if (destination == null) {
47 destination = javax.swing.SwingUtilities.getWindowAncestor (source);
48 if (destination == null) throw new Error ("Destination component not connected to component tree hierarchy");
49 }javax.swing.SwingUtilities.convertPointFromScreen (p, destination);
51 }, "java.awt.Component,java.awt.Point,java.awt.Component");
52 c$.convertPoint = Clazz.defineMethod (c$, "convertPoint",
53 function (source, x, y, destination) {
54 var point = new java.awt.Point (x, y);
55 return javax.swing.SwingUtilities.convertPoint (source, point, destination);
56 }, "java.awt.Component,~N,~N,java.awt.Component");
57 c$.convertRectangle = Clazz.defineMethod (c$, "convertRectangle",
58 function (source, aRectangle, destination) {
59 var point = new java.awt.Point (aRectangle.x, aRectangle.y);
60 point = javax.swing.SwingUtilities.convertPoint (source, point, destination);
61 return new java.awt.Rectangle (point.x, point.y, aRectangle.width, aRectangle.height);
62 }, "java.awt.Component,java.awt.Rectangle,java.awt.Component");
63 c$.getAncestorOfClass = Clazz.defineMethod (c$, "getAncestorOfClass",
65 if (comp == null || c == null) return null;
66 var parent = comp.getParent ();
67 while (parent != null && !(c.isInstance (parent))) parent = parent.getParent ();
70 }, "Class,java.awt.Component");
71 c$.getAncestorNamed = Clazz.defineMethod (c$, "getAncestorNamed",
72 function (name, comp) {
73 if (comp == null || name == null) return null;
74 var parent = comp.getParent ();
75 while (parent != null && !(name.equals (parent.getName ()))) parent = parent.getParent ();
78 }, "~S,java.awt.Component");
79 c$.getDeepestComponentAt = Clazz.defineMethod (c$, "getDeepestComponentAt",
80 function (parent, x, y) {
81 if (!parent.contains (x, y)) {
83 }if (Clazz.instanceOf (parent, java.awt.Container)) {
84 var components = (parent).getComponents ();
85 for (var i = 0; i < components.length; i++) {
86 var comp = components[i];
87 if (comp != null && comp.isVisible ()) {
88 var loc = comp.getLocation ();
89 if (Clazz.instanceOf (comp, java.awt.Container)) {
90 comp = javax.swing.SwingUtilities.getDeepestComponentAt (comp, x - loc.x, y - loc.y);
92 comp = comp.getComponentAt (x - loc.x, y - loc.y);
93 }if (comp != null && comp.isVisible ()) {
97 }, "java.awt.Component,~N,~N");
98 c$.convertMouseEvent = Clazz.defineMethod (c$, "convertMouseEvent",
99 function (source, sourceEvent, destination) {
100 var p = javax.swing.SwingUtilities.convertPoint (source, new java.awt.Point (sourceEvent.getX (), sourceEvent.getY ()), destination);
102 if (destination != null) newSource = destination;
103 else newSource = source;
105 if (Clazz.instanceOf (sourceEvent, java.awt.event.MouseWheelEvent)) {
106 var sourceWheelEvent = sourceEvent;
107 newEvent = new java.awt.event.MouseWheelEvent (newSource, sourceWheelEvent.getID (), sourceWheelEvent.getWhen (), sourceWheelEvent.getModifiers (), p.x, p.y, sourceWheelEvent.getXOnScreen (), sourceWheelEvent.getYOnScreen (), sourceWheelEvent.getClickCount (), sourceWheelEvent.isPopupTrigger (), sourceWheelEvent.getScrollType (), sourceWheelEvent.getScrollAmount (), sourceWheelEvent.getWheelRotation ());
108 } else if (Clazz.instanceOf (sourceEvent, javax.swing.event.MenuDragMouseEvent)) {
109 var sourceMenuDragEvent = sourceEvent;
110 newEvent = new javax.swing.event.MenuDragMouseEvent (newSource, sourceMenuDragEvent.getID (), sourceMenuDragEvent.getWhen (), sourceMenuDragEvent.getModifiers (), p.x, p.y, sourceMenuDragEvent.getXOnScreen (), sourceMenuDragEvent.getYOnScreen (), sourceMenuDragEvent.getClickCount (), sourceMenuDragEvent.isPopupTrigger (), sourceMenuDragEvent.getPath (), sourceMenuDragEvent.getMenuSelectionManager ());
112 newEvent = new java.awt.event.MouseEvent (newSource, sourceEvent.getID (), sourceEvent.getWhen (), sourceEvent.getModifiers (), p.x, p.y, sourceEvent.getXOnScreen (), sourceEvent.getYOnScreen (), sourceEvent.getClickCount (), sourceEvent.isPopupTrigger (), 0);
114 }, "java.awt.Component,java.awt.event.MouseEvent,java.awt.Component");
115 c$.convertPointToScreen = Clazz.defineMethod (c$, "convertPointToScreen",
120 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
123 } else if (Clazz.instanceOf (c, java.applet.Applet) || Clazz.instanceOf (c, java.awt.Window)) {
125 var pp = c.getLocationOnScreen ();
129 if (Clazz.exceptionOf (icse, java.awt.IllegalComponentStateException)) {
141 if (Clazz.instanceOf (c, java.awt.Window) || Clazz.instanceOf (c, java.applet.Applet)) break;
144 }, "java.awt.Point,java.awt.Component");
145 c$.convertPointFromScreen = Clazz.defineMethod (c$, "convertPointFromScreen",
150 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
153 } else if (Clazz.instanceOf (c, java.applet.Applet) || Clazz.instanceOf (c, java.awt.Window)) {
155 var pp = c.getLocationOnScreen ();
159 if (Clazz.exceptionOf (icse, java.awt.IllegalComponentStateException)) {
171 if (Clazz.instanceOf (c, java.awt.Window) || Clazz.instanceOf (c, java.applet.Applet)) break;
174 }, "java.awt.Point,java.awt.Component");
175 c$.windowForComponent = Clazz.defineMethod (c$, "windowForComponent",
177 return javax.swing.SwingUtilities.getWindowAncestor (c);
178 }, "java.awt.Component");
179 c$.isDescendingFrom = Clazz.defineMethod (c$, "isDescendingFrom",
181 if (a === b) return true;
182 for (var p = a.getParent (); p != null; p = p.getParent ()) if (p === b) return true;
185 }, "java.awt.Component,java.awt.Component");
186 c$.computeIntersection = Clazz.defineMethod (c$, "computeIntersection",
187 function (x, y, width, height, dest) {
188 var x1 = (x > dest.x) ? x : dest.x;
189 var x2 = ((x + width) < (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width);
190 var y1 = (y > dest.y) ? y : dest.y;
191 var y2 = ((y + height) < (dest.y + dest.height) ? (y + height) : (dest.y + dest.height));
194 dest.width = x2 - x1;
195 dest.height = y2 - y1;
196 if (dest.width < 0 || dest.height < 0) {
197 dest.x = dest.y = dest.width = dest.height = 0;
199 }, "~N,~N,~N,~N,java.awt.Rectangle");
200 c$.computeUnion = Clazz.defineMethod (c$, "computeUnion",
201 function (x, y, width, height, dest) {
202 var x1 = (x < dest.x) ? x : dest.x;
203 var x2 = ((x + width) > (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width);
204 var y1 = (y < dest.y) ? y : dest.y;
205 var y2 = ((y + height) > (dest.y + dest.height)) ? (y + height) : (dest.y + dest.height);
208 dest.width = (x2 - x1);
209 dest.height = (y2 - y1);
211 }, "~N,~N,~N,~N,java.awt.Rectangle");
212 c$.computeDifference = Clazz.defineMethod (c$, "computeDifference",
213 function (rectA, rectB) {
214 if (rectB == null || !rectA.intersects (rectB) || javax.swing.SwingUtilities.isRectangleContainingRectangle (rectB, rectA)) {
215 return new Array (0);
216 }var t = new java.awt.Rectangle ();
223 if (javax.swing.SwingUtilities.isRectangleContainingRectangle (rectA, rectB)) {
226 t.width = rectB.x - rectA.x;
227 t.height = rectA.height;
228 if (t.width > 0 && t.height > 0) {
229 a = new java.awt.Rectangle (t);
233 t.width = rectB.width;
234 t.height = rectB.y - rectA.y;
235 if (t.width > 0 && t.height > 0) {
236 b = new java.awt.Rectangle (t);
239 t.y = rectB.y + rectB.height;
240 t.width = rectB.width;
241 t.height = rectA.y + rectA.height - (rectB.y + rectB.height);
242 if (t.width > 0 && t.height > 0) {
243 c = new java.awt.Rectangle (t);
245 }t.x = rectB.x + rectB.width;
247 t.width = rectA.x + rectA.width - (rectB.x + rectB.width);
248 t.height = rectA.height;
249 if (t.width > 0 && t.height > 0) {
250 d = new java.awt.Rectangle (t);
253 if (rectB.x <= rectA.x && rectB.y <= rectA.y) {
254 if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) {
256 t.y = rectB.y + rectB.height;
257 t.width = rectA.width;
258 t.height = rectA.y + rectA.height - (rectB.y + rectB.height);
259 if (t.width > 0 && t.height > 0) {
262 }} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) {
263 t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
264 if (t.width > 0 && t.height > 0) {
268 t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectB.y + rectB.height) - rectA.y);
269 if (t.width > 0 && t.height > 0) {
270 a = new java.awt.Rectangle (t);
272 }t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
273 if (t.width > 0 && t.height > 0) {
274 b = new java.awt.Rectangle (t);
276 }}} else if (rectB.x <= rectA.x && (rectB.y + rectB.height) >= (rectA.y + rectA.height)) {
277 if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) {
278 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
279 if (t.width > 0 && t.height > 0) {
283 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
284 if (t.width > 0 && t.height > 0) {
285 a = new java.awt.Rectangle (t);
287 }t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectA.y + rectA.height) - rectB.y);
288 if (t.width > 0 && t.height > 0) {
289 b = new java.awt.Rectangle (t);
291 }}} else if (rectB.x <= rectA.x) {
292 if ((rectB.x + rectB.width) >= (rectA.x + rectA.width)) {
293 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
294 if (t.width > 0 && t.height > 0) {
295 a = new java.awt.Rectangle (t);
297 }t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
298 if (t.width > 0 && t.height > 0) {
299 b = new java.awt.Rectangle (t);
302 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
303 if (t.width > 0 && t.height > 0) {
304 a = new java.awt.Rectangle (t);
306 }t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectB.height);
307 if (t.width > 0 && t.height > 0) {
308 b = new java.awt.Rectangle (t);
310 }t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
311 if (t.width > 0 && t.height > 0) {
312 c = new java.awt.Rectangle (t);
314 }}} else if (rectB.x <= (rectA.x + rectA.width) && (rectB.x + rectB.width) > (rectA.x + rectA.width)) {
315 if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) {
316 t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
317 if (t.width > 0 && t.height > 0) {
320 }} else if (rectB.y <= rectA.y) {
321 t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, (rectB.y + rectB.height) - rectA.y);
322 if (t.width > 0 && t.height > 0) {
323 a = new java.awt.Rectangle (t);
325 }t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
326 if (t.width > 0 && t.height > 0) {
327 b = new java.awt.Rectangle (t);
329 }} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) {
330 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
331 if (t.width > 0 && t.height > 0) {
332 a = new java.awt.Rectangle (t);
334 }t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, (rectA.y + rectA.height) - rectB.y);
335 if (t.width > 0 && t.height > 0) {
336 b = new java.awt.Rectangle (t);
339 t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y);
340 if (t.width > 0 && t.height > 0) {
341 a = new java.awt.Rectangle (t);
343 }t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, rectB.height);
344 if (t.width > 0 && t.height > 0) {
345 b = new java.awt.Rectangle (t);
347 }t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
348 if (t.width > 0 && t.height > 0) {
349 c = new java.awt.Rectangle (t);
351 }}} else if (rectB.x >= rectA.x && (rectB.x + rectB.width) <= (rectA.x + rectA.width)) {
352 if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) {
353 t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
354 if (t.width > 0 && t.height > 0) {
355 a = new java.awt.Rectangle (t);
357 }t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
358 if (t.width > 0 && t.height > 0) {
359 b = new java.awt.Rectangle (t);
361 }} else if (rectB.y <= rectA.y) {
362 t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
363 if (t.width > 0 && t.height > 0) {
364 a = new java.awt.Rectangle (t);
366 }t.reshape (rectB.x, (rectB.y + rectB.height), rectB.width, (rectA.y + rectA.height) - (rectB.y + rectB.height));
367 if (t.width > 0 && t.height > 0) {
368 b = new java.awt.Rectangle (t);
370 }t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
371 if (t.width > 0 && t.height > 0) {
372 c = new java.awt.Rectangle (t);
375 t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height);
376 if (t.width > 0 && t.height > 0) {
377 a = new java.awt.Rectangle (t);
379 }t.reshape (rectB.x, rectA.y, rectB.width, rectB.y - rectA.y);
380 if (t.width > 0 && t.height > 0) {
381 b = new java.awt.Rectangle (t);
383 }t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height);
384 if (t.width > 0 && t.height > 0) {
385 c = new java.awt.Rectangle (t);
387 }}}}result = new Array (rectCount);
389 if (a != null) result[rectCount++] = a;
390 if (b != null) result[rectCount++] = b;
391 if (c != null) result[rectCount++] = c;
392 if (d != null) result[rectCount++] = d;
394 }, "java.awt.Rectangle,java.awt.Rectangle");
395 c$.isLeftMouseButton = Clazz.defineMethod (c$, "isLeftMouseButton",
397 return ((anEvent.getModifiers () & 16) != 0);
398 }, "java.awt.event.MouseEvent");
399 c$.isMiddleMouseButton = Clazz.defineMethod (c$, "isMiddleMouseButton",
401 return ((anEvent.getModifiers () & 8) == 8);
402 }, "java.awt.event.MouseEvent");
403 c$.isRightMouseButton = Clazz.defineMethod (c$, "isRightMouseButton",
405 return ((anEvent.getModifiers () & 4) == 4);
406 }, "java.awt.event.MouseEvent");
407 c$.paintComponent = Clazz.defineMethod (c$, "paintComponent",
408 function (g, c, p, x, y, w, h) {
409 javax.swing.SwingUtilities.getCellRendererPane (c, p).paintComponent (g, c, p, x, y, w, h, false);
410 }, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N");
411 c$.paintComponent = Clazz.defineMethod (c$, "paintComponent",
412 function (g, c, p, r) {
413 javax.swing.SwingUtilities.paintComponent (g, c, p, r.x, r.y, r.width, r.height);
414 }, "java.awt.Graphics,java.awt.Component,java.awt.Container,java.awt.Rectangle");
415 c$.getCellRendererPane = Clazz.defineMethod (c$, "getCellRendererPane",
417 var shell = c.getParent ();
418 if (Clazz.instanceOf (shell, javax.swing.CellRendererPane)) {
419 if (shell.getParent () !== p) {
422 shell = swingjs.api.Interface.getInstance ("javax.swing.CellRendererPane", false);
426 }, "java.awt.Component,java.awt.Container");
427 c$.updateComponentTreeUI = Clazz.defineMethod (c$, "updateComponentTreeUI",
429 javax.swing.SwingUtilities.updateComponentTreeUI0 (c);
433 }, "java.awt.Component");
434 c$.updateComponentTreeUI0 = Clazz.defineMethod (c$, "updateComponentTreeUI0",
436 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
439 var jpm = jc.getComponentPopupMenu ();
441 javax.swing.SwingUtilities.updateComponentTreeUI (jpm);
442 }}var children = null;
443 if (Clazz.instanceOf (c, javax.swing.JMenu)) {
444 children = (c).getMenuComponents ();
445 } else if (Clazz.instanceOf (c, java.awt.Container)) {
446 children = (c).getComponents ();
447 }if (children != null) {
448 for (var i = 0; i < children.length; i++) {
449 javax.swing.SwingUtilities.updateComponentTreeUI0 (children[i]);
451 }}, "java.awt.Component");
452 c$.invokeLater = Clazz.defineMethod (c$, "invokeLater",
454 java.awt.EventQueue.invokeLater (doRun);
456 c$.invokeAndWait = Clazz.defineMethod (c$, "invokeAndWait",
458 java.awt.EventQueue.invokeAndWait (doRun);
460 c$.isEventDispatchThread = Clazz.defineMethod (c$, "isEventDispatchThread",
462 return java.awt.EventQueue.isDispatchThread ();
464 c$.getRootPane = Clazz.defineMethod (c$, "getRootPane",
466 if (Clazz.instanceOf (c, javax.swing.RootPaneContainer)) {
467 return (c).getRootPane ();
468 }for (; c != null; c = c.getParent ()) {
469 if (Clazz.instanceOf (c, javax.swing.JRootPane)) {
473 }, "java.awt.Component");
474 c$.getRoot = Clazz.defineMethod (c$, "getRoot",
477 for (var p = c; p != null; p = p.getParent ()) {
478 if (Clazz.instanceOf (p, java.awt.Window)) {
480 }if (Clazz.instanceOf (p, java.applet.Applet)) {
484 }, "java.awt.Component");
485 c$.processKeyBindings = Clazz.defineMethod (c$, "processKeyBindings",
488 if (event.isConsumed ()) {
490 }var component = event.getComponent ();
491 var pressed = (event.getID () == 401);
492 if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (event)) {
494 }while (component != null) {
495 if (Clazz.instanceOf (component, javax.swing.JComponent)) {
496 return (component).processKeyBindings (event, pressed);
497 }if ((Clazz.instanceOf (component, java.applet.Applet)) || (Clazz.instanceOf (component, java.awt.Window))) {
498 return javax.swing.JComponent.processKeyBindingsForAllComponents (event, component, pressed);
499 }component = component.getParent ();
502 }, "java.awt.event.KeyEvent");
503 c$.isValidKeyEventForKeyBindings = Clazz.defineMethod (c$, "isValidKeyEventForKeyBindings",
505 if (e.getID () == 400) {
506 var mod = e.getModifiers ();
507 if (((mod & 8) != 0) && ((mod & 2) == 0)) {
510 }, "java.awt.event.KeyEvent");
511 c$.notifyAction = Clazz.defineMethod (c$, "notifyAction",
512 function (action, ks, event, sender, modifiers) {
513 if (action == null) {
515 }if (Clazz.instanceOf (action, jssun.swing.UIAction)) {
516 if (!(action).isEnabled (sender)) {
518 }} else if (!action.isEnabled ()) {
522 commandO = action.getValue ("ActionCommandKey");
523 if (commandO == null && (Clazz.instanceOf (action, javax.swing.JComponent.ActionStandin))) {
528 if (commandO != null) {
529 command = commandO.toString ();
530 } else if (!stayNull && event.getKeyChar () != '\uffff') {
531 command = String.valueOf (event.getKeyChar ());
534 }action.actionPerformed ( new java.awt.event.ActionEvent (sender, 1001, command, event.getWhen (), modifiers));
536 }, "javax.swing.Action,javax.swing.KeyStroke,java.awt.event.KeyEvent,~O,~N");
537 c$.replaceUIInputMap = Clazz.defineMethod (c$, "replaceUIInputMap",
538 function (component, type, uiInputMap) {
539 var map = component.getInputMap (type, (uiInputMap != null));
540 while (map != null) {
541 var parent = map.getParent ();
542 if (parent == null || (Clazz.instanceOf (parent, javax.swing.plaf.UIResource))) {
543 map.setParent (uiInputMap);
547 }, "javax.swing.JComponent,~N,javax.swing.InputMap");
548 c$.replaceUIActionMap = Clazz.defineMethod (c$, "replaceUIActionMap",
549 function (component, uiActionMap) {
550 var map = component.getActionMap ((uiActionMap != null));
551 ;while (map != null) {
552 var parent = map.getParent ();
553 if (parent == null || (Clazz.instanceOf (parent, javax.swing.plaf.UIResource))) {
554 map.setParent (uiActionMap);
558 }, "javax.swing.JComponent,javax.swing.ActionMap");
559 c$.getUIInputMap = Clazz.defineMethod (c$, "getUIInputMap",
560 function (component, condition) {
561 var map = component.getInputMap (condition, false);
562 while (map != null) {
563 var parent = map.getParent ();
564 if (Clazz.instanceOf (parent, javax.swing.plaf.UIResource)) {
569 }, "javax.swing.JComponent,~N");
570 c$.getUIActionMap = Clazz.defineMethod (c$, "getUIActionMap",
571 function (component) {
572 var map = component.getActionMap (false);
573 while (map != null) {
574 var parent = map.getParent ();
575 if (Clazz.instanceOf (parent, javax.swing.plaf.UIResource)) {
580 }, "javax.swing.JComponent");
581 c$.getSharedOwnerFrame = Clazz.defineMethod (c$, "getSharedOwnerFrame",
583 var sharedOwnerFrame = javax.swing.SwingUtilities.appContextGet (javax.swing.SwingUtilities.sharedOwnerFrameKey);
584 if (sharedOwnerFrame == null) {
585 sharedOwnerFrame = new javax.swing.SwingUtilities.SharedOwnerFrame ();
586 javax.swing.SwingUtilities.appContextPut (javax.swing.SwingUtilities.sharedOwnerFrameKey, sharedOwnerFrame);
587 }return sharedOwnerFrame;
589 c$.getSharedOwnerFrameShutdownListener = Clazz.defineMethod (c$, "getSharedOwnerFrameShutdownListener",
591 var sharedOwnerFrame = javax.swing.SwingUtilities.getSharedOwnerFrame ();
592 return sharedOwnerFrame;
594 c$.appContextGet = Clazz.defineMethod (c$, "appContextGet",
596 return jssun.awt.AppContext.getAppContext ().get (key);
598 c$.appContextPut = Clazz.defineMethod (c$, "appContextPut",
599 function (key, value) {
600 jssun.awt.AppContext.getAppContext ().put (key, value);
602 c$.appContextRemove = Clazz.defineMethod (c$, "appContextRemove",
604 jssun.awt.AppContext.getAppContext ().remove (key);
606 c$.loadSystemClass = Clazz.defineMethod (c$, "loadSystemClass",
607 function (className) {
608 return Clazz._4Name (className, true, Thread.currentThread ().getContextClassLoader ());
610 c$.isLeftToRight = Clazz.defineMethod (c$, "isLeftToRight",
612 return c.getComponentOrientation ().isLeftToRight ();
613 }, "java.awt.Component");
614 c$.doesIconReferenceImage = Clazz.defineMethod (c$, "doesIconReferenceImage",
615 function (icon, image) {
616 var iconImage = (icon != null && (Clazz.instanceOf (icon, javax.swing.ImageIcon))) ? (icon).getImage () : null;
617 return (iconImage === image);
618 }, "javax.swing.Icon,java.awt.Image");
619 c$.findDisplayedMnemonicIndex = Clazz.defineMethod (c$, "findDisplayedMnemonicIndex",
620 function (text, mnemonic) {
621 if (text == null || mnemonic == 0) {
623 }var uc = Character.toUpperCase (String.fromCharCode (mnemonic));
624 var lc = Character.toLowerCase (String.fromCharCode (mnemonic));
625 var uci = text.indexOf (uc);
626 var lci = text.indexOf (lc);
629 } else if (lci == -1) {
632 return (lci < uci) ? lci : uci;
634 c$.calculateInnerArea = Clazz.defineMethod (c$, "calculateInnerArea",
639 var insets = c.getInsets ();
641 rect = new java.awt.Rectangle ();
642 }rect.x = insets.left;
644 rect.width = c.getWidth () - insets.left - insets.right;
645 rect.height = c.getHeight () - insets.top - insets.bottom;
647 }, "javax.swing.JComponent,java.awt.Rectangle");
648 c$.updateRendererOrEditorUI = Clazz.defineMethod (c$, "updateRendererOrEditorUI",
649 function (rendererOrEditor) {
650 if (rendererOrEditor == null) {
652 }var component = null;
653 if (Clazz.instanceOf (rendererOrEditor, java.awt.Component)) {
654 component = rendererOrEditor;
655 }if (Clazz.instanceOf (rendererOrEditor, javax.swing.DefaultCellEditor)) {
656 component = (rendererOrEditor).getComponent ();
657 }if (component != null) {
658 javax.swing.SwingUtilities.updateComponentTreeUI (component);
661 c$ = Clazz.declareType (javax.swing.SwingUtilities, "SharedOwnerFrame", java.awt.Frame, java.awt.event.WindowListener);
662 Clazz.defineMethod (c$, "addNotify",
664 Clazz.superCall (this, javax.swing.SwingUtilities.SharedOwnerFrame, "addNotify", []);
665 this.installListeners ();
667 Clazz.defineMethod (c$, "installListeners",
669 var a = this.getOwnedWindows ();
670 for (var b = 0; b < a.length; b++) {
673 c.removeWindowListener (this);
674 c.addWindowListener (this);
677 Clazz.overrideMethod (c$, "windowClosed",
679 var b = this.getOwnedWindows ();
680 for (var c = 0; c < b.length; c++) {
683 if (d.isDisplayable ()) {
685 }d.removeWindowListener (this);
688 }, "java.awt.event.WindowEvent");
689 Clazz.overrideMethod (c$, "windowOpened",
691 }, "java.awt.event.WindowEvent");
692 Clazz.overrideMethod (c$, "windowClosing",
694 }, "java.awt.event.WindowEvent");
695 Clazz.overrideMethod (c$, "windowIconified",
697 }, "java.awt.event.WindowEvent");
698 Clazz.overrideMethod (c$, "windowDeiconified",
700 }, "java.awt.event.WindowEvent");
701 Clazz.overrideMethod (c$, "windowActivated",
703 }, "java.awt.event.WindowEvent");
704 Clazz.overrideMethod (c$, "windowDeactivated",
706 }, "java.awt.event.WindowEvent");
707 Clazz.defineMethod (c$, "show",
710 Clazz.overrideMethod (c$, "dispose",
714 c$.sharedOwnerFrameKey = c$.prototype.sharedOwnerFrameKey = new Clazz._O ();