1 Clazz.declarePackage ("javax.swing");
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 () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.isAlignmentXSet = false;
6 this.isAlignmentYSet = false;
9 this.listenerList = null;
10 this.clientProperties = null;
11 this.autoscrolls = false;
14 this.verifyInputWhenFocusTarget = true;
15 this.paintingChild = null;
16 this.popupMenu = null;
17 this.focusInputMap = null;
18 this.ancestorInputMap = null;
19 this.windowInputMap = null;
20 this.actionMap = null;
21 if (!Clazz.isClassDefined ("javax.swing.JComponent.ActionStandin")) {
22 javax.swing.JComponent.$JComponent$ActionStandin$ ();
24 Clazz.instantialize (this, arguments);
25 }, javax.swing, "JComponent", java.awt.Container);
26 Clazz.prepareFields (c$, function () {
27 this.listenerList = new javax.swing.event.EventListenerList ();
29 c$.safelyGetGraphics = Clazz.defineMethod (c$, "safelyGetGraphics",
32 javax.swing.JComponent.componentObtainingGraphicsFrom = root;
33 var g = c.getGraphics ();
34 javax.swing.JComponent.componentObtainingGraphicsFrom = null;
36 }}, "java.awt.Component,java.awt.Component");
37 c$.getGraphicsInvoked = Clazz.defineMethod (c$, "getGraphicsInvoked",
39 if (!javax.swing.JComponent.isComponentObtainingGraphicsFrom (root)) {
40 var rootPane = (root).getRootPane ();
41 if (rootPane != null) {
42 rootPane.disableTrueDoubleBuffering ();
43 }}}, "java.awt.Component");
44 c$.isComponentObtainingGraphicsFrom = Clazz.defineMethod (c$, "isComponentObtainingGraphicsFrom",
47 return (javax.swing.JComponent.componentObtainingGraphicsFrom === c);
48 }}, "java.awt.Component");
49 c$.getManagingFocusForwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusForwardTraversalKeys",
52 if (javax.swing.JComponent.managingFocusForwardTraversalKeys == null) {
53 javax.swing.JComponent.managingFocusForwardTraversalKeys = new java.util.HashSet (1);
54 javax.swing.JComponent.managingFocusForwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 2));
55 }}return javax.swing.JComponent.managingFocusForwardTraversalKeys;
57 c$.getManagingFocusBackwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusBackwardTraversalKeys",
60 if (javax.swing.JComponent.managingFocusBackwardTraversalKeys == null) {
61 javax.swing.JComponent.managingFocusBackwardTraversalKeys = new java.util.HashSet (1);
62 javax.swing.JComponent.managingFocusBackwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 3));
63 }}return javax.swing.JComponent.managingFocusBackwardTraversalKeys;
65 c$.fetchRectangle = Clazz.defineMethod (c$, "fetchRectangle",
69 var size = javax.swing.JComponent.tempRectangles.size ();
71 rect = javax.swing.JComponent.tempRectangles.remove (size - 1);
73 rect = new java.awt.Rectangle (0, 0, 0, 0);
76 c$.recycleRectangle = Clazz.defineMethod (c$, "recycleRectangle",
79 javax.swing.JComponent.tempRectangles.add (rect);
80 }}, "java.awt.Rectangle");
81 Clazz.defineMethod (c$, "setInheritsPopupMenu",
83 var oldValue = this.getFlag (23);
84 this.setFlag (23, value);
85 this.firePropertyChangeBool ("inheritsPopupMenu", oldValue, value);
87 Clazz.defineMethod (c$, "getInheritsPopupMenu",
89 return this.getFlag (23);
91 Clazz.defineMethod (c$, "setComponentPopupMenu",
94 this.enableEvents (16);
95 }var oldPopup = this.popupMenu;
96 this.popupMenu = popup;
97 this.firePropertyChangeObject ("componentPopupMenu", oldPopup, popup);
98 }, "javax.swing.JPopupMenu");
99 Clazz.defineMethod (c$, "getComponentPopupMenu",
101 if (!this.getInheritsPopupMenu ()) {
102 return this.popupMenu;
103 }if (this.popupMenu == null) {
104 var parent = this.getParent ();
105 while (parent != null) {
106 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
107 return (parent).getComponentPopupMenu ();
108 }if (Clazz.instanceOf (parent, java.awt.Window) || Clazz.instanceOf (parent, java.applet.Applet)) {
110 }parent = parent.getParent ();
113 }return this.popupMenu;
115 Clazz.makeConstructor (c$,
117 Clazz.superConstructor (this, javax.swing.JComponent);
118 this.enableEvents (8);
119 Clazz.superCall (this, javax.swing.JComponent, "setLocale", [javax.swing.JComponent.getDefaultLocale ()]);
121 Clazz.defineMethod (c$, "updateUI",
124 Clazz.defineMethod (c$, "setUI",
126 this.uninstallUIAndProperties ();
128 if (this.ui != null) {
129 this.ui.installUI (this);
132 }, "javax.swing.plaf.ComponentUI");
133 Clazz.defineMethod (c$, "getUI",
137 Clazz.defineMethod (c$, "uninstallUIAndProperties",
139 if (this.ui != null) {
140 this.ui.uninstallUI (this);
142 Clazz.defineMethod (c$, "getUIClassID",
144 return "ComponentUI";
146 Clazz.defineMethod (c$, "getComponentGraphics",
148 var componentGraphics = g;
149 componentGraphics.setColor (this.getForeground ());
150 componentGraphics.setFont (this.getFont ());
151 return componentGraphics;
152 }, "java.awt.Graphics");
153 Clazz.defineMethod (c$, "paintComponent",
155 if (this.ui != null) {
156 var scratchGraphics = (g == null) ? null : g.createSwingJS ();
158 this.ui.update (scratchGraphics, this);
160 scratchGraphics.dispose ();
162 }}, "java.awt.Graphics");
163 Clazz.defineMethod (c$, "paintChildren",
169 var i = this.getComponentCount () - 1;
172 }if (this.paintingChild != null && (Clazz.instanceOf (this.paintingChild, javax.swing.JComponent))) {
173 for (; i >= 0; i--) {
174 if (this.getComponent (i) === this.paintingChild) {
177 }var tmpRect = javax.swing.JComponent.fetchRectangle ();
178 for (; i >= 0; i--) {
179 var comp = this.getComponent (i);
180 isJComponent = (Clazz.instanceOf (comp, javax.swing.JComponent));
181 if (comp != null && (isJComponent || javax.swing.JComponent.isLightweightComponent (comp)) && (comp.isVisible () == true)) {
182 var cr = comp.getBounds (tmpRect);
183 var cg = sg.create4 (cr.x, cr.y, cr.width, cr.height);
184 cg.setColor (comp.getForeground ());
185 cg.setFont (comp.getFont ());
186 var shouldSetFlagBack = false;
194 if (shouldSetFlagBack) {
195 (comp).setFlag (1, false);
196 (comp).setFlag (2, false);
199 javax.swing.JComponent.recycleRectangle (tmpRect);
200 }}, "java.awt.Graphics");
201 Clazz.defineMethod (c$, "paintBorder",
203 var border = this.getBorder ();
204 if (border != null) {
205 border.paintBorder (this, g, 0, 0, this.getWidth (), this.getHeight ());
206 }}, "java.awt.Graphics");
207 Clazz.overrideMethod (c$, "update",
210 }, "java.awt.Graphics");
211 Clazz.overrideMethod (c$, "paint",
213 var shouldClearPaintFlags = false;
214 if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) {
216 }var componentGraphics = this.getComponentGraphics (g);
217 var co = componentGraphics.createSwingJS ();
219 if (this.getParent () != null && !(Clazz.instanceOf (this.getParent (), javax.swing.JComponent))) {
220 this.adjustPaintFlags ();
221 shouldClearPaintFlags = true;
222 }this.paintComponent (co);
223 this.paintBorder (co);
224 this.paintChildren (co);
227 if (shouldClearPaintFlags) {
228 this.setFlag (1, false);
229 this.setFlag (2, false);
230 this.setFlag (11, false);
231 this.setFlag (12, false);
233 }, "java.awt.Graphics");
234 Clazz.defineMethod (c$, "paintForceDoubleBuffered",
236 var rm = javax.swing.RepaintManager.currentManager (this);
237 var clip = g.getClipBounds ();
239 this.setFlag (13, true);
241 rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height);
244 this.setFlag (13, false);
246 }, "java.awt.Graphics");
247 Clazz.defineMethod (c$, "isPainting",
249 var component = this;
250 while (component != null) {
251 if (Clazz.instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) {
253 }component = component.getParent ();
257 Clazz.defineMethod (c$, "adjustPaintFlags",
261 for (parent = this.getParent (); parent != null; parent = parent.getParent ()) {
262 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
264 if (jparent.getFlag (1)) this.setFlag (1, true);
265 if (jparent.getFlag (2)) this.setFlag (2, true);
266 if (jparent.getFlag (11)) this.setFlag (11, true);
267 if (jparent.getFlag (12)) this.setFlag (12, true);
271 Clazz.overrideMethod (c$, "printAll",
273 this.setFlag (12, true);
277 this.setFlag (12, false);
279 }, "java.awt.Graphics");
280 Clazz.overrideMethod (c$, "print",
282 this.setFlag (11, true);
283 this.firePropertyChangeBool ("paintingForPrint", false, true);
287 this.setFlag (11, false);
288 this.firePropertyChangeBool ("paintingForPrint", true, false);
290 }, "java.awt.Graphics");
291 Clazz.defineMethod (c$, "printComponent",
293 this.paintComponent (g);
294 }, "java.awt.Graphics");
295 Clazz.defineMethod (c$, "printChildren",
297 this.paintChildren (g);
298 }, "java.awt.Graphics");
299 Clazz.defineMethod (c$, "printBorder",
301 this.paintBorder (g);
302 }, "java.awt.Graphics");
303 Clazz.defineMethod (c$, "isPaintingTile",
305 return this.getFlag (2);
307 Clazz.defineMethod (c$, "isPaintingForPrint",
309 return this.getFlag (11);
311 Clazz.defineMethod (c$, "isManagingFocus",
315 Clazz.defineMethod (c$, "registerNextFocusableComponent",
317 this.registerNextFocusableComponent (this.getNextFocusableComponent ());
319 Clazz.defineMethod (c$, "registerNextFocusableComponent",
320 function (nextFocusableComponent) {
321 if (nextFocusableComponent == null) {
323 }}, "java.awt.Component");
324 Clazz.defineMethod (c$, "deregisterNextFocusableComponent",
326 var nextFocusableComponent = this.getNextFocusableComponent ();
327 if (nextFocusableComponent == null) {
329 }var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
330 if (nearestRoot == null) {
333 Clazz.defineMethod (c$, "setNextFocusableComponent",
334 function (aComponent) {
335 var displayable = this.isDisplayable ();
337 this.deregisterNextFocusableComponent ();
338 }this.putClientProperty ("nextFocus", aComponent);
340 this.registerNextFocusableComponent (aComponent);
341 }}, "java.awt.Component");
342 Clazz.defineMethod (c$, "getNextFocusableComponent",
344 return this.getClientProperty ("nextFocus");
346 Clazz.defineMethod (c$, "setRequestFocusEnabled",
347 function (requestFocusEnabled) {
348 this.setFlag (22, !requestFocusEnabled);
350 Clazz.defineMethod (c$, "isRequestFocusEnabled",
352 return !this.getFlag (22);
354 Clazz.defineMethod (c$, "requestFocus",
355 function (temporary) {
356 Clazz.superCall (this, javax.swing.JComponent, "requestFocus", []);
359 Clazz.defineMethod (c$, "requestFocusInWindow",
360 function (temporary) {
361 return Clazz.superCall (this, javax.swing.JComponent, "requestFocusInWindow", []);
363 Clazz.defineMethod (c$, "grabFocus",
365 this.requestFocus ();
367 Clazz.defineMethod (c$, "setVerifyInputWhenFocusTarget",
368 function (verifyInputWhenFocusTarget) {
369 var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget;
370 this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
371 this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget);
373 Clazz.defineMethod (c$, "getVerifyInputWhenFocusTarget",
375 return this.verifyInputWhenFocusTarget;
377 Clazz.overrideMethod (c$, "getFontMetrics",
379 return jssun.font.FontDesignMetrics.getMetrics (font);
381 Clazz.overrideMethod (c$, "getPreferredSize",
383 return this.getPrefSizeJComp ();
385 Clazz.defineMethod (c$, "getPrefSizeJComp",
387 var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this));
388 return (size == null ? this.preferredSize () : size);
390 Clazz.defineMethod (c$, "getMaximumSize",
392 if (this.isMaximumSizeSet ()) {
393 return Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
395 if (this.ui != null) {
396 size = this.ui.getMaximumSize (this);
397 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
399 Clazz.defineMethod (c$, "getMinimumSize",
401 if (this.isMinimumSizeSet ()) {
402 return Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
404 if (this.ui != null) {
405 size = this.ui.getMinimumSize (this);
406 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
408 Clazz.overrideMethod (c$, "contains",
410 return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y);
412 Clazz.defineMethod (c$, "setBorder",
414 var oldBorder = this.border;
415 this.border = border;
416 this.firePropertyChangeObject ("border", oldBorder, border);
417 if (border !== oldBorder) {
418 if (border == null || oldBorder == null || !(border.getBorderInsets (this).equals (oldBorder.getBorderInsets (this)))) {
421 }}, "javax.swing.border.Border");
422 Clazz.defineMethod (c$, "getBorder",
426 Clazz.defineMethod (c$, "getInsets",
428 if (this.border != null) {
429 return this.border.getBorderInsets (this);
430 }return Clazz.superCall (this, javax.swing.JComponent, "getInsets", []);
432 Clazz.defineMethod (c$, "getInsets",
434 if (insets == null) {
435 insets = new java.awt.Insets (0, 0, 0, 0);
436 }if (this.border != null) {
437 if (Clazz.instanceOf (this.border, javax.swing.border.AbstractBorder)) {
438 return (this.border).getBorderInsets (this, insets);
440 return this.border.getBorderInsets (this);
442 insets.left = insets.top = insets.right = insets.bottom = 0;
444 }}, "java.awt.Insets");
445 Clazz.defineMethod (c$, "getAlignmentY",
447 if (this.isAlignmentYSet) {
448 return this.alignmentY;
449 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentY", []);
451 Clazz.defineMethod (c$, "setAlignmentY",
452 function (alignmentY) {
453 this.alignmentY = alignmentY > 1.0 ? 1.0 : alignmentY < 0.0 ? 0.0 : alignmentY;
454 this.isAlignmentYSet = true;
456 Clazz.defineMethod (c$, "getAlignmentX",
458 if (this.isAlignmentXSet) {
459 return this.alignmentX;
460 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentX", []);
462 Clazz.defineMethod (c$, "setAlignmentX",
463 function (alignmentX) {
464 this.alignmentX = alignmentX > 1.0 ? 1.0 : alignmentX < 0.0 ? 0.0 : alignmentX;
465 this.isAlignmentXSet = true;
467 Clazz.defineMethod (c$, "setInputVerifier",
468 function (inputVerifier) {
469 var oldInputVerifier = this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
470 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER, inputVerifier);
471 this.firePropertyChangeObject ("inputVerifier", oldInputVerifier, inputVerifier);
472 }, "javax.swing.InputVerifier");
473 Clazz.defineMethod (c$, "getInputVerifier",
475 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
477 Clazz.defineMethod (c$, "registerKeyboardAction",
478 function (anAction, aCommand, aKeyStroke, aCondition) {
479 var inputMap = this.getInputMap (aCondition, true);
480 if (inputMap != null) {
481 var actionMap = this.getActionMap (true);
482 var action = Clazz.innerTypeInstance (javax.swing.JComponent.ActionStandin, this, null, anAction, aCommand);
483 inputMap.put (aKeyStroke, action);
484 if (actionMap != null) {
485 actionMap.put (action, action);
486 }}}, "java.awt.event.ActionListener,~S,javax.swing.KeyStroke,~N");
487 Clazz.defineMethod (c$, "registerWithKeyboardManager",
488 function (onlyIfNew) {
489 var inputMap = this.getInputMap (2, false);
491 var registered = this.getClientProperty ("_WhenInFocusedWindow");
492 if (inputMap != null) {
493 strokes = inputMap.allKeys ();
494 if (strokes != null) {
495 for (var counter = strokes.length - 1; counter >= 0; counter--) {
496 if (!onlyIfNew || registered == null || registered.get (strokes[counter]) == null) {
497 this.registerWithKeyboardManager (strokes[counter]);
498 }if (registered != null) {
499 registered.remove (strokes[counter]);
503 }if (registered != null && registered.size () > 0) {
504 var keys = registered.keys ();
505 while (keys.hasMoreElements ()) {
506 var ks = keys.nextElement ();
507 this.unregisterWithKeyboardManager (ks);
510 }if (strokes != null && strokes.length > 0) {
511 if (registered == null) {
512 registered = new java.util.Hashtable (strokes.length);
513 this.putClientProperty ("_WhenInFocusedWindow", registered);
514 }for (var counter = strokes.length - 1; counter >= 0; counter--) {
515 registered.put (strokes[counter], strokes[counter]);
518 this.putClientProperty ("_WhenInFocusedWindow", null);
520 Clazz.defineMethod (c$, "unregisterWithKeyboardManager",
522 var registered = this.getClientProperty ("_WhenInFocusedWindow");
523 if (registered != null && registered.size () > 0) {
524 var keys = registered.keys ();
525 while (keys.hasMoreElements ()) {
526 var ks = keys.nextElement ();
527 this.unregisterWithKeyboardManager (ks);
529 }this.putClientProperty ("_WhenInFocusedWindow", null);
531 Clazz.defineMethod (c$, "componentInputMapChanged",
532 function (inputMap) {
533 var km = this.getInputMap (2, false);
534 while (km !== inputMap && km != null) {
535 km = km.getParent ();
538 this.registerWithKeyboardManager (false);
539 }}, "javax.swing.ComponentInputMap");
540 Clazz.defineMethod (c$, "registerWithKeyboardManager",
541 function (aKeyStroke) {
542 javax.swing.KeyboardManager.getCurrentManager ().registerKeyStroke (aKeyStroke, this);
543 }, "javax.swing.KeyStroke");
544 Clazz.defineMethod (c$, "unregisterWithKeyboardManager",
545 function (aKeyStroke) {
546 javax.swing.KeyboardManager.getCurrentManager ().unregisterKeyStroke (aKeyStroke, this);
547 }, "javax.swing.KeyStroke");
548 Clazz.defineMethod (c$, "registerKeyboardAction",
549 function (anAction, aKeyStroke, aCondition) {
550 this.registerKeyboardAction (anAction, null, aKeyStroke, aCondition);
551 }, "java.awt.event.ActionListener,javax.swing.KeyStroke,~N");
552 Clazz.defineMethod (c$, "unregisterKeyboardAction",
553 function (aKeyStroke) {
554 var am = this.getActionMap (false);
555 for (var counter = 0; counter < 3; counter++) {
556 var km = this.getInputMap (counter, false);
558 var actionID = km.get (aKeyStroke);
559 if (am != null && actionID != null) {
560 am.remove (actionID);
561 }km.remove (aKeyStroke);
563 }, "javax.swing.KeyStroke");
564 Clazz.defineMethod (c$, "getRegisteredKeyStrokes",
566 var counts = Clazz.newIntArray (3, 0);
567 var strokes = new Array (3);
568 for (var counter = 0; counter < 3; counter++) {
569 var km = this.getInputMap (counter, false);
570 strokes[counter] = (km != null) ? km.allKeys () : null;
571 counts[counter] = (strokes[counter] != null) ? strokes[counter].length : 0;
573 var retValue = new Array (counts[0] + counts[1] + counts[2]);
574 for (var counter = 0, last = 0; counter < 3; counter++) {
575 if (counts[counter] > 0) {
576 System.arraycopy (strokes[counter], 0, retValue, last, counts[counter]);
577 last += counts[counter];
581 Clazz.defineMethod (c$, "getConditionForKeyStroke",
582 function (aKeyStroke) {
583 for (var counter = 0; counter < 3; counter++) {
584 var inputMap = this.getInputMap (counter, false);
585 if (inputMap != null && inputMap.get (aKeyStroke) != null) {
589 }, "javax.swing.KeyStroke");
590 Clazz.defineMethod (c$, "getActionForKeyStroke",
591 function (aKeyStroke) {
592 var am = this.getActionMap (false);
595 }for (var counter = 0; counter < 3; counter++) {
596 var inputMap = this.getInputMap (counter, false);
597 if (inputMap != null) {
598 var actionBinding = inputMap.get (aKeyStroke);
599 if (actionBinding != null) {
600 var action = am.get (actionBinding);
601 if (Clazz.instanceOf (action, javax.swing.JComponent.ActionStandin)) {
602 return (action).actionListener;
606 }, "javax.swing.KeyStroke");
607 Clazz.defineMethod (c$, "resetKeyboardActions",
609 for (var counter = 0; counter < 3; counter++) {
610 var inputMap = this.getInputMap (counter, false);
611 if (inputMap != null) {
614 var am = this.getActionMap (false);
618 Clazz.defineMethod (c$, "setInputMap",
619 function (condition, map) {
622 if (map != null && !(Clazz.instanceOf (map, javax.swing.ComponentInputMap))) {
623 throw new IllegalArgumentException ("WHEN_IN_FOCUSED_WINDOW InputMaps must be of type ComponentInputMap");
624 }this.windowInputMap = map;
625 this.setFlag (7, true);
626 this.registerWithKeyboardManager (false);
629 this.ancestorInputMap = map;
630 this.setFlag (6, true);
633 this.focusInputMap = map;
634 this.setFlag (5, true);
637 throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
639 }, "~N,javax.swing.InputMap");
640 Clazz.defineMethod (c$, "getInputMap",
641 function (condition) {
642 return this.getInputMap (condition, true);
644 Clazz.defineMethod (c$, "getInputMap",
646 return this.getInputMap (0, true);
648 Clazz.defineMethod (c$, "setActionMap",
651 this.setFlag (8, true);
652 }, "javax.swing.ActionMap");
653 Clazz.defineMethod (c$, "getActionMap",
655 return this.getActionMap (true);
657 Clazz.defineMethod (c$, "getInputMap",
658 function (condition, create) {
661 if (this.getFlag (5)) {
662 return this.focusInputMap;
664 var km = new javax.swing.InputMap ();
665 this.setInputMap (condition, km);
669 if (this.getFlag (6)) {
670 return this.ancestorInputMap;
672 var km = new javax.swing.InputMap ();
673 this.setInputMap (condition, km);
677 if (this.getFlag (7)) {
678 return this.windowInputMap;
680 var km = new javax.swing.ComponentInputMap (this);
681 this.setInputMap (condition, km);
685 throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
689 Clazz.defineMethod (c$, "getActionMap",
692 (arguments.length == 0) && (create = true);
693 }if (this.getFlag (8)) {
694 return this.actionMap;
696 var am = new javax.swing.ActionMap ();
697 this.setActionMap (am);
701 Clazz.defineMethod (c$, "getBaseline",
702 function (width, height) {
703 Clazz.superCall (this, javax.swing.JComponent, "getBaseline", [width, height]);
704 if (this.ui != null) {
705 return this.ui.getBaseline (this, width, height);
708 Clazz.overrideMethod (c$, "getBaselineResizeBehavior",
710 if (this.ui != null) {
711 return this.ui.getBaselineResizeBehavior (this);
712 }return java.awt.Component.BaselineResizeBehavior.OTHER;
714 Clazz.defineMethod (c$, "requestDefaultFocus",
716 var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
717 if (nearestRoot == null) {
721 Clazz.defineMethod (c$, "setVisible",
723 if (aFlag != this.isVisible ()) {
724 Clazz.superCall (this, javax.swing.JComponent, "setVisible", [aFlag]);
725 var parent = this.getParent ();
726 if (parent != null) {
727 var r = this.getBounds ();
728 parent.repaint (r.x, r.y, r.width, r.height);
731 Clazz.defineMethod (c$, "setEnabled",
733 var oldEnabled = this.isEnabled ();
734 Clazz.superCall (this, javax.swing.JComponent, "setEnabled", [enabled]);
735 this.firePropertyChangeBool ("enabled", oldEnabled, enabled);
736 if (enabled != oldEnabled) {
739 Clazz.defineMethod (c$, "setForeground",
741 var oldFg = this.getForeground ();
742 Clazz.superCall (this, javax.swing.JComponent, "setForeground", [fg]);
743 if ((oldFg != null) ? !oldFg.equals (fg) : ((fg != null) && !fg.equals (oldFg))) {
745 }}, "java.awt.Color");
746 Clazz.defineMethod (c$, "setBackground",
748 var oldBg = this.getBackground ();
749 Clazz.superCall (this, javax.swing.JComponent, "setBackground", [bg]);
750 if ((oldBg != null) ? !oldBg.equals (bg) : ((bg != null) && !bg.equals (oldBg))) {
752 }}, "java.awt.Color");
753 Clazz.defineMethod (c$, "setFont",
755 var oldFont = this.getFont ();
756 Clazz.superCall (this, javax.swing.JComponent, "setFont", [font]);
757 if (font !== oldFont) {
760 }}, "java.awt.Font");
761 c$.getDefaultLocale = Clazz.defineMethod (c$, "getDefaultLocale",
763 var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale");
765 l = java.util.Locale.getDefault ();
766 javax.swing.JComponent.setDefaultLocale (l);
769 c$.setDefaultLocale = Clazz.defineMethod (c$, "setDefaultLocale",
771 javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l);
772 }, "java.util.Locale");
773 Clazz.defineMethod (c$, "processComponentKeyEvent",
775 }, "java.awt.event.KeyEvent");
776 Clazz.defineMethod (c$, "processKeyEvent",
778 var shouldProcessKey;
779 Clazz.superCall (this, javax.swing.JComponent, "processKeyEvent", [e]);
780 if (!e.isConsumed ()) {
781 this.processComponentKeyEvent (e);
782 }shouldProcessKey = javax.swing.JComponent.KeyboardState.shouldProcess (e);
783 if (e.isConsumed ()) {
785 }if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) {
787 }}, "java.awt.event.KeyEvent");
788 Clazz.defineMethod (c$, "processKeyBinding",
789 function (ks, e, condition, pressed) {
790 var map = this.getInputMap (condition, false);
791 var am = this.getActionMap (false);
792 if (map != null && am != null && this.isEnabled ()) {
793 var binding = map.get (ks);
794 var action = (binding == null) ? null : am.get (binding);
795 if (action != null) {
796 return javax.swing.SwingUtilities.notifyAction (action, ks, e, this, e.getModifiers ());
798 }, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B");
799 Clazz.defineMethod (c$, "processKeyBindings",
800 function (e, pressed) {
801 if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (e)) {
804 if (e.getID () == 400) {
805 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ());
807 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true));
808 }if (this.processKeyBinding (ks, e, 0, pressed)) return true;
810 while (parent != null && !(Clazz.instanceOf (parent, java.awt.Window)) && !(Clazz.instanceOf (parent, java.applet.Applet))) {
811 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
812 if ((parent).processKeyBinding (ks, e, 1, pressed)) return true;
813 }parent = parent.getParent ();
815 if (parent != null) {
816 return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed);
818 }, "java.awt.event.KeyEvent,~B");
819 c$.processKeyBindingsForAllComponents = Clazz.defineMethod (c$, "processKeyBindingsForAllComponents",
820 function (e, container, pressed) {
822 if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) {
824 }if (Clazz.instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) {
825 container = (container).getOwner ();
829 }, "java.awt.event.KeyEvent,java.awt.Container,~B");
830 Clazz.defineMethod (c$, "setToolTipText",
832 this.putClientProperty ("ToolTipText", text);
834 Clazz.defineMethod (c$, "getToolTipText",
836 return this.getClientProperty ("ToolTipText");
838 Clazz.defineMethod (c$, "getToolTipText",
840 return this.getToolTipText ();
841 }, "java.awt.event.MouseEvent");
842 Clazz.defineMethod (c$, "getToolTipLocation",
845 }, "java.awt.event.MouseEvent");
846 Clazz.defineMethod (c$, "getPopupLocation",
849 }, "java.awt.event.MouseEvent");
850 Clazz.defineMethod (c$, "createToolTip",
852 var tip = new javax.swing.JToolTip ();
853 tip.setComponent (this);
856 Clazz.defineMethod (c$, "scrollRectToVisible",
859 var dx = this.getX ();
860 var dy = this.getY ();
861 for (parent = this.getParent (); !(parent == null) && !(Clazz.instanceOf (parent, javax.swing.JComponent)) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane)); parent = parent.getParent ()) {
862 var bounds = parent.getBounds ();
866 if (!(parent == null) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane))) {
869 (parent).scrollRectToVisible (aRect);
872 }}, "java.awt.Rectangle");
873 Clazz.defineMethod (c$, "setAutoscrolls",
874 function (autoscrolls) {
876 Clazz.defineMethod (c$, "getAutoscrolls",
878 return this.autoscrolls;
880 Clazz.defineMethod (c$, "superProcessMouseMotionEvent",
882 Clazz.superCall (this, javax.swing.JComponent, "processMouseMotionEvent", [e]);
883 }, "java.awt.event.MouseEvent");
884 Clazz.defineMethod (c$, "setCreatedDoubleBuffer",
885 function (newValue) {
886 this.setFlag (9, newValue);
888 Clazz.defineMethod (c$, "getCreatedDoubleBuffer",
890 return this.getFlag (9);
892 Clazz.defineMethod (c$, "getClientProperties",
894 if (this.clientProperties == null) {
895 this.clientProperties = new javax.swing.ArrayTable ();
896 }return this.clientProperties;
898 Clazz.defineMethod (c$, "getClientProperty",
900 if (this.clientProperties == null) {
904 return this.clientProperties.get (key);
906 Clazz.defineMethod (c$, "putClientProperty",
907 function (key, value) {
908 if (value == null && this.clientProperties == null) {
910 }var clientProperties = this.getClientProperties ();
913 oldValue = clientProperties.get (key);
915 clientProperties.put (key, value);
916 } else if (oldValue != null) {
917 clientProperties.remove (key);
920 }}this.clientPropertyChanged (key, oldValue, value);
921 this.firePropertyChangeObject (key.toString (), oldValue, value);
923 Clazz.defineMethod (c$, "clientPropertyChanged",
924 function (key, oldValue, newValue) {
926 Clazz.defineMethod (c$, "setUIProperty",
927 function (propertyName, value) {
928 if (propertyName === "opaque") {
929 if (!this.getFlag (24)) {
930 this.setOpaque ((value).booleanValue ());
931 this.setFlag (24, false);
932 }} else if (propertyName === "autoscrolls") {
933 if (!this.getFlag (25)) {
934 this.setAutoscrolls ((value).booleanValue ());
935 this.setFlag (25, false);
936 }} else if (propertyName === "focusTraversalKeysForward") {
937 } else if (propertyName === "focusTraversalKeysBackward") {
939 System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5));
941 c$.isLightweightComponent = Clazz.defineMethod (c$, "isLightweightComponent",
943 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));
944 }, "java.awt.Component");
945 Clazz.overrideMethod (c$, "isOpaque",
947 return this.getFlag (3);
949 Clazz.defineMethod (c$, "setOpaque",
950 function (isOpaque) {
951 var oldValue = this.getFlag (3);
952 this.setFlag (3, isOpaque);
953 this.setFlag (24, true);
954 this.firePropertyChangeBool ("opaque", oldValue, isOpaque);
956 Clazz.defineMethod (c$, "rectangleIsObscured",
957 function (x, y, width, height) {
958 var numChildren = this.getComponentCount ();
959 for (var i = 0; i < numChildren; i++) {
960 var child = this.getComponent (i);
967 cw = child.getWidth ();
968 ch = child.getHeight ();
969 if (x >= cx && (x + width) <= (cx + cw) && y >= cy && (y + height) <= (cy + ch) && child.isVisible ()) {
970 if (Clazz.instanceOf (child, javax.swing.JComponent)) {
971 return (child).isOpaque ();
977 c$.computeVisibleRect = Clazz.defineMethod (c$, "computeVisibleRect",
978 function (c, visibleRect) {
979 var p = c.getParent ();
980 var bounds = c.getBounds ();
981 if (p == null || Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
982 visibleRect.reshape (0, 0, bounds.width, bounds.height);
984 javax.swing.JComponent.computeVisibleRect (p, visibleRect);
985 visibleRect.x -= bounds.x;
986 visibleRect.y -= bounds.y;
987 javax.swing.SwingUtilities.computeIntersection (0, 0, bounds.width, bounds.height, visibleRect);
988 }}, "java.awt.Component,java.awt.Rectangle");
989 Clazz.defineMethod (c$, "computeVisibleRect",
990 function (visibleRect) {
991 javax.swing.JComponent.computeVisibleRect (this, visibleRect);
992 }, "java.awt.Rectangle");
993 Clazz.defineMethod (c$, "getVisibleRect",
995 var visibleRect = new java.awt.Rectangle ();
996 this.computeVisibleRect (visibleRect);
999 Clazz.defineMethod (c$, "getTopLevelAncestor",
1001 for (var p = this; p != null; p = p.getParent ()) {
1002 if (Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
1007 Clazz.defineMethod (c$, "getAncestorNotifier",
1009 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER);
1011 Clazz.defineMethod (c$, "addAncestorListener",
1012 function (listener) {
1013 var ancestorNotifier = this.getAncestorNotifier ();
1014 if (ancestorNotifier == null) {
1015 ancestorNotifier = new javax.swing.AncestorNotifier (this);
1016 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, ancestorNotifier);
1017 }ancestorNotifier.addAncestorListener (listener);
1018 }, "javax.swing.event.AncestorListener");
1019 Clazz.defineMethod (c$, "removeAncestorListener",
1020 function (listener) {
1021 var ancestorNotifier = this.getAncestorNotifier ();
1022 if (ancestorNotifier == null) {
1024 }ancestorNotifier.removeAncestorListener (listener);
1025 if (ancestorNotifier.listenerList.getListenerList ().length == 0) {
1026 ancestorNotifier.removeAllListeners ();
1027 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, null);
1028 }}, "javax.swing.event.AncestorListener");
1029 Clazz.defineMethod (c$, "getAncestorListeners",
1031 var ancestorNotifier = this.getAncestorNotifier ();
1032 if (ancestorNotifier == null) {
1033 return new Array (0);
1034 }return ancestorNotifier.getAncestorListeners ();
1036 Clazz.defineMethod (c$, "getListeners",
1037 function (listenerType) {
1039 if (listenerType === javax.swing.event.AncestorListener) {
1040 result = this.getAncestorListeners ();
1041 } else if (listenerType === java.beans.PropertyChangeListener) {
1042 result = this.getPropertyChangeListeners ();
1044 result = this.listenerList.getListeners (listenerType);
1045 }if (result.length == 0) {
1046 return Clazz.superCall (this, javax.swing.JComponent, "getListeners", [listenerType]);
1049 Clazz.defineMethod (c$, "addNotify",
1051 Clazz.superCall (this, javax.swing.JComponent, "addNotify", []);
1052 this.firePropertyChangeObject ("ancestor", null, this.getParent ());
1053 this.registerWithKeyboardManager (false);
1054 this.registerNextFocusableComponent ();
1056 Clazz.defineMethod (c$, "removeNotify",
1058 Clazz.superCall (this, javax.swing.JComponent, "removeNotify", []);
1059 this.firePropertyChangeObject ("ancestor", this.getParent (), null);
1060 this.unregisterWithKeyboardManager ();
1061 this.deregisterNextFocusableComponent ();
1062 if (this.getCreatedDoubleBuffer ()) {
1063 javax.swing.RepaintManager.currentManager (this).resetDoubleBuffer ();
1064 this.setCreatedDoubleBuffer (false);
1066 Clazz.defineMethod (c$, "repaint",
1067 function (tm, x, y, width, height) {
1068 javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height);
1069 }, "~N,~N,~N,~N,~N");
1070 Clazz.defineMethod (c$, "repaint",
1072 this.repaint (0, r.x, r.y, r.width, r.height);
1073 }, "java.awt.Rectangle");
1074 Clazz.defineMethod (c$, "revalidate",
1076 if (this.getParent () == null) {
1078 }if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
1080 javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this);
1083 if (this.getFlag (28)) {
1085 }this.setFlag (28, true);
1086 }var callRevalidate = ((Clazz.isClassDefined ("javax.swing.JComponent$2") ? 0 : javax.swing.JComponent.$JComponent$2$ ()), Clazz.innerTypeInstance (javax.swing.JComponent$2, this, null));
1087 javax.swing.SwingUtilities.invokeLater (callRevalidate);
1089 Clazz.defineMethod (c$, "isValidateRoot",
1093 Clazz.defineMethod (c$, "isOptimizedDrawingEnabled",
1097 Clazz.defineMethod (c$, "isPaintingOrigin",
1101 Clazz.defineMethod (c$, "paintImmediately",
1102 function (x, y, w, h) {
1104 if (arguments.length == 1) {
1113 if (!this.isShowing ()) {
1115 }while (!(c).isOpaque ()) {
1116 parent = c.getParent ();
1117 if (parent != null) {
1123 }if (!(Clazz.instanceOf (c, javax.swing.JComponent))) {
1126 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
1127 (c)._paintImmediately (x, y, w, h);
1129 c.repaint (x, y, w, h);
1131 Clazz.defineMethod (c$, "paintImmediately",
1133 this.paintImmediately (r.x, r.y, r.width, r.height);
1134 }, "java.awt.Rectangle");
1135 Clazz.defineMethod (c$, "alwaysOnTop",
1139 Clazz.defineMethod (c$, "setPaintingChild",
1140 function (paintingChild) {
1141 this.paintingChild = paintingChild;
1142 }, "java.awt.Component");
1143 Clazz.defineMethod (c$, "_paintImmediately",
1144 function (x, y, w, h) {
1153 var hasBuffer = false;
1154 var bufferedComponent = null;
1155 var paintingComponent = this;
1156 var path = new java.util.ArrayList (7);
1159 tmpX = tmpY = tmpWidth = tmpHeight = 0;
1160 var paintImmediatelyClip = javax.swing.JComponent.fetchRectangle ();
1161 paintImmediatelyClip.x = x;
1162 paintImmediatelyClip.y = y;
1163 paintImmediatelyClip.width = w;
1164 paintImmediatelyClip.height = h;
1165 var ontop = this.alwaysOnTop () && this.isOpaque ();
1167 javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip);
1168 if (paintImmediatelyClip.width == 0) {
1169 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1172 for (c = this, child = null; c != null && !(Clazz.instanceOf (c, java.awt.Window)) && !(Clazz.instanceOf (c, java.applet.Applet)); child = c, c = c.getParent ()) {
1173 var jc = (Clazz.instanceOf (c, javax.swing.JComponent)) ? c : null;
1175 if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) {
1178 if (jc.isPaintingOrigin ()) {
1181 var children = c.getComponents ();
1183 for (; i < children.length; i++) {
1184 if (children[i] === child) break;
1186 switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) {
1191 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1200 paintingComponent = jc;
1202 offsetX = offsetY = 0;
1208 tmpWidth = c.getWidth ();
1209 tmpHeight = c.getHeight ();
1210 javax.swing.SwingUtilities.computeIntersection (tmpX, tmpY, tmpWidth, tmpHeight, paintImmediatelyClip);
1211 paintImmediatelyClip.x += bx;
1212 paintImmediatelyClip.y += by;
1216 if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) {
1217 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1219 }paintingComponent.setFlag (13, true);
1220 paintImmediatelyClip.x -= offsetX;
1221 paintImmediatelyClip.y -= offsetY;
1222 if (paintingComponent !== this) {
1225 for (; i > 0; i--) {
1226 comp = path.get (i);
1227 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
1228 (comp).setPaintingChild (path.get (i - 1));
1231 g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS ();
1234 var rm = javax.swing.RepaintManager.currentManager (bufferedComponent);
1237 rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height);
1242 paintingComponent.paint (g);
1247 if (paintingComponent !== this) {
1250 for (; i > 0; i--) {
1251 comp = path.get (i);
1252 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
1253 (comp).setPaintingChild (null);
1255 }paintingComponent.setFlag (13, false);
1257 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1259 Clazz.defineMethod (c$, "paintToOffscreen",
1260 function (g, x, y, w, h, maxX, maxY) {
1262 this.setFlag (1, true);
1263 if ((y + h) < maxY || (x + w) < maxX) {
1264 this.setFlag (2, true);
1265 }if (this.getFlag (13)) {
1268 if (!this.rectangleIsObscured (x, y, w, h)) {
1269 this.paintComponent (g);
1270 this.paintBorder (g);
1271 }this.paintChildren (g);
1273 this.setFlag (1, false);
1274 this.setFlag (2, false);
1276 }, "java.awt.Graphics,~N,~N,~N,~N,~N,~N");
1277 Clazz.defineMethod (c$, "getObscuredState",
1278 function (compIndex, x, y, width, height) {
1280 var tmpRect = javax.swing.JComponent.fetchRectangle ();
1281 for (var i = compIndex - 1; i >= 0; i--) {
1282 var sibling = this.getComponent (i);
1283 if (!sibling.isVisible ()) {
1287 if (Clazz.instanceOf (sibling, javax.swing.JComponent)) {
1288 opaque = (sibling).isOpaque ();
1290 if (retValue == 1) {
1294 }siblingRect = sibling.getBounds (tmpRect);
1295 if (opaque && x >= siblingRect.x && (x + width) <= (siblingRect.x + siblingRect.width) && y >= siblingRect.y && (y + height) <= (siblingRect.y + siblingRect.height)) {
1296 javax.swing.JComponent.recycleRectangle (tmpRect);
1298 } else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) {
1301 javax.swing.JComponent.recycleRectangle (tmpRect);
1303 }, "~N,~N,~N,~N,~N");
1304 Clazz.defineMethod (c$, "checkIfChildObscuredBySibling",
1308 Clazz.defineMethod (c$, "setFlag",
1309 function (aFlag, aValue) {
1311 this.flags |= (1 << aFlag);
1313 this.flags &= ~(1 << aFlag);
1315 Clazz.defineMethod (c$, "getFlag",
1317 var mask = (1 << aFlag);
1318 return ((this.flags & mask) == mask);
1320 Clazz.defineMethod (c$, "setDoubleBuffered",
1323 Clazz.overrideMethod (c$, "isDoubleBuffered",
1325 return this.getFlag (0);
1327 Clazz.defineMethod (c$, "getRootPane",
1329 return javax.swing.SwingUtilities.getRootPane (this);
1331 Clazz.defineMethod (c$, "paramString",
1333 var preferredSizeString = (this.isPreferredSizeSet () ? this.getPreferredSize ().toString () : "");
1334 var minimumSizeString = (this.isMinimumSizeSet () ? this.getMinimumSize ().toString () : "");
1335 var maximumSizeString = (this.isMaximumSizeSet () ? this.getMaximumSize ().toString () : "");
1336 var borderString = (this.border == null ? "" : (this.border === this ? "this" : this.border.toString ()));
1337 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;
1339 c$.$JComponent$ActionStandin$ = function () {
1340 Clazz.pu$h(self.c$);
1341 c$ = Clazz.decorateAsClass (function () {
1342 Clazz.prepareCallback (this, arguments);
1343 this.actionListener = null;
1344 this.command = null;
1346 Clazz.instantialize (this, arguments);
1347 }, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action);
1348 Clazz.makeConstructor (c$,
1350 this.actionListener = a;
1351 if (Clazz.instanceOf (a, javax.swing.Action)) {
1356 }, "java.awt.event.ActionListener,~S");
1357 Clazz.defineMethod (c$, "getValue",
1360 if (a.equals ("ActionCommandKey")) {
1361 return this.command;
1362 }if (this.action != null) {
1363 return this.action.getValue (a);
1364 }if (a.equals ("Name")) {
1365 return "ActionStandin";
1368 Clazz.defineMethod (c$, "isEnabled",
1370 if (this.actionListener == null) {
1372 }if (this.action == null) {
1374 }return this.action.isEnabled ();
1376 Clazz.defineMethod (c$, "actionPerformed",
1378 if (this.actionListener != null) {
1379 this.actionListener.actionPerformed (a);
1380 }}, "java.awt.event.ActionEvent");
1381 Clazz.overrideMethod (c$, "putValue",
1384 Clazz.overrideMethod (c$, "setEnabled",
1387 Clazz.overrideMethod (c$, "addPropertyChangeListener",
1389 }, "java.beans.PropertyChangeListener");
1390 Clazz.overrideMethod (c$, "removePropertyChangeListener",
1392 }, "java.beans.PropertyChangeListener");
1395 c$.$JComponent$2$ = function () {
1396 Clazz.pu$h(self.c$);
1397 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$2", null, Runnable);
1398 Clazz.overrideMethod (c$, "run",
1401 this.b$["javax.swing.JComponent"].setFlag (28, false);
1402 }this.b$["javax.swing.JComponent"].revalidate ();
1406 c$.$JComponent$1$ = function () {
1407 Clazz.pu$h(self.c$);
1408 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$1", null, jssun.awt.RequestFocusController);
1409 Clazz.overrideMethod (c$, "acceptRequestFocus",
1410 function (from, to, temporary, focusedWindowChangeAllowed, cause) {
1411 if ((to == null) || !(Clazz.instanceOf (to, javax.swing.JComponent))) {
1413 }if ((from == null) || !(Clazz.instanceOf (from, javax.swing.JComponent))) {
1416 if (!target.getVerifyInputWhenFocusTarget ()) {
1418 }var jFocusOwner = from;
1419 var iv = jFocusOwner.getInputVerifier ();
1423 var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1424 if (currentSource === jFocusOwner) {
1426 }javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner);
1428 return iv.shouldYieldFocus (jFocusOwner);
1430 if (currentSource != null) {
1431 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource);
1433 javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1435 }}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause");
1438 Clazz.pu$h(self.c$);
1439 c$ = Clazz.decorateAsClass (function () {
1443 Clazz.instantialize (this, arguments);
1444 }, javax.swing.JComponent, "IntVector");
1445 Clazz.defineMethod (c$, "size",
1449 Clazz.defineMethod (c$, "elementAt",
1451 return this.array[a];
1453 Clazz.defineMethod (c$, "addElement",
1455 if (this.count == this.capacity) {
1456 this.capacity = (this.capacity + 2) * 2;
1457 var b = Clazz.newIntArray (this.capacity, 0);
1458 if (this.count > 0) {
1459 System.arraycopy (this.array, 0, b, 0, this.count);
1461 }this.array[this.count++] = a;
1463 Clazz.defineMethod (c$, "setElementAt",
1468 Clazz.pu$h(self.c$);
1469 c$ = Clazz.declareType (javax.swing.JComponent, "KeyboardState");
1470 c$.getKeyCodeArray = Clazz.defineMethod (c$, "getKeyCodeArray",
1472 var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey);
1474 a = new javax.swing.JComponent.IntVector ();
1475 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a);
1478 c$.registerKeyPressed = Clazz.defineMethod (c$, "registerKeyPressed",
1480 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1483 for (d = 0; d < c; d++) {
1484 if (b.elementAt (d) == -1) {
1485 b.setElementAt (a, d);
1490 c$.registerKeyReleased = Clazz.defineMethod (c$, "registerKeyReleased",
1492 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1495 for (d = 0; d < c; d++) {
1496 if (b.elementAt (d) == a) {
1497 b.setElementAt (-1, d);
1501 c$.keyIsPressed = Clazz.defineMethod (c$, "keyIsPressed",
1503 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1506 for (d = 0; d < c; d++) {
1507 if (b.elementAt (d) == a) {
1512 c$.shouldProcess = Clazz.defineMethod (c$, "shouldProcess",
1514 switch (a.getID ()) {
1516 if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) {
1517 javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ());
1520 if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) {
1521 javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ());
1529 }, "java.awt.event.KeyEvent");
1530 c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState;
1532 Clazz.defineStatics (c$,
1533 "uiClassID", "ComponentUI",
1534 "managingFocusForwardTraversalKeys", null,
1535 "managingFocusBackwardTraversalKeys", null,
1537 "PARTIALLY_OBSCURED", 1,
1538 "COMPLETELY_OBSCURED", 2,
1539 "DEBUG_GRAPHICS_LOADED", false);
1540 c$.INPUT_VERIFIER_SOURCE_KEY = c$.prototype.INPUT_VERIFIER_SOURCE_KEY = new Clazz._O ();
1541 Clazz.defineStatics (c$,
1543 "WHEN_ANCESTOR_OF_FOCUSED_COMPONENT", 1,
1544 "WHEN_IN_FOCUSED_WINDOW", 2,
1545 "UNDEFINED_CONDITION", -1,
1546 "WHEN_IN_FOCUSED_WINDOW_BINDINGS", "_WhenInFocusedWindow",
1547 "TOOL_TIP_TEXT_KEY", "ToolTipText",
1548 "NEXT_FOCUS", "nextFocus",
1549 "IS_DOUBLE_BUFFERED", 0,
1550 "ANCESTOR_USING_BUFFER", 1,
1551 "IS_PAINTING_TILE", 2,
1553 "FOCUS_INPUTMAP_CREATED", 5,
1554 "ANCESTOR_INPUTMAP_CREATED", 6,
1555 "WIF_INPUTMAP_CREATED", 7,
1556 "ACTIONMAP_CREATED", 8,
1557 "CREATED_DOUBLE_BUFFER", 9,
1559 "IS_PRINTING_ALL", 12,
1560 "IS_REPAINTING", 13,
1561 "REQUEST_FOCUS_DISABLED", 22,
1562 "INHERITS_POPUP_MENU", 23,
1564 "AUTOSCROLLS_SET", 25,
1565 "REVALIDATE_RUNNABLE_SCHEDULED", 28);
1566 c$.tempRectangles = c$.prototype.tempRectangles = new java.util.ArrayList (11);
1567 Clazz.defineStatics (c$,
1568 "defaultLocale", "JComponent.defaultLocale",
1569 "componentObtainingGraphicsFrom", null);
1570 c$.componentObtainingGraphicsFromLock = c$.prototype.componentObtainingGraphicsFromLock = new Clazz._O ();
1571 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));