1 Clazz.declarePackage ("javax.swing");
\r
2 Clazz.load (["java.awt.Container", "javax.swing.Action", "java.util.ArrayList", "javax.swing.SwingUtilities", "javax.swing.event.EventListenerList", "jssun.awt.RequestFocusController"], "javax.swing.JComponent", ["java.lang.IllegalArgumentException", "java.util.HashSet", "$.Hashtable", "java.applet.Applet", "java.awt.Component", "$.Insets", "$.Rectangle", "$.Window", "java.beans.PropertyChangeListener", "java.util.Locale", "javax.swing.ActionMap", "$.AncestorNotifier", "$.ArrayTable", "$.CellRendererPane", "$.ClientPropertyKey", "$.ComponentInputMap", "$.InputMap", "$.JApplet", "$.JDialog", "$.JFrame", "$.JWindow", "$.KeyStroke", "$.KeyboardManager", "javax.swing.Popup.HeavyWeightWindow", "javax.swing.RepaintManager", "javax.swing.border.AbstractBorder", "javax.swing.event.AncestorListener", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.isAlignmentXSet = false;
\r
6 this.isAlignmentYSet = false;
\r
9 this.listenerList = null;
\r
10 this.clientProperties = null;
\r
11 this.autoscrolls = false;
\r
14 this.verifyInputWhenFocusTarget = true;
\r
15 this.paintingChild = null;
\r
16 this.popupMenu = null;
\r
17 this.focusInputMap = null;
\r
18 this.ancestorInputMap = null;
\r
19 this.windowInputMap = null;
\r
20 this.actionMap = null;
\r
21 if (!Clazz.isClassDefined ("javax.swing.JComponent.ActionStandin")) {
\r
22 javax.swing.JComponent.$JComponent$ActionStandin$ ();
\r
24 Clazz.instantialize (this, arguments);
\r
25 }, javax.swing, "JComponent", java.awt.Container);
\r
26 Clazz.prepareFields (c$, function () {
\r
27 this.listenerList = new javax.swing.event.EventListenerList ();
\r
29 c$.safelyGetGraphics = Clazz.defineMethod (c$, "safelyGetGraphics",
\r
30 function (c, root) {
\r
32 javax.swing.JComponent.componentObtainingGraphicsFrom = root;
\r
33 var g = c.getGraphics ();
\r
34 javax.swing.JComponent.componentObtainingGraphicsFrom = null;
\r
36 }}, "java.awt.Component,java.awt.Component");
\r
37 c$.getGraphicsInvoked = Clazz.defineMethod (c$, "getGraphicsInvoked",
\r
39 if (!javax.swing.JComponent.isComponentObtainingGraphicsFrom (root)) {
\r
40 var rootPane = (root).getRootPane ();
\r
41 if (rootPane != null) {
\r
42 rootPane.disableTrueDoubleBuffering ();
\r
43 }}}, "java.awt.Component");
\r
44 c$.isComponentObtainingGraphicsFrom = Clazz.defineMethod (c$, "isComponentObtainingGraphicsFrom",
\r
47 return (javax.swing.JComponent.componentObtainingGraphicsFrom === c);
\r
48 }}, "java.awt.Component");
\r
49 c$.getManagingFocusForwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusForwardTraversalKeys",
\r
52 if (javax.swing.JComponent.managingFocusForwardTraversalKeys == null) {
\r
53 javax.swing.JComponent.managingFocusForwardTraversalKeys = new java.util.HashSet (1);
\r
54 javax.swing.JComponent.managingFocusForwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 2));
\r
55 }}return javax.swing.JComponent.managingFocusForwardTraversalKeys;
\r
57 c$.getManagingFocusBackwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusBackwardTraversalKeys",
\r
60 if (javax.swing.JComponent.managingFocusBackwardTraversalKeys == null) {
\r
61 javax.swing.JComponent.managingFocusBackwardTraversalKeys = new java.util.HashSet (1);
\r
62 javax.swing.JComponent.managingFocusBackwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 3));
\r
63 }}return javax.swing.JComponent.managingFocusBackwardTraversalKeys;
\r
65 c$.fetchRectangle = Clazz.defineMethod (c$, "fetchRectangle",
\r
69 var size = javax.swing.JComponent.tempRectangles.size ();
\r
71 rect = javax.swing.JComponent.tempRectangles.remove (size - 1);
\r
73 rect = new java.awt.Rectangle (0, 0, 0, 0);
\r
76 c$.recycleRectangle = Clazz.defineMethod (c$, "recycleRectangle",
\r
79 javax.swing.JComponent.tempRectangles.add (rect);
\r
80 }}, "java.awt.Rectangle");
\r
81 Clazz.defineMethod (c$, "setInheritsPopupMenu",
\r
83 var oldValue = this.getFlag (23);
\r
84 this.setFlag (23, value);
\r
85 this.firePropertyChangeBool ("inheritsPopupMenu", oldValue, value);
\r
87 Clazz.defineMethod (c$, "getInheritsPopupMenu",
\r
89 return this.getFlag (23);
\r
91 Clazz.defineMethod (c$, "setComponentPopupMenu",
\r
93 if (popup != null) {
\r
94 this.enableEvents (16);
\r
95 }var oldPopup = this.popupMenu;
\r
96 this.popupMenu = popup;
\r
97 this.firePropertyChangeObject ("componentPopupMenu", oldPopup, popup);
\r
98 }, "javax.swing.JPopupMenu");
\r
99 Clazz.defineMethod (c$, "getComponentPopupMenu",
\r
101 if (!this.getInheritsPopupMenu ()) {
\r
102 return this.popupMenu;
\r
103 }if (this.popupMenu == null) {
\r
104 var parent = this.getParent ();
\r
105 while (parent != null) {
\r
106 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
\r
107 return (parent).getComponentPopupMenu ();
\r
108 }if (Clazz.instanceOf (parent, java.awt.Window) || Clazz.instanceOf (parent, java.applet.Applet)) {
\r
110 }parent = parent.getParent ();
\r
113 }return this.popupMenu;
\r
115 Clazz.makeConstructor (c$,
\r
117 Clazz.superConstructor (this, javax.swing.JComponent);
\r
118 this.enableEvents (8);
\r
119 Clazz.superCall (this, javax.swing.JComponent, "setLocale", [javax.swing.JComponent.getDefaultLocale ()]);
\r
121 Clazz.defineMethod (c$, "updateUI",
\r
124 Clazz.defineMethod (c$, "setUI",
\r
126 this.uninstallUIAndProperties ();
\r
128 if (this.ui != null) {
\r
129 this.ui.installUI (this);
\r
130 }this.revalidate ();
\r
132 }, "javax.swing.plaf.ComponentUI");
\r
133 Clazz.defineMethod (c$, "getUI",
\r
137 Clazz.defineMethod (c$, "uninstallUIAndProperties",
\r
139 if (this.ui != null) {
\r
140 this.ui.uninstallUI (this);
\r
142 Clazz.defineMethod (c$, "getUIClassID",
\r
144 return "ComponentUI";
\r
146 Clazz.defineMethod (c$, "getComponentGraphics",
\r
148 var componentGraphics = g;
\r
149 componentGraphics.setColor (this.getForeground ());
\r
150 componentGraphics.setFont (this.getFont ());
\r
151 return componentGraphics;
\r
152 }, "java.awt.Graphics");
\r
153 Clazz.defineMethod (c$, "paintComponent",
\r
155 if (this.ui != null) {
\r
156 var scratchGraphics = (g == null) ? null : g.createSwingJS ();
\r
158 this.ui.update (scratchGraphics, this);
\r
160 scratchGraphics.dispose ();
\r
162 }}, "java.awt.Graphics");
\r
163 Clazz.defineMethod (c$, "paintChildren",
\r
168 var i = this.getComponentCount () - 1;
\r
171 }if (this.paintingChild != null && (Clazz.instanceOf (this.paintingChild, javax.swing.JComponent))) {
\r
172 for (; i >= 0; i--) {
\r
173 if (this.getComponent (i) === this.paintingChild) {
\r
176 }var tmpRect = javax.swing.JComponent.fetchRectangle ();
\r
177 for (; i >= 0; i--) {
\r
178 var comp = this.getComponent (i);
\r
179 isJComponent = (Clazz.instanceOf (comp, javax.swing.JComponent));
\r
180 if (comp != null && (isJComponent || javax.swing.JComponent.isLightweightComponent (comp)) && (comp.isVisible () == true)) {
\r
181 var cr = comp.getBounds (tmpRect);
\r
182 var cg = sg.create4 (cr.x, cr.y, cr.width, cr.height);
\r
183 cg.setColor (comp.getForeground ());
\r
184 cg.setFont (comp.getFont ());
\r
185 var shouldSetFlagBack = false;
\r
187 if (isJComponent) {
\r
193 if (shouldSetFlagBack) {
\r
194 (comp).setFlag (1, false);
\r
195 (comp).setFlag (2, false);
\r
198 javax.swing.JComponent.recycleRectangle (tmpRect);
\r
199 }}, "java.awt.Graphics");
\r
200 Clazz.defineMethod (c$, "paintBorder",
\r
202 var border = this.getBorder ();
\r
203 if (border != null) {
\r
204 border.paintBorder (this, g, 0, 0, this.getWidth (), this.getHeight ());
\r
205 }}, "java.awt.Graphics");
\r
206 Clazz.overrideMethod (c$, "update",
\r
209 }, "java.awt.Graphics");
\r
210 Clazz.overrideMethod (c$, "paint",
\r
212 var shouldClearPaintFlags = false;
\r
213 if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) {
\r
215 }var componentGraphics = this.getComponentGraphics (g);
\r
216 var co = componentGraphics.createSwingJS ();
\r
218 if (this.getParent () != null && !(Clazz.instanceOf (this.getParent (), javax.swing.JComponent))) {
\r
219 this.adjustPaintFlags ();
\r
220 shouldClearPaintFlags = true;
\r
221 }this.paintComponent (co);
\r
222 this.paintBorder (co);
\r
223 this.paintChildren (co);
\r
226 if (shouldClearPaintFlags) {
\r
227 this.setFlag (1, false);
\r
228 this.setFlag (2, false);
\r
229 this.setFlag (11, false);
\r
230 this.setFlag (12, false);
\r
232 }, "java.awt.Graphics");
\r
233 Clazz.defineMethod (c$, "paintForceDoubleBuffered",
\r
235 var rm = javax.swing.RepaintManager.currentManager (this);
\r
236 var clip = g.getClipBounds ();
\r
238 this.setFlag (13, true);
\r
240 rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height);
\r
243 this.setFlag (13, false);
\r
245 }, "java.awt.Graphics");
\r
246 Clazz.defineMethod (c$, "isPainting",
\r
248 var component = this;
\r
249 while (component != null) {
\r
250 if (Clazz.instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) {
\r
252 }component = component.getParent ();
\r
256 Clazz.defineMethod (c$, "adjustPaintFlags",
\r
258 var jparent = null;
\r
260 for (parent = this.getParent (); parent != null; parent = parent.getParent ()) {
\r
261 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
\r
263 if (jparent.getFlag (1)) this.setFlag (1, true);
\r
264 if (jparent.getFlag (2)) this.setFlag (2, true);
\r
265 if (jparent.getFlag (11)) this.setFlag (11, true);
\r
266 if (jparent.getFlag (12)) this.setFlag (12, true);
\r
270 Clazz.overrideMethod (c$, "printAll",
\r
272 this.setFlag (12, true);
\r
276 this.setFlag (12, false);
\r
278 }, "java.awt.Graphics");
\r
279 Clazz.overrideMethod (c$, "print",
\r
281 this.setFlag (11, true);
\r
282 this.firePropertyChangeBool ("paintingForPrint", false, true);
\r
286 this.setFlag (11, false);
\r
287 this.firePropertyChangeBool ("paintingForPrint", true, false);
\r
289 }, "java.awt.Graphics");
\r
290 Clazz.defineMethod (c$, "printComponent",
\r
292 this.paintComponent (g);
\r
293 }, "java.awt.Graphics");
\r
294 Clazz.defineMethod (c$, "printChildren",
\r
296 this.paintChildren (g);
\r
297 }, "java.awt.Graphics");
\r
298 Clazz.defineMethod (c$, "printBorder",
\r
300 this.paintBorder (g);
\r
301 }, "java.awt.Graphics");
\r
302 Clazz.defineMethod (c$, "isPaintingTile",
\r
304 return this.getFlag (2);
\r
306 Clazz.defineMethod (c$, "isPaintingForPrint",
\r
308 return this.getFlag (11);
\r
310 Clazz.defineMethod (c$, "isManagingFocus",
\r
314 Clazz.defineMethod (c$, "registerNextFocusableComponent",
\r
316 this.registerNextFocusableComponent (this.getNextFocusableComponent ());
\r
318 Clazz.defineMethod (c$, "registerNextFocusableComponent",
\r
319 function (nextFocusableComponent) {
\r
320 if (nextFocusableComponent == null) {
\r
322 }}, "java.awt.Component");
\r
323 Clazz.defineMethod (c$, "deregisterNextFocusableComponent",
\r
325 var nextFocusableComponent = this.getNextFocusableComponent ();
\r
326 if (nextFocusableComponent == null) {
\r
328 }var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
\r
329 if (nearestRoot == null) {
\r
332 Clazz.defineMethod (c$, "setNextFocusableComponent",
\r
333 function (aComponent) {
\r
334 var displayable = this.isDisplayable ();
\r
336 this.deregisterNextFocusableComponent ();
\r
337 }this.putClientProperty ("nextFocus", aComponent);
\r
339 this.registerNextFocusableComponent (aComponent);
\r
340 }}, "java.awt.Component");
\r
341 Clazz.defineMethod (c$, "getNextFocusableComponent",
\r
343 return this.getClientProperty ("nextFocus");
\r
345 Clazz.defineMethod (c$, "setRequestFocusEnabled",
\r
346 function (requestFocusEnabled) {
\r
347 this.setFlag (22, !requestFocusEnabled);
\r
349 Clazz.defineMethod (c$, "isRequestFocusEnabled",
\r
351 return !this.getFlag (22);
\r
353 Clazz.defineMethod (c$, "requestFocus",
\r
354 function (temporary) {
\r
355 Clazz.superCall (this, javax.swing.JComponent, "requestFocus", []);
\r
358 Clazz.defineMethod (c$, "requestFocusInWindow",
\r
359 function (temporary) {
\r
360 return Clazz.superCall (this, javax.swing.JComponent, "requestFocusInWindow", []);
\r
362 Clazz.defineMethod (c$, "grabFocus",
\r
364 this.requestFocus ();
\r
366 Clazz.defineMethod (c$, "setVerifyInputWhenFocusTarget",
\r
367 function (verifyInputWhenFocusTarget) {
\r
368 var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget;
\r
369 this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
\r
370 this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget);
\r
372 Clazz.defineMethod (c$, "getVerifyInputWhenFocusTarget",
\r
374 return this.verifyInputWhenFocusTarget;
\r
376 Clazz.overrideMethod (c$, "getFontMetrics",
\r
378 return jssun.font.FontDesignMetrics.getMetrics (font);
\r
379 }, "java.awt.Font");
\r
380 Clazz.overrideMethod (c$, "getPreferredSize",
\r
382 return this.getPrefSizeJComp ();
\r
384 Clazz.defineMethod (c$, "getPrefSizeJComp",
\r
386 var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this));
\r
387 return (size == null ? this.preferredSize () : size);
\r
389 Clazz.defineMethod (c$, "getMaximumSize",
\r
391 if (this.isMaximumSizeSet ()) {
\r
392 return Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
\r
394 if (this.ui != null) {
\r
395 size = this.ui.getMaximumSize (this);
\r
396 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
\r
398 Clazz.defineMethod (c$, "getMinimumSize",
\r
400 if (this.isMinimumSizeSet ()) {
\r
401 return Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
\r
403 if (this.ui != null) {
\r
404 size = this.ui.getMinimumSize (this);
\r
405 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
\r
407 Clazz.overrideMethod (c$, "contains",
\r
409 return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y);
\r
411 Clazz.defineMethod (c$, "setBorder",
\r
412 function (border) {
\r
413 var oldBorder = this.border;
\r
414 this.border = border;
\r
415 this.firePropertyChangeObject ("border", oldBorder, border);
\r
416 if (border !== oldBorder) {
\r
417 if (border == null || oldBorder == null || !(border.getBorderInsets (this).equals (oldBorder.getBorderInsets (this)))) {
\r
418 this.revalidate ();
\r
420 }}, "javax.swing.border.Border");
\r
421 Clazz.defineMethod (c$, "getBorder",
\r
423 return this.border;
\r
425 Clazz.defineMethod (c$, "getInsets",
\r
427 if (this.border != null) {
\r
428 return this.border.getBorderInsets (this);
\r
429 }return Clazz.superCall (this, javax.swing.JComponent, "getInsets", []);
\r
431 Clazz.defineMethod (c$, "getInsets",
\r
432 function (insets) {
\r
433 if (insets == null) {
\r
434 insets = new java.awt.Insets (0, 0, 0, 0);
\r
435 }if (this.border != null) {
\r
436 if (Clazz.instanceOf (this.border, javax.swing.border.AbstractBorder)) {
\r
437 return (this.border).getBorderInsets (this, insets);
\r
439 return this.border.getBorderInsets (this);
\r
441 insets.left = insets.top = insets.right = insets.bottom = 0;
\r
443 }}, "java.awt.Insets");
\r
444 Clazz.defineMethod (c$, "getAlignmentY",
\r
446 if (this.isAlignmentYSet) {
\r
447 return this.alignmentY;
\r
448 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentY", []);
\r
450 Clazz.defineMethod (c$, "setAlignmentY",
\r
451 function (alignmentY) {
\r
452 this.alignmentY = alignmentY > 1.0 ? 1.0 : alignmentY < 0.0 ? 0.0 : alignmentY;
\r
453 this.isAlignmentYSet = true;
\r
455 Clazz.defineMethod (c$, "getAlignmentX",
\r
457 if (this.isAlignmentXSet) {
\r
458 return this.alignmentX;
\r
459 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentX", []);
\r
461 Clazz.defineMethod (c$, "setAlignmentX",
\r
462 function (alignmentX) {
\r
463 this.alignmentX = alignmentX > 1.0 ? 1.0 : alignmentX < 0.0 ? 0.0 : alignmentX;
\r
464 this.isAlignmentXSet = true;
\r
466 Clazz.defineMethod (c$, "setInputVerifier",
\r
467 function (inputVerifier) {
\r
468 var oldInputVerifier = this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
\r
469 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER, inputVerifier);
\r
470 this.firePropertyChangeObject ("inputVerifier", oldInputVerifier, inputVerifier);
\r
471 }, "javax.swing.InputVerifier");
\r
472 Clazz.defineMethod (c$, "getInputVerifier",
\r
474 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
\r
476 Clazz.defineMethod (c$, "registerKeyboardAction",
\r
477 function (anAction, aCommand, aKeyStroke, aCondition) {
\r
478 var inputMap = this.getInputMap (aCondition, true);
\r
479 if (inputMap != null) {
\r
480 var actionMap = this.getActionMap (true);
\r
481 var action = Clazz.innerTypeInstance (javax.swing.JComponent.ActionStandin, this, null, anAction, aCommand);
\r
482 inputMap.put (aKeyStroke, action);
\r
483 if (actionMap != null) {
\r
484 actionMap.put (action, action);
\r
485 }}}, "java.awt.event.ActionListener,~S,javax.swing.KeyStroke,~N");
\r
486 Clazz.defineMethod (c$, "registerWithKeyboardManager",
\r
487 function (onlyIfNew) {
\r
488 var inputMap = this.getInputMap (2, false);
\r
490 var registered = this.getClientProperty ("_WhenInFocusedWindow");
\r
491 if (inputMap != null) {
\r
492 strokes = inputMap.allKeys ();
\r
493 if (strokes != null) {
\r
494 for (var counter = strokes.length - 1; counter >= 0; counter--) {
\r
495 if (!onlyIfNew || registered == null || registered.get (strokes[counter]) == null) {
\r
496 this.registerWithKeyboardManager (strokes[counter]);
\r
497 }if (registered != null) {
\r
498 registered.remove (strokes[counter]);
\r
502 }if (registered != null && registered.size () > 0) {
\r
503 var keys = registered.keys ();
\r
504 while (keys.hasMoreElements ()) {
\r
505 var ks = keys.nextElement ();
\r
506 this.unregisterWithKeyboardManager (ks);
\r
508 registered.clear ();
\r
509 }if (strokes != null && strokes.length > 0) {
\r
510 if (registered == null) {
\r
511 registered = new java.util.Hashtable (strokes.length);
\r
512 this.putClientProperty ("_WhenInFocusedWindow", registered);
\r
513 }for (var counter = strokes.length - 1; counter >= 0; counter--) {
\r
514 registered.put (strokes[counter], strokes[counter]);
\r
517 this.putClientProperty ("_WhenInFocusedWindow", null);
\r
519 Clazz.defineMethod (c$, "unregisterWithKeyboardManager",
\r
521 var registered = this.getClientProperty ("_WhenInFocusedWindow");
\r
522 if (registered != null && registered.size () > 0) {
\r
523 var keys = registered.keys ();
\r
524 while (keys.hasMoreElements ()) {
\r
525 var ks = keys.nextElement ();
\r
526 this.unregisterWithKeyboardManager (ks);
\r
528 }this.putClientProperty ("_WhenInFocusedWindow", null);
\r
530 Clazz.defineMethod (c$, "componentInputMapChanged",
\r
531 function (inputMap) {
\r
532 var km = this.getInputMap (2, false);
\r
533 while (km !== inputMap && km != null) {
\r
534 km = km.getParent ();
\r
537 this.registerWithKeyboardManager (false);
\r
538 }}, "javax.swing.ComponentInputMap");
\r
539 Clazz.defineMethod (c$, "registerWithKeyboardManager",
\r
540 function (aKeyStroke) {
\r
541 javax.swing.KeyboardManager.getCurrentManager ().registerKeyStroke (aKeyStroke, this);
\r
542 }, "javax.swing.KeyStroke");
\r
543 Clazz.defineMethod (c$, "unregisterWithKeyboardManager",
\r
544 function (aKeyStroke) {
\r
545 javax.swing.KeyboardManager.getCurrentManager ().unregisterKeyStroke (aKeyStroke, this);
\r
546 }, "javax.swing.KeyStroke");
\r
547 Clazz.defineMethod (c$, "registerKeyboardAction",
\r
548 function (anAction, aKeyStroke, aCondition) {
\r
549 this.registerKeyboardAction (anAction, null, aKeyStroke, aCondition);
\r
550 }, "java.awt.event.ActionListener,javax.swing.KeyStroke,~N");
\r
551 Clazz.defineMethod (c$, "unregisterKeyboardAction",
\r
552 function (aKeyStroke) {
\r
553 var am = this.getActionMap (false);
\r
554 for (var counter = 0; counter < 3; counter++) {
\r
555 var km = this.getInputMap (counter, false);
\r
557 var actionID = km.get (aKeyStroke);
\r
558 if (am != null && actionID != null) {
\r
559 am.remove (actionID);
\r
560 }km.remove (aKeyStroke);
\r
562 }, "javax.swing.KeyStroke");
\r
563 Clazz.defineMethod (c$, "getRegisteredKeyStrokes",
\r
565 var counts = Clazz.newIntArray (3, 0);
\r
566 var strokes = new Array (3);
\r
567 for (var counter = 0; counter < 3; counter++) {
\r
568 var km = this.getInputMap (counter, false);
\r
569 strokes[counter] = (km != null) ? km.allKeys () : null;
\r
570 counts[counter] = (strokes[counter] != null) ? strokes[counter].length : 0;
\r
572 var retValue = new Array (counts[0] + counts[1] + counts[2]);
\r
573 for (var counter = 0, last = 0; counter < 3; counter++) {
\r
574 if (counts[counter] > 0) {
\r
575 System.arraycopy (strokes[counter], 0, retValue, last, counts[counter]);
\r
576 last += counts[counter];
\r
580 Clazz.defineMethod (c$, "getConditionForKeyStroke",
\r
581 function (aKeyStroke) {
\r
582 for (var counter = 0; counter < 3; counter++) {
\r
583 var inputMap = this.getInputMap (counter, false);
\r
584 if (inputMap != null && inputMap.get (aKeyStroke) != null) {
\r
588 }, "javax.swing.KeyStroke");
\r
589 Clazz.defineMethod (c$, "getActionForKeyStroke",
\r
590 function (aKeyStroke) {
\r
591 var am = this.getActionMap (false);
\r
594 }for (var counter = 0; counter < 3; counter++) {
\r
595 var inputMap = this.getInputMap (counter, false);
\r
596 if (inputMap != null) {
\r
597 var actionBinding = inputMap.get (aKeyStroke);
\r
598 if (actionBinding != null) {
\r
599 var action = am.get (actionBinding);
\r
600 if (Clazz.instanceOf (action, javax.swing.JComponent.ActionStandin)) {
\r
601 return (action).actionListener;
\r
605 }, "javax.swing.KeyStroke");
\r
606 Clazz.defineMethod (c$, "resetKeyboardActions",
\r
608 for (var counter = 0; counter < 3; counter++) {
\r
609 var inputMap = this.getInputMap (counter, false);
\r
610 if (inputMap != null) {
\r
613 var am = this.getActionMap (false);
\r
617 Clazz.defineMethod (c$, "setInputMap",
\r
618 function (condition, map) {
\r
619 switch (condition) {
\r
621 if (map != null && !(Clazz.instanceOf (map, javax.swing.ComponentInputMap))) {
\r
622 throw new IllegalArgumentException ("WHEN_IN_FOCUSED_WINDOW InputMaps must be of type ComponentInputMap");
\r
623 }this.windowInputMap = map;
\r
624 this.setFlag (7, true);
\r
625 this.registerWithKeyboardManager (false);
\r
628 this.ancestorInputMap = map;
\r
629 this.setFlag (6, true);
\r
632 this.focusInputMap = map;
\r
633 this.setFlag (5, true);
\r
636 throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
\r
638 }, "~N,javax.swing.InputMap");
\r
639 Clazz.defineMethod (c$, "getInputMap",
\r
640 function (condition) {
\r
641 return this.getInputMap (condition, true);
\r
643 Clazz.defineMethod (c$, "getInputMap",
\r
645 return this.getInputMap (0, true);
\r
647 Clazz.defineMethod (c$, "setActionMap",
\r
649 this.actionMap = am;
\r
650 this.setFlag (8, true);
\r
651 }, "javax.swing.ActionMap");
\r
652 Clazz.defineMethod (c$, "getActionMap",
\r
654 return this.getActionMap (true);
\r
656 Clazz.defineMethod (c$, "getInputMap",
\r
657 function (condition, create) {
\r
658 switch (condition) {
\r
660 if (this.getFlag (5)) {
\r
661 return this.focusInputMap;
\r
663 var km = new javax.swing.InputMap ();
\r
664 this.setInputMap (condition, km);
\r
668 if (this.getFlag (6)) {
\r
669 return this.ancestorInputMap;
\r
671 var km = new javax.swing.InputMap ();
\r
672 this.setInputMap (condition, km);
\r
676 if (this.getFlag (7)) {
\r
677 return this.windowInputMap;
\r
679 var km = new javax.swing.ComponentInputMap (this);
\r
680 this.setInputMap (condition, km);
\r
684 throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
\r
688 Clazz.defineMethod (c$, "getActionMap",
\r
689 function (create) {
\r
691 (arguments.length == 0) && (create = true);
\r
692 }if (this.getFlag (8)) {
\r
693 return this.actionMap;
\r
695 var am = new javax.swing.ActionMap ();
\r
696 this.setActionMap (am);
\r
700 Clazz.defineMethod (c$, "getBaseline",
\r
701 function (width, height) {
\r
702 Clazz.superCall (this, javax.swing.JComponent, "getBaseline", [width, height]);
\r
703 if (this.ui != null) {
\r
704 return this.ui.getBaseline (this, width, height);
\r
707 Clazz.overrideMethod (c$, "getBaselineResizeBehavior",
\r
709 if (this.ui != null) {
\r
710 return this.ui.getBaselineResizeBehavior (this);
\r
711 }return java.awt.Component.BaselineResizeBehavior.OTHER;
\r
713 Clazz.defineMethod (c$, "requestDefaultFocus",
\r
715 var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
\r
716 if (nearestRoot == null) {
\r
720 Clazz.defineMethod (c$, "setVisible",
\r
722 if (aFlag != this.isVisible ()) {
\r
723 Clazz.superCall (this, javax.swing.JComponent, "setVisible", [aFlag]);
\r
724 var parent = this.getParent ();
\r
725 if (parent != null) {
\r
726 var r = this.getBounds ();
\r
727 parent.repaint (r.x, r.y, r.width, r.height);
\r
728 }this.revalidate ();
\r
730 Clazz.defineMethod (c$, "setEnabled",
\r
731 function (enabled) {
\r
732 var oldEnabled = this.isEnabled ();
\r
733 Clazz.superCall (this, javax.swing.JComponent, "setEnabled", [enabled]);
\r
734 this.firePropertyChangeBool ("enabled", oldEnabled, enabled);
\r
735 if (enabled != oldEnabled) {
\r
738 Clazz.defineMethod (c$, "setForeground",
\r
740 var oldFg = this.getForeground ();
\r
741 Clazz.superCall (this, javax.swing.JComponent, "setForeground", [fg]);
\r
742 if ((oldFg != null) ? !oldFg.equals (fg) : ((fg != null) && !fg.equals (oldFg))) {
\r
744 }}, "java.awt.Color");
\r
745 Clazz.defineMethod (c$, "setBackground",
\r
747 var oldBg = this.getBackground ();
\r
748 Clazz.superCall (this, javax.swing.JComponent, "setBackground", [bg]);
\r
749 if ((oldBg != null) ? !oldBg.equals (bg) : ((bg != null) && !bg.equals (oldBg))) {
\r
751 }}, "java.awt.Color");
\r
752 Clazz.defineMethod (c$, "setFont",
\r
754 var oldFont = this.getFont ();
\r
755 Clazz.superCall (this, javax.swing.JComponent, "setFont", [font]);
\r
756 if (font !== oldFont) {
\r
757 this.revalidate ();
\r
759 }}, "java.awt.Font");
\r
760 c$.getDefaultLocale = Clazz.defineMethod (c$, "getDefaultLocale",
\r
762 var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale");
\r
764 l = java.util.Locale.getDefault ();
\r
765 javax.swing.JComponent.setDefaultLocale (l);
\r
768 c$.setDefaultLocale = Clazz.defineMethod (c$, "setDefaultLocale",
\r
770 javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l);
\r
771 }, "java.util.Locale");
\r
772 Clazz.defineMethod (c$, "processComponentKeyEvent",
\r
774 }, "java.awt.event.KeyEvent");
\r
775 Clazz.defineMethod (c$, "processKeyEvent",
\r
777 var shouldProcessKey;
\r
778 Clazz.superCall (this, javax.swing.JComponent, "processKeyEvent", [e]);
\r
779 if (!e.isConsumed ()) {
\r
780 this.processComponentKeyEvent (e);
\r
781 }shouldProcessKey = javax.swing.JComponent.KeyboardState.shouldProcess (e);
\r
782 if (e.isConsumed ()) {
\r
784 }if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) {
\r
786 }}, "java.awt.event.KeyEvent");
\r
787 Clazz.defineMethod (c$, "processKeyBinding",
\r
788 function (ks, e, condition, pressed) {
\r
789 var map = this.getInputMap (condition, false);
\r
790 var am = this.getActionMap (false);
\r
791 if (map != null && am != null && this.isEnabled ()) {
\r
792 var binding = map.get (ks);
\r
793 var action = (binding == null) ? null : am.get (binding);
\r
794 if (action != null) {
\r
795 return javax.swing.SwingUtilities.notifyAction (action, ks, e, this, e.getModifiers ());
\r
797 }, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B");
\r
798 Clazz.defineMethod (c$, "processKeyBindings",
\r
799 function (e, pressed) {
\r
800 if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (e)) {
\r
803 if (e.getID () == 400) {
\r
804 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ());
\r
806 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true));
\r
807 }if (this.processKeyBinding (ks, e, 0, pressed)) return true;
\r
809 while (parent != null && !(Clazz.instanceOf (parent, java.awt.Window)) && !(Clazz.instanceOf (parent, java.applet.Applet))) {
\r
810 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
\r
811 if ((parent).processKeyBinding (ks, e, 1, pressed)) return true;
\r
812 }parent = parent.getParent ();
\r
814 if (parent != null) {
\r
815 return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed);
\r
817 }, "java.awt.event.KeyEvent,~B");
\r
818 c$.processKeyBindingsForAllComponents = Clazz.defineMethod (c$, "processKeyBindingsForAllComponents",
\r
819 function (e, container, pressed) {
\r
821 if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) {
\r
823 }if (Clazz.instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) {
\r
824 container = (container).getOwner ();
\r
828 }, "java.awt.event.KeyEvent,java.awt.Container,~B");
\r
829 Clazz.defineMethod (c$, "setToolTipText",
\r
831 this.putClientProperty ("ToolTipText", text);
\r
833 Clazz.defineMethod (c$, "getToolTipText",
\r
835 return this.getClientProperty ("ToolTipText");
\r
837 Clazz.defineMethod (c$, "getToolTipText",
\r
839 return this.getToolTipText ();
\r
840 }, "java.awt.event.MouseEvent");
\r
841 Clazz.defineMethod (c$, "getToolTipLocation",
\r
844 }, "java.awt.event.MouseEvent");
\r
845 Clazz.defineMethod (c$, "getPopupLocation",
\r
848 }, "java.awt.event.MouseEvent");
\r
849 Clazz.defineMethod (c$, "createToolTip",
\r
851 var tip = new javax.swing.JToolTip ();
\r
852 tip.setComponent (this);
\r
855 Clazz.defineMethod (c$, "scrollRectToVisible",
\r
858 var dx = this.getX ();
\r
859 var dy = this.getY ();
\r
860 for (parent = this.getParent (); !(parent == null) && !(Clazz.instanceOf (parent, javax.swing.JComponent)) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane)); parent = parent.getParent ()) {
\r
861 var bounds = parent.getBounds ();
\r
865 if (!(parent == null) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane))) {
\r
868 (parent).scrollRectToVisible (aRect);
\r
871 }}, "java.awt.Rectangle");
\r
872 Clazz.defineMethod (c$, "setAutoscrolls",
\r
873 function (autoscrolls) {
\r
875 Clazz.defineMethod (c$, "getAutoscrolls",
\r
877 return this.autoscrolls;
\r
879 Clazz.defineMethod (c$, "superProcessMouseMotionEvent",
\r
881 Clazz.superCall (this, javax.swing.JComponent, "processMouseMotionEvent", [e]);
\r
882 }, "java.awt.event.MouseEvent");
\r
883 Clazz.defineMethod (c$, "setCreatedDoubleBuffer",
\r
884 function (newValue) {
\r
885 this.setFlag (9, newValue);
\r
887 Clazz.defineMethod (c$, "getCreatedDoubleBuffer",
\r
889 return this.getFlag (9);
\r
891 Clazz.defineMethod (c$, "getClientProperties",
\r
893 if (this.clientProperties == null) {
\r
894 this.clientProperties = new javax.swing.ArrayTable ();
\r
895 }return this.clientProperties;
\r
897 Clazz.defineMethod (c$, "getClientProperty",
\r
899 if (this.clientProperties == null) {
\r
903 return this.clientProperties.get (key);
\r
905 Clazz.defineMethod (c$, "putClientProperty",
\r
906 function (key, value) {
\r
907 if (value == null && this.clientProperties == null) {
\r
909 }var clientProperties = this.getClientProperties ();
\r
912 oldValue = clientProperties.get (key);
\r
913 if (value != null) {
\r
914 clientProperties.put (key, value);
\r
915 } else if (oldValue != null) {
\r
916 clientProperties.remove (key);
\r
919 }}this.clientPropertyChanged (key, oldValue, value);
\r
920 this.firePropertyChangeObject (key.toString (), oldValue, value);
\r
922 Clazz.defineMethod (c$, "clientPropertyChanged",
\r
923 function (key, oldValue, newValue) {
\r
925 Clazz.defineMethod (c$, "setUIProperty",
\r
926 function (propertyName, value) {
\r
927 if (propertyName === "opaque") {
\r
928 if (!this.getFlag (24)) {
\r
929 this.setOpaque ((value).booleanValue ());
\r
930 this.setFlag (24, false);
\r
931 }} else if (propertyName === "autoscrolls") {
\r
932 if (!this.getFlag (25)) {
\r
933 this.setAutoscrolls ((value).booleanValue ());
\r
934 this.setFlag (25, false);
\r
935 }} else if (propertyName === "focusTraversalKeysForward") {
\r
936 } else if (propertyName === "focusTraversalKeysBackward") {
\r
938 System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5));
\r
940 c$.isLightweightComponent = Clazz.defineMethod (c$, "isLightweightComponent",
\r
942 return !(Clazz.instanceOf (c, javax.swing.JApplet) || Clazz.instanceOf (c, javax.swing.JFrame) || Clazz.instanceOf (c, javax.swing.JWindow) || Clazz.instanceOf (c, javax.swing.JDialog));
\r
943 }, "java.awt.Component");
\r
944 Clazz.overrideMethod (c$, "isOpaque",
\r
946 return this.getFlag (3);
\r
948 Clazz.defineMethod (c$, "setOpaque",
\r
949 function (isOpaque) {
\r
950 var oldValue = this.getFlag (3);
\r
951 this.setFlag (3, isOpaque);
\r
952 this.setFlag (24, true);
\r
953 this.firePropertyChangeBool ("opaque", oldValue, isOpaque);
\r
955 Clazz.defineMethod (c$, "rectangleIsObscured",
\r
956 function (x, y, width, height) {
\r
957 var numChildren = this.getComponentCount ();
\r
958 for (var i = 0; i < numChildren; i++) {
\r
959 var child = this.getComponent (i);
\r
964 cx = child.getX ();
\r
965 cy = child.getY ();
\r
966 cw = child.getWidth ();
\r
967 ch = child.getHeight ();
\r
968 if (x >= cx && (x + width) <= (cx + cw) && y >= cy && (y + height) <= (cy + ch) && child.isVisible ()) {
\r
969 if (Clazz.instanceOf (child, javax.swing.JComponent)) {
\r
970 return (child).isOpaque ();
\r
976 c$.computeVisibleRect = Clazz.defineMethod (c$, "computeVisibleRect",
\r
977 function (c, visibleRect) {
\r
978 var p = c.getParent ();
\r
979 var bounds = c.getBounds ();
\r
980 if (p == null || Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
\r
981 visibleRect.reshape (0, 0, bounds.width, bounds.height);
\r
983 javax.swing.JComponent.computeVisibleRect (p, visibleRect);
\r
984 visibleRect.x -= bounds.x;
\r
985 visibleRect.y -= bounds.y;
\r
986 javax.swing.SwingUtilities.computeIntersection (0, 0, bounds.width, bounds.height, visibleRect);
\r
987 }}, "java.awt.Component,java.awt.Rectangle");
\r
988 Clazz.defineMethod (c$, "computeVisibleRect",
\r
989 function (visibleRect) {
\r
990 javax.swing.JComponent.computeVisibleRect (this, visibleRect);
\r
991 }, "java.awt.Rectangle");
\r
992 Clazz.defineMethod (c$, "getVisibleRect",
\r
994 var visibleRect = new java.awt.Rectangle ();
\r
995 this.computeVisibleRect (visibleRect);
\r
996 return visibleRect;
\r
998 Clazz.defineMethod (c$, "getTopLevelAncestor",
\r
1000 for (var p = this; p != null; p = p.getParent ()) {
\r
1001 if (Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
\r
1006 Clazz.defineMethod (c$, "getAncestorNotifier",
\r
1008 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER);
\r
1010 Clazz.defineMethod (c$, "addAncestorListener",
\r
1011 function (listener) {
\r
1012 var ancestorNotifier = this.getAncestorNotifier ();
\r
1013 if (ancestorNotifier == null) {
\r
1014 ancestorNotifier = new javax.swing.AncestorNotifier (this);
\r
1015 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, ancestorNotifier);
\r
1016 }ancestorNotifier.addAncestorListener (listener);
\r
1017 }, "javax.swing.event.AncestorListener");
\r
1018 Clazz.defineMethod (c$, "removeAncestorListener",
\r
1019 function (listener) {
\r
1020 var ancestorNotifier = this.getAncestorNotifier ();
\r
1021 if (ancestorNotifier == null) {
\r
1023 }ancestorNotifier.removeAncestorListener (listener);
\r
1024 if (ancestorNotifier.listenerList.getListenerList ().length == 0) {
\r
1025 ancestorNotifier.removeAllListeners ();
\r
1026 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, null);
\r
1027 }}, "javax.swing.event.AncestorListener");
\r
1028 Clazz.defineMethod (c$, "getAncestorListeners",
\r
1030 var ancestorNotifier = this.getAncestorNotifier ();
\r
1031 if (ancestorNotifier == null) {
\r
1032 return new Array (0);
\r
1033 }return ancestorNotifier.getAncestorListeners ();
\r
1035 Clazz.defineMethod (c$, "getListeners",
\r
1036 function (listenerType) {
\r
1038 if (listenerType === javax.swing.event.AncestorListener) {
\r
1039 result = this.getAncestorListeners ();
\r
1040 } else if (listenerType === java.beans.PropertyChangeListener) {
\r
1041 result = this.getPropertyChangeListeners ();
\r
1043 result = this.listenerList.getListeners (listenerType);
\r
1044 }if (result.length == 0) {
\r
1045 return Clazz.superCall (this, javax.swing.JComponent, "getListeners", [listenerType]);
\r
1048 Clazz.defineMethod (c$, "addNotify",
\r
1050 Clazz.superCall (this, javax.swing.JComponent, "addNotify", []);
\r
1051 this.firePropertyChangeObject ("ancestor", null, this.getParent ());
\r
1052 this.registerWithKeyboardManager (false);
\r
1053 this.registerNextFocusableComponent ();
\r
1055 Clazz.defineMethod (c$, "removeNotify",
\r
1057 Clazz.superCall (this, javax.swing.JComponent, "removeNotify", []);
\r
1058 this.firePropertyChangeObject ("ancestor", this.getParent (), null);
\r
1059 this.unregisterWithKeyboardManager ();
\r
1060 this.deregisterNextFocusableComponent ();
\r
1061 if (this.getCreatedDoubleBuffer ()) {
\r
1062 javax.swing.RepaintManager.currentManager (this).resetDoubleBuffer ();
\r
1063 this.setCreatedDoubleBuffer (false);
\r
1065 Clazz.defineMethod (c$, "repaint",
\r
1066 function (tm, x, y, width, height) {
\r
1067 javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height);
\r
1068 }, "~N,~N,~N,~N,~N");
\r
1069 Clazz.defineMethod (c$, "repaint",
\r
1071 this.repaint (0, r.x, r.y, r.width, r.height);
\r
1072 }, "java.awt.Rectangle");
\r
1073 Clazz.defineMethod (c$, "revalidate",
\r
1075 if (this.getParent () == null) {
\r
1077 }if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
\r
1078 this.invalidate ();
\r
1079 javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this);
\r
1082 if (this.getFlag (28)) {
\r
1084 }this.setFlag (28, true);
\r
1085 }var callRevalidate = ((Clazz.isClassDefined ("javax.swing.JComponent$2") ? 0 : javax.swing.JComponent.$JComponent$2$ ()), Clazz.innerTypeInstance (javax.swing.JComponent$2, this, null));
\r
1086 javax.swing.SwingUtilities.invokeLater (callRevalidate);
\r
1088 Clazz.defineMethod (c$, "isValidateRoot",
\r
1092 Clazz.defineMethod (c$, "isOptimizedDrawingEnabled",
\r
1096 Clazz.defineMethod (c$, "isPaintingOrigin",
\r
1100 Clazz.defineMethod (c$, "paintImmediately",
\r
1101 function (x, y, w, h) {
\r
1103 if (arguments.length == 1) {
\r
1112 if (!this.isShowing ()) {
\r
1114 }while (!(c).isOpaque ()) {
\r
1115 parent = c.getParent ();
\r
1116 if (parent != null) {
\r
1122 }if (!(Clazz.instanceOf (c, javax.swing.JComponent))) {
\r
1125 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
\r
1126 (c)._paintImmediately (x, y, w, h);
\r
1128 c.repaint (x, y, w, h);
\r
1129 }}, "~N,~N,~N,~N");
\r
1130 Clazz.defineMethod (c$, "paintImmediately",
\r
1132 this.paintImmediately (r.x, r.y, r.width, r.height);
\r
1133 }, "java.awt.Rectangle");
\r
1134 Clazz.defineMethod (c$, "alwaysOnTop",
\r
1138 Clazz.defineMethod (c$, "setPaintingChild",
\r
1139 function (paintingChild) {
\r
1140 this.paintingChild = paintingChild;
\r
1141 }, "java.awt.Component");
\r
1142 Clazz.defineMethod (c$, "_paintImmediately",
\r
1143 function (x, y, w, h) {
\r
1152 var hasBuffer = false;
\r
1153 var bufferedComponent = null;
\r
1154 var paintingComponent = this;
\r
1155 var path = new java.util.ArrayList (7);
\r
1158 tmpX = tmpY = tmpWidth = tmpHeight = 0;
\r
1159 var paintImmediatelyClip = javax.swing.JComponent.fetchRectangle ();
\r
1160 paintImmediatelyClip.x = x;
\r
1161 paintImmediatelyClip.y = y;
\r
1162 paintImmediatelyClip.width = w;
\r
1163 paintImmediatelyClip.height = h;
\r
1164 var ontop = this.alwaysOnTop () && this.isOpaque ();
\r
1166 javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip);
\r
1167 if (paintImmediatelyClip.width == 0) {
\r
1168 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
\r
1171 for (c = this, child = null; c != null && !(Clazz.instanceOf (c, java.awt.Window)) && !(Clazz.instanceOf (c, java.applet.Applet)); child = c, c = c.getParent ()) {
\r
1172 var jc = (Clazz.instanceOf (c, javax.swing.JComponent)) ? c : null;
\r
1174 if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) {
\r
1177 if (jc.isPaintingOrigin ()) {
\r
1180 var children = c.getComponents ();
\r
1182 for (; i < children.length; i++) {
\r
1183 if (children[i] === child) break;
\r
1185 switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) {
\r
1190 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
\r
1199 paintingComponent = jc;
\r
1201 offsetX = offsetY = 0;
\r
1202 hasBuffer = false;
\r
1205 var bx = c.getX ();
\r
1206 var by = c.getY ();
\r
1207 tmpWidth = c.getWidth ();
\r
1208 tmpHeight = c.getHeight ();
\r
1209 javax.swing.SwingUtilities.computeIntersection (tmpX, tmpY, tmpWidth, tmpHeight, paintImmediatelyClip);
\r
1210 paintImmediatelyClip.x += bx;
\r
1211 paintImmediatelyClip.y += by;
\r
1215 if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) {
\r
1216 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
\r
1218 }paintingComponent.setFlag (13, true);
\r
1219 paintImmediatelyClip.x -= offsetX;
\r
1220 paintImmediatelyClip.y -= offsetY;
\r
1221 if (paintingComponent !== this) {
\r
1224 for (; i > 0; i--) {
\r
1225 comp = path.get (i);
\r
1226 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
\r
1227 (comp).setPaintingChild (path.get (i - 1));
\r
1230 g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS ();
\r
1233 var rm = javax.swing.RepaintManager.currentManager (bufferedComponent);
\r
1236 rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height);
\r
1241 paintingComponent.paint (g);
\r
1246 if (paintingComponent !== this) {
\r
1249 for (; i > 0; i--) {
\r
1250 comp = path.get (i);
\r
1251 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
\r
1252 (comp).setPaintingChild (null);
\r
1254 }paintingComponent.setFlag (13, false);
\r
1256 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
\r
1257 }, "~N,~N,~N,~N");
\r
1258 Clazz.defineMethod (c$, "paintToOffscreen",
\r
1259 function (g, x, y, w, h, maxX, maxY) {
\r
1261 this.setFlag (1, true);
\r
1262 if ((y + h) < maxY || (x + w) < maxX) {
\r
1263 this.setFlag (2, true);
\r
1264 }if (this.getFlag (13)) {
\r
1267 if (!this.rectangleIsObscured (x, y, w, h)) {
\r
1268 this.paintComponent (g);
\r
1269 this.paintBorder (g);
\r
1270 }this.paintChildren (g);
\r
1272 this.setFlag (1, false);
\r
1273 this.setFlag (2, false);
\r
1275 }, "java.awt.Graphics,~N,~N,~N,~N,~N,~N");
\r
1276 Clazz.defineMethod (c$, "getObscuredState",
\r
1277 function (compIndex, x, y, width, height) {
\r
1279 var tmpRect = javax.swing.JComponent.fetchRectangle ();
\r
1280 for (var i = compIndex - 1; i >= 0; i--) {
\r
1281 var sibling = this.getComponent (i);
\r
1282 if (!sibling.isVisible ()) {
\r
1286 if (Clazz.instanceOf (sibling, javax.swing.JComponent)) {
\r
1287 opaque = (sibling).isOpaque ();
\r
1289 if (retValue == 1) {
\r
1293 }siblingRect = sibling.getBounds (tmpRect);
\r
1294 if (opaque && x >= siblingRect.x && (x + width) <= (siblingRect.x + siblingRect.width) && y >= siblingRect.y && (y + height) <= (siblingRect.y + siblingRect.height)) {
\r
1295 javax.swing.JComponent.recycleRectangle (tmpRect);
\r
1297 } else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) {
\r
1300 javax.swing.JComponent.recycleRectangle (tmpRect);
\r
1302 }, "~N,~N,~N,~N,~N");
\r
1303 Clazz.defineMethod (c$, "checkIfChildObscuredBySibling",
\r
1307 Clazz.defineMethod (c$, "setFlag",
\r
1308 function (aFlag, aValue) {
\r
1310 this.flags |= (1 << aFlag);
\r
1312 this.flags &= ~(1 << aFlag);
\r
1314 Clazz.defineMethod (c$, "getFlag",
\r
1315 function (aFlag) {
\r
1316 var mask = (1 << aFlag);
\r
1317 return ((this.flags & mask) == mask);
\r
1319 Clazz.defineMethod (c$, "setDoubleBuffered",
\r
1320 function (aFlag) {
\r
1322 Clazz.overrideMethod (c$, "isDoubleBuffered",
\r
1324 return this.getFlag (0);
\r
1326 Clazz.defineMethod (c$, "getRootPane",
\r
1328 return javax.swing.SwingUtilities.getRootPane (this);
\r
1330 Clazz.defineMethod (c$, "paramString",
\r
1332 var preferredSizeString = (this.isPreferredSizeSet () ? this.getPreferredSize ().toString () : "");
\r
1333 var minimumSizeString = (this.isMinimumSizeSet () ? this.getMinimumSize ().toString () : "");
\r
1334 var maximumSizeString = (this.isMaximumSizeSet () ? this.getMaximumSize ().toString () : "");
\r
1335 var borderString = (this.border == null ? "" : (this.border === this ? "this" : this.border.toString ()));
\r
1336 return Clazz.superCall (this, javax.swing.JComponent, "paramString", []) + ",alignmentX=" + this.alignmentX + ",alignmentY=" + this.alignmentY + ",border=" + borderString + ",flags=" + this.flags + ",maximumSize=" + maximumSizeString + ",minimumSize=" + minimumSizeString + ",preferredSize=" + preferredSizeString;
\r
1338 c$.$JComponent$ActionStandin$ = function () {
\r
1339 Clazz.pu$h(self.c$);
\r
1340 c$ = Clazz.decorateAsClass (function () {
\r
1341 Clazz.prepareCallback (this, arguments);
\r
1342 this.actionListener = null;
\r
1343 this.command = null;
\r
1344 this.action = null;
\r
1345 Clazz.instantialize (this, arguments);
\r
1346 }, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action);
\r
1347 Clazz.makeConstructor (c$,
\r
1349 this.actionListener = a;
\r
1350 if (Clazz.instanceOf (a, javax.swing.Action)) {
\r
1353 this.action = null;
\r
1354 }this.command = b;
\r
1355 }, "java.awt.event.ActionListener,~S");
\r
1356 Clazz.defineMethod (c$, "getValue",
\r
1359 if (a.equals ("ActionCommandKey")) {
\r
1360 return this.command;
\r
1361 }if (this.action != null) {
\r
1362 return this.action.getValue (a);
\r
1363 }if (a.equals ("Name")) {
\r
1364 return "ActionStandin";
\r
1367 Clazz.defineMethod (c$, "isEnabled",
\r
1369 if (this.actionListener == null) {
\r
1371 }if (this.action == null) {
\r
1373 }return this.action.isEnabled ();
\r
1375 Clazz.defineMethod (c$, "actionPerformed",
\r
1377 if (this.actionListener != null) {
\r
1378 this.actionListener.actionPerformed (a);
\r
1379 }}, "java.awt.event.ActionEvent");
\r
1380 Clazz.overrideMethod (c$, "putValue",
\r
1383 Clazz.overrideMethod (c$, "setEnabled",
\r
1386 Clazz.overrideMethod (c$, "addPropertyChangeListener",
\r
1388 }, "java.beans.PropertyChangeListener");
\r
1389 Clazz.overrideMethod (c$, "removePropertyChangeListener",
\r
1391 }, "java.beans.PropertyChangeListener");
\r
1392 c$ = Clazz.p0p ();
\r
1394 c$.$JComponent$2$ = function () {
\r
1395 Clazz.pu$h(self.c$);
\r
1396 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$2", null, Runnable);
\r
1397 Clazz.overrideMethod (c$, "run",
\r
1400 this.b$["javax.swing.JComponent"].setFlag (28, false);
\r
1401 }this.b$["javax.swing.JComponent"].revalidate ();
\r
1403 c$ = Clazz.p0p ();
\r
1405 c$.$JComponent$1$ = function () {
\r
1406 Clazz.pu$h(self.c$);
\r
1407 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$1", null, jssun.awt.RequestFocusController);
\r
1408 Clazz.overrideMethod (c$, "acceptRequestFocus",
\r
1409 function (from, to, temporary, focusedWindowChangeAllowed, cause) {
\r
1410 if ((to == null) || !(Clazz.instanceOf (to, javax.swing.JComponent))) {
\r
1412 }if ((from == null) || !(Clazz.instanceOf (from, javax.swing.JComponent))) {
\r
1415 if (!target.getVerifyInputWhenFocusTarget ()) {
\r
1417 }var jFocusOwner = from;
\r
1418 var iv = jFocusOwner.getInputVerifier ();
\r
1422 var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
\r
1423 if (currentSource === jFocusOwner) {
\r
1425 }javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner);
\r
1427 return iv.shouldYieldFocus (jFocusOwner);
\r
1429 if (currentSource != null) {
\r
1430 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource);
\r
1432 javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
\r
1434 }}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause");
\r
1435 c$ = Clazz.p0p ();
\r
1437 Clazz.pu$h(self.c$);
\r
1438 c$ = Clazz.decorateAsClass (function () {
\r
1439 this.array = null;
\r
1441 this.capacity = 0;
\r
1442 Clazz.instantialize (this, arguments);
\r
1443 }, javax.swing.JComponent, "IntVector");
\r
1444 Clazz.defineMethod (c$, "size",
\r
1446 return this.count;
\r
1448 Clazz.defineMethod (c$, "elementAt",
\r
1450 return this.array[a];
\r
1452 Clazz.defineMethod (c$, "addElement",
\r
1454 if (this.count == this.capacity) {
\r
1455 this.capacity = (this.capacity + 2) * 2;
\r
1456 var b = Clazz.newIntArray (this.capacity, 0);
\r
1457 if (this.count > 0) {
\r
1458 System.arraycopy (this.array, 0, b, 0, this.count);
\r
1460 }this.array[this.count++] = a;
\r
1462 Clazz.defineMethod (c$, "setElementAt",
\r
1464 this.array[b] = a;
\r
1466 c$ = Clazz.p0p ();
\r
1467 Clazz.pu$h(self.c$);
\r
1468 c$ = Clazz.declareType (javax.swing.JComponent, "KeyboardState");
\r
1469 c$.getKeyCodeArray = Clazz.defineMethod (c$, "getKeyCodeArray",
\r
1471 var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey);
\r
1473 a = new javax.swing.JComponent.IntVector ();
\r
1474 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a);
\r
1477 c$.registerKeyPressed = Clazz.defineMethod (c$, "registerKeyPressed",
\r
1479 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
\r
1480 var c = b.size ();
\r
1482 for (d = 0; d < c; d++) {
\r
1483 if (b.elementAt (d) == -1) {
\r
1484 b.setElementAt (a, d);
\r
1489 c$.registerKeyReleased = Clazz.defineMethod (c$, "registerKeyReleased",
\r
1491 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
\r
1492 var c = b.size ();
\r
1494 for (d = 0; d < c; d++) {
\r
1495 if (b.elementAt (d) == a) {
\r
1496 b.setElementAt (-1, d);
\r
1500 c$.keyIsPressed = Clazz.defineMethod (c$, "keyIsPressed",
\r
1502 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
\r
1503 var c = b.size ();
\r
1505 for (d = 0; d < c; d++) {
\r
1506 if (b.elementAt (d) == a) {
\r
1511 c$.shouldProcess = Clazz.defineMethod (c$, "shouldProcess",
\r
1513 switch (a.getID ()) {
\r
1515 if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) {
\r
1516 javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ());
\r
1519 if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) {
\r
1520 javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ());
\r
1528 }, "java.awt.event.KeyEvent");
\r
1529 c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState;
\r
1530 c$ = Clazz.p0p ();
\r
1531 Clazz.defineStatics (c$,
\r
1532 "uiClassID", "ComponentUI",
\r
1533 "managingFocusForwardTraversalKeys", null,
\r
1534 "managingFocusBackwardTraversalKeys", null,
\r
1535 "NOT_OBSCURED", 0,
\r
1536 "PARTIALLY_OBSCURED", 1,
\r
1537 "COMPLETELY_OBSCURED", 2,
\r
1538 "DEBUG_GRAPHICS_LOADED", false);
\r
1539 c$.INPUT_VERIFIER_SOURCE_KEY = c$.prototype.INPUT_VERIFIER_SOURCE_KEY = new Clazz._O ();
\r
1540 Clazz.defineStatics (c$,
\r
1541 "WHEN_FOCUSED", 0,
\r
1542 "WHEN_ANCESTOR_OF_FOCUSED_COMPONENT", 1,
\r
1543 "WHEN_IN_FOCUSED_WINDOW", 2,
\r
1544 "UNDEFINED_CONDITION", -1,
\r
1545 "WHEN_IN_FOCUSED_WINDOW_BINDINGS", "_WhenInFocusedWindow",
\r
1546 "TOOL_TIP_TEXT_KEY", "ToolTipText",
\r
1547 "NEXT_FOCUS", "nextFocus",
\r
1548 "IS_DOUBLE_BUFFERED", 0,
\r
1549 "ANCESTOR_USING_BUFFER", 1,
\r
1550 "IS_PAINTING_TILE", 2,
\r
1552 "FOCUS_INPUTMAP_CREATED", 5,
\r
1553 "ANCESTOR_INPUTMAP_CREATED", 6,
\r
1554 "WIF_INPUTMAP_CREATED", 7,
\r
1555 "ACTIONMAP_CREATED", 8,
\r
1556 "CREATED_DOUBLE_BUFFER", 9,
\r
1557 "IS_PRINTING", 11,
\r
1558 "IS_PRINTING_ALL", 12,
\r
1559 "IS_REPAINTING", 13,
\r
1560 "REQUEST_FOCUS_DISABLED", 22,
\r
1561 "INHERITS_POPUP_MENU", 23,
\r
1563 "AUTOSCROLLS_SET", 25,
\r
1564 "REVALIDATE_RUNNABLE_SCHEDULED", 28);
\r
1565 c$.tempRectangles = c$.prototype.tempRectangles = new java.util.ArrayList (11);
\r
1566 Clazz.defineStatics (c$,
\r
1567 "defaultLocale", "JComponent.defaultLocale",
\r
1568 "componentObtainingGraphicsFrom", null);
\r
1569 c$.componentObtainingGraphicsFromLock = c$.prototype.componentObtainingGraphicsFromLock = new Clazz._O ();
\r
1570 c$.focusController = c$.prototype.focusController = ((Clazz.isClassDefined ("javax.swing.JComponent$1") ? 0 : javax.swing.JComponent.$JComponent$1$ ()), Clazz.innerTypeInstance (javax.swing.JComponent$1, this, null));
\r