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