5159933444ba523ecd9e3a8f8ec664ba4708541f
[jalviewjs.git] / site / j2s / javax / swing / JComponent.js
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;
5 this.alignmentX = 0;
6 this.isAlignmentYSet = false;
7 this.alignmentY = 0;
8 this.ui = null;
9 this.listenerList = null;
10 this.clientProperties = null;
11 this.autoscrolls = false;
12 this.border = null;
13 this.flags = 0;
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$ ();
23 }
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 ();
28 });
29 c$.safelyGetGraphics = Clazz.defineMethod (c$, "safelyGetGraphics", 
30 function (c, root) {
31 {
32 javax.swing.JComponent.componentObtainingGraphicsFrom = root;
33 var g = c.getGraphics ();
34 javax.swing.JComponent.componentObtainingGraphicsFrom = null;
35 return g;
36 }}, "java.awt.Component,java.awt.Component");
37 c$.getGraphicsInvoked = Clazz.defineMethod (c$, "getGraphicsInvoked", 
38 function (root) {
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", 
45  function (c) {
46 {
47 return (javax.swing.JComponent.componentObtainingGraphicsFrom === c);
48 }}, "java.awt.Component");
49 c$.getManagingFocusForwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusForwardTraversalKeys", 
50 function () {
51 {
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;
56 });
57 c$.getManagingFocusBackwardTraversalKeys = Clazz.defineMethod (c$, "getManagingFocusBackwardTraversalKeys", 
58 function () {
59 {
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;
64 });
65 c$.fetchRectangle = Clazz.defineMethod (c$, "fetchRectangle", 
66  function () {
67 {
68 var rect;
69 var size = javax.swing.JComponent.tempRectangles.size ();
70 if (size > 0) {
71 rect = javax.swing.JComponent.tempRectangles.remove (size - 1);
72 } else {
73 rect =  new java.awt.Rectangle (0, 0, 0, 0);
74 }return rect;
75 }});
76 c$.recycleRectangle = Clazz.defineMethod (c$, "recycleRectangle", 
77  function (rect) {
78 {
79 javax.swing.JComponent.tempRectangles.add (rect);
80 }}, "java.awt.Rectangle");
81 Clazz.defineMethod (c$, "setInheritsPopupMenu", 
82 function (value) {
83 var oldValue = this.getFlag (23);
84 this.setFlag (23, value);
85 this.firePropertyChangeBool ("inheritsPopupMenu", oldValue, value);
86 }, "~B");
87 Clazz.defineMethod (c$, "getInheritsPopupMenu", 
88 function () {
89 return this.getFlag (23);
90 });
91 Clazz.defineMethod (c$, "setComponentPopupMenu", 
92 function (popup) {
93 if (popup != null) {
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", 
100 function () {
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)) {
109 break;
110 }parent = parent.getParent ();
111 }
112 return null;
113 }return this.popupMenu;
114 });
115 Clazz.makeConstructor (c$, 
116 function () {
117 Clazz.superConstructor (this, javax.swing.JComponent);
118 this.enableEvents (8);
119 Clazz.superCall (this, javax.swing.JComponent, "setLocale", [javax.swing.JComponent.getDefaultLocale ()]);
120 });
121 Clazz.defineMethod (c$, "updateUI", 
122 function () {
123 });
124 Clazz.defineMethod (c$, "setUI", 
125 function (newUI) {
126 this.uninstallUIAndProperties ();
127 this.ui = newUI;
128 if (this.ui != null) {
129 this.ui.installUI (this);
130 }this.revalidate ();
131 this.repaint ();
132 }, "javax.swing.plaf.ComponentUI");
133 Clazz.defineMethod (c$, "getUI", 
134 function () {
135 return this.ui;
136 });
137 Clazz.defineMethod (c$, "uninstallUIAndProperties", 
138  function () {
139 if (this.ui != null) {
140 this.ui.uninstallUI (this);
141 }});
142 Clazz.defineMethod (c$, "getUIClassID", 
143 function () {
144 return "ComponentUI";
145 });
146 Clazz.defineMethod (c$, "getComponentGraphics", 
147 function (g) {
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", 
154 function (g) {
155 if (this.ui != null) {
156 var scratchGraphics = (g == null) ? null : g.createSwingJS ();
157 try {
158 this.ui.update (scratchGraphics, this);
159 } finally {
160 scratchGraphics.dispose ();
161 }
162 }}, "java.awt.Graphics");
163 Clazz.defineMethod (c$, "paintChildren", 
164 function (g) {
165 var isJComponent;
166 var sg = g;
167 {
168
169 var i = this.getComponentCount () - 1;
170 if (i < 0) {
171 return;
172 }if (this.paintingChild != null && (Clazz.instanceOf (this.paintingChild, javax.swing.JComponent))) {
173 for (; i >= 0; i--) {
174 if (this.getComponent (i) === this.paintingChild) {
175 break;
176 }}
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;
187 try {
188 if (isJComponent) {
189 (comp).paint (cg);
190 } else {
191 comp.paint (cg);
192 }} finally {
193 cg.dispose ();
194 if (shouldSetFlagBack) {
195 (comp).setFlag (1, false);
196 (comp).setFlag (2, false);
197 }}
198 }}
199 javax.swing.JComponent.recycleRectangle (tmpRect);
200 }}, "java.awt.Graphics");
201 Clazz.defineMethod (c$, "paintBorder", 
202 function (g) {
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", 
208 function (g) {
209 this.paint (g);
210 }, "java.awt.Graphics");
211 Clazz.overrideMethod (c$, "paint", 
212 function (g) {
213 var shouldClearPaintFlags = false;
214 if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) {
215 return;
216 }var componentGraphics = this.getComponentGraphics (g);
217 var co = componentGraphics.createSwingJS ();
218 try {
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);
225 } finally {
226 co.dispose ();
227 if (shouldClearPaintFlags) {
228 this.setFlag (1, false);
229 this.setFlag (2, false);
230 this.setFlag (11, false);
231 this.setFlag (12, false);
232 }}
233 }, "java.awt.Graphics");
234 Clazz.defineMethod (c$, "paintForceDoubleBuffered", 
235 function (g) {
236 var rm = javax.swing.RepaintManager.currentManager (this);
237 var clip = g.getClipBounds ();
238 rm.beginPaint ();
239 this.setFlag (13, true);
240 try {
241 rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height);
242 } finally {
243 rm.endPaint ();
244 this.setFlag (13, false);
245 }
246 }, "java.awt.Graphics");
247 Clazz.defineMethod (c$, "isPainting", 
248 function () {
249 var component = this;
250 while (component != null) {
251 if (Clazz.instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) {
252 return true;
253 }component = component.getParent ();
254 }
255 return false;
256 });
257 Clazz.defineMethod (c$, "adjustPaintFlags", 
258  function () {
259 var jparent = null;
260 var parent;
261 for (parent = this.getParent (); parent != null; parent = parent.getParent ()) {
262 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
263 jparent = parent;
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);
268 break;
269 }}
270 });
271 Clazz.overrideMethod (c$, "printAll", 
272 function (g) {
273 this.setFlag (12, true);
274 try {
275 this.print (g);
276 } finally {
277 this.setFlag (12, false);
278 }
279 }, "java.awt.Graphics");
280 Clazz.overrideMethod (c$, "print", 
281 function (g) {
282 this.setFlag (11, true);
283 this.firePropertyChangeBool ("paintingForPrint", false, true);
284 try {
285 this.paint (g);
286 } finally {
287 this.setFlag (11, false);
288 this.firePropertyChangeBool ("paintingForPrint", true, false);
289 }
290 }, "java.awt.Graphics");
291 Clazz.defineMethod (c$, "printComponent", 
292 function (g) {
293 this.paintComponent (g);
294 }, "java.awt.Graphics");
295 Clazz.defineMethod (c$, "printChildren", 
296 function (g) {
297 this.paintChildren (g);
298 }, "java.awt.Graphics");
299 Clazz.defineMethod (c$, "printBorder", 
300 function (g) {
301 this.paintBorder (g);
302 }, "java.awt.Graphics");
303 Clazz.defineMethod (c$, "isPaintingTile", 
304 function () {
305 return this.getFlag (2);
306 });
307 Clazz.defineMethod (c$, "isPaintingForPrint", 
308 function () {
309 return this.getFlag (11);
310 });
311 Clazz.defineMethod (c$, "isManagingFocus", 
312 function () {
313 return false;
314 });
315 Clazz.defineMethod (c$, "registerNextFocusableComponent", 
316  function () {
317 this.registerNextFocusableComponent (this.getNextFocusableComponent ());
318 });
319 Clazz.defineMethod (c$, "registerNextFocusableComponent", 
320  function (nextFocusableComponent) {
321 if (nextFocusableComponent == null) {
322 return;
323 }}, "java.awt.Component");
324 Clazz.defineMethod (c$, "deregisterNextFocusableComponent", 
325  function () {
326 var nextFocusableComponent = this.getNextFocusableComponent ();
327 if (nextFocusableComponent == null) {
328 return;
329 }var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
330 if (nearestRoot == null) {
331 return;
332 }});
333 Clazz.defineMethod (c$, "setNextFocusableComponent", 
334 function (aComponent) {
335 var displayable = this.isDisplayable ();
336 if (displayable) {
337 this.deregisterNextFocusableComponent ();
338 }this.putClientProperty ("nextFocus", aComponent);
339 if (displayable) {
340 this.registerNextFocusableComponent (aComponent);
341 }}, "java.awt.Component");
342 Clazz.defineMethod (c$, "getNextFocusableComponent", 
343 function () {
344 return this.getClientProperty ("nextFocus");
345 });
346 Clazz.defineMethod (c$, "setRequestFocusEnabled", 
347 function (requestFocusEnabled) {
348 this.setFlag (22, !requestFocusEnabled);
349 }, "~B");
350 Clazz.defineMethod (c$, "isRequestFocusEnabled", 
351 function () {
352 return !this.getFlag (22);
353 });
354 Clazz.defineMethod (c$, "requestFocus", 
355 function (temporary) {
356 Clazz.superCall (this, javax.swing.JComponent, "requestFocus", []);
357 return true;
358 }, "~B");
359 Clazz.defineMethod (c$, "requestFocusInWindow", 
360 function (temporary) {
361 return Clazz.superCall (this, javax.swing.JComponent, "requestFocusInWindow", []);
362 }, "~B");
363 Clazz.defineMethod (c$, "grabFocus", 
364 function () {
365 this.requestFocus ();
366 });
367 Clazz.defineMethod (c$, "setVerifyInputWhenFocusTarget", 
368 function (verifyInputWhenFocusTarget) {
369 var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget;
370 this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
371 this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget);
372 }, "~B");
373 Clazz.defineMethod (c$, "getVerifyInputWhenFocusTarget", 
374 function () {
375 return this.verifyInputWhenFocusTarget;
376 });
377 Clazz.overrideMethod (c$, "getFontMetrics", 
378 function (font) {
379 return jssun.font.FontDesignMetrics.getMetrics (font);
380 }, "java.awt.Font");
381 Clazz.overrideMethod (c$, "getPreferredSize", 
382 function () {
383 return this.getPrefSizeJComp ();
384 });
385 Clazz.defineMethod (c$, "getPrefSizeJComp", 
386 function () {
387 var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this));
388 return (size == null ? this.preferredSize () : size);
389 });
390 Clazz.defineMethod (c$, "getMaximumSize", 
391 function () {
392 if (this.isMaximumSizeSet ()) {
393 return Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
394 }var size = null;
395 if (this.ui != null) {
396 size = this.ui.getMaximumSize (this);
397 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
398 });
399 Clazz.defineMethod (c$, "getMinimumSize", 
400 function () {
401 if (this.isMinimumSizeSet ()) {
402 return Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
403 }var size = null;
404 if (this.ui != null) {
405 size = this.ui.getMinimumSize (this);
406 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
407 });
408 Clazz.overrideMethod (c$, "contains", 
409 function (x, y) {
410 return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y);
411 }, "~N,~N");
412 Clazz.defineMethod (c$, "setBorder", 
413 function (border) {
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)))) {
419 this.revalidate ();
420 }this.repaint ();
421 }}, "javax.swing.border.Border");
422 Clazz.defineMethod (c$, "getBorder", 
423 function () {
424 return this.border;
425 });
426 Clazz.defineMethod (c$, "getInsets", 
427 function () {
428 if (this.border != null) {
429 return this.border.getBorderInsets (this);
430 }return Clazz.superCall (this, javax.swing.JComponent, "getInsets", []);
431 });
432 Clazz.defineMethod (c$, "getInsets", 
433 function (insets) {
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);
439 } else {
440 return this.border.getBorderInsets (this);
441 }} else {
442 insets.left = insets.top = insets.right = insets.bottom = 0;
443 return insets;
444 }}, "java.awt.Insets");
445 Clazz.defineMethod (c$, "getAlignmentY", 
446 function () {
447 if (this.isAlignmentYSet) {
448 return this.alignmentY;
449 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentY", []);
450 });
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;
455 }, "~N");
456 Clazz.defineMethod (c$, "getAlignmentX", 
457 function () {
458 if (this.isAlignmentXSet) {
459 return this.alignmentX;
460 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentX", []);
461 });
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;
466 }, "~N");
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", 
474 function () {
475 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
476 });
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);
490 var strokes;
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]);
500 }}
501 }} else {
502 strokes = null;
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);
508 }
509 registered.clear ();
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]);
516 }
517 } else {
518 this.putClientProperty ("_WhenInFocusedWindow", null);
519 }}, "~B");
520 Clazz.defineMethod (c$, "unregisterWithKeyboardManager", 
521  function () {
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);
528 }
529 }this.putClientProperty ("_WhenInFocusedWindow", null);
530 });
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 ();
536 }
537 if (km != null) {
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);
557 if (km != null) {
558 var actionID = km.get (aKeyStroke);
559 if (am != null && actionID != null) {
560 am.remove (actionID);
561 }km.remove (aKeyStroke);
562 }}
563 }, "javax.swing.KeyStroke");
564 Clazz.defineMethod (c$, "getRegisteredKeyStrokes", 
565 function () {
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;
572 }
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];
578 }}
579 return retValue;
580 });
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) {
586 return counter;
587 }}
588 return -1;
589 }, "javax.swing.KeyStroke");
590 Clazz.defineMethod (c$, "getActionForKeyStroke", 
591 function (aKeyStroke) {
592 var am = this.getActionMap (false);
593 if (am == null) {
594 return null;
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;
603 }return action;
604 }}}
605 return null;
606 }, "javax.swing.KeyStroke");
607 Clazz.defineMethod (c$, "resetKeyboardActions", 
608 function () {
609 for (var counter = 0; counter < 3; counter++) {
610 var inputMap = this.getInputMap (counter, false);
611 if (inputMap != null) {
612 inputMap.clear ();
613 }}
614 var am = this.getActionMap (false);
615 if (am != null) {
616 am.clear ();
617 }});
618 Clazz.defineMethod (c$, "setInputMap", 
619 function (condition, map) {
620 switch (condition) {
621 case 2:
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);
627 break;
628 case 1:
629 this.ancestorInputMap = map;
630 this.setFlag (6, true);
631 break;
632 case 0:
633 this.focusInputMap = map;
634 this.setFlag (5, true);
635 break;
636 default:
637 throw  new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
638 }
639 }, "~N,javax.swing.InputMap");
640 Clazz.defineMethod (c$, "getInputMap", 
641 function (condition) {
642 return this.getInputMap (condition, true);
643 }, "~N");
644 Clazz.defineMethod (c$, "getInputMap", 
645 function () {
646 return this.getInputMap (0, true);
647 });
648 Clazz.defineMethod (c$, "setActionMap", 
649 function (am) {
650 this.actionMap = am;
651 this.setFlag (8, true);
652 }, "javax.swing.ActionMap");
653 Clazz.defineMethod (c$, "getActionMap", 
654 function () {
655 return this.getActionMap (true);
656 });
657 Clazz.defineMethod (c$, "getInputMap", 
658 function (condition, create) {
659 switch (condition) {
660 case 0:
661 if (this.getFlag (5)) {
662 return this.focusInputMap;
663 }if (create) {
664 var km =  new javax.swing.InputMap ();
665 this.setInputMap (condition, km);
666 return km;
667 }break;
668 case 1:
669 if (this.getFlag (6)) {
670 return this.ancestorInputMap;
671 }if (create) {
672 var km =  new javax.swing.InputMap ();
673 this.setInputMap (condition, km);
674 return km;
675 }break;
676 case 2:
677 if (this.getFlag (7)) {
678 return this.windowInputMap;
679 }if (create) {
680 var km =  new javax.swing.ComponentInputMap (this);
681 this.setInputMap (condition, km);
682 return km;
683 }break;
684 default:
685 throw  new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
686 }
687 return null;
688 }, "~N,~B");
689 Clazz.defineMethod (c$, "getActionMap", 
690 function (create) {
691 {
692 (arguments.length == 0) && (create = true);
693 }if (this.getFlag (8)) {
694 return this.actionMap;
695 }if (create) {
696 var am =  new javax.swing.ActionMap ();
697 this.setActionMap (am);
698 return am;
699 }return null;
700 }, "~B");
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);
706 }return -1;
707 }, "~N,~N");
708 Clazz.overrideMethod (c$, "getBaselineResizeBehavior", 
709 function () {
710 if (this.ui != null) {
711 return this.ui.getBaselineResizeBehavior (this);
712 }return java.awt.Component.BaselineResizeBehavior.OTHER;
713 });
714 Clazz.defineMethod (c$, "requestDefaultFocus", 
715 function () {
716 var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
717 if (nearestRoot == null) {
718 return false;
719 }return false;
720 });
721 Clazz.defineMethod (c$, "setVisible", 
722 function (aFlag) {
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);
729 }this.revalidate ();
730 }}, "~B");
731 Clazz.defineMethod (c$, "setEnabled", 
732 function (enabled) {
733 var oldEnabled = this.isEnabled ();
734 Clazz.superCall (this, javax.swing.JComponent, "setEnabled", [enabled]);
735 this.firePropertyChangeBool ("enabled", oldEnabled, enabled);
736 if (enabled != oldEnabled) {
737 this.repaint ();
738 }}, "~B");
739 Clazz.defineMethod (c$, "setForeground", 
740 function (fg) {
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))) {
744 this.repaint ();
745 }}, "java.awt.Color");
746 Clazz.defineMethod (c$, "setBackground", 
747 function (bg) {
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))) {
751 this.repaint ();
752 }}, "java.awt.Color");
753 Clazz.defineMethod (c$, "setFont", 
754 function (font) {
755 var oldFont = this.getFont ();
756 Clazz.superCall (this, javax.swing.JComponent, "setFont", [font]);
757 if (font !== oldFont) {
758 this.revalidate ();
759 this.repaint ();
760 }}, "java.awt.Font");
761 c$.getDefaultLocale = Clazz.defineMethod (c$, "getDefaultLocale", 
762 function () {
763 var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale");
764 if (l == null) {
765 l = java.util.Locale.getDefault ();
766 javax.swing.JComponent.setDefaultLocale (l);
767 }return l;
768 });
769 c$.setDefaultLocale = Clazz.defineMethod (c$, "setDefaultLocale", 
770 function (l) {
771 javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l);
772 }, "java.util.Locale");
773 Clazz.defineMethod (c$, "processComponentKeyEvent", 
774 function (e) {
775 }, "java.awt.event.KeyEvent");
776 Clazz.defineMethod (c$, "processKeyEvent", 
777 function (e) {
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 ()) {
784 return;
785 }if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) {
786 e.consume ();
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 ());
797 }}return false;
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)) {
802 return false;
803 }var ks;
804 if (e.getID () == 400) {
805 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ());
806 } else {
807 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true));
808 }if (this.processKeyBinding (ks, e, 0, pressed)) return true;
809 var parent = this;
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 ();
814 }
815 if (parent != null) {
816 return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed);
817 }return false;
818 }, "java.awt.event.KeyEvent,~B");
819 c$.processKeyBindingsForAllComponents = Clazz.defineMethod (c$, "processKeyBindingsForAllComponents", 
820 function (e, container, pressed) {
821 while (true) {
822 if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) {
823 return true;
824 }if (Clazz.instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) {
825 container = (container).getOwner ();
826 } else {
827 return false;
828 }}
829 }, "java.awt.event.KeyEvent,java.awt.Container,~B");
830 Clazz.defineMethod (c$, "setToolTipText", 
831 function (text) {
832 this.putClientProperty ("ToolTipText", text);
833 }, "~S");
834 Clazz.defineMethod (c$, "getToolTipText", 
835 function () {
836 return this.getClientProperty ("ToolTipText");
837 });
838 Clazz.defineMethod (c$, "getToolTipText", 
839 function (event) {
840 return this.getToolTipText ();
841 }, "java.awt.event.MouseEvent");
842 Clazz.defineMethod (c$, "getToolTipLocation", 
843 function (event) {
844 return null;
845 }, "java.awt.event.MouseEvent");
846 Clazz.defineMethod (c$, "getPopupLocation", 
847 function (event) {
848 return null;
849 }, "java.awt.event.MouseEvent");
850 Clazz.defineMethod (c$, "createToolTip", 
851 function () {
852 var tip =  new javax.swing.JToolTip ();
853 tip.setComponent (this);
854 return tip;
855 });
856 Clazz.defineMethod (c$, "scrollRectToVisible", 
857 function (aRect) {
858 var parent;
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 ();
863 dx += bounds.x;
864 dy += bounds.y;
865 }
866 if (!(parent == null) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane))) {
867 aRect.x += dx;
868 aRect.y += dy;
869 (parent).scrollRectToVisible (aRect);
870 aRect.x -= dx;
871 aRect.y -= dy;
872 }}, "java.awt.Rectangle");
873 Clazz.defineMethod (c$, "setAutoscrolls", 
874 function (autoscrolls) {
875 }, "~B");
876 Clazz.defineMethod (c$, "getAutoscrolls", 
877 function () {
878 return this.autoscrolls;
879 });
880 Clazz.defineMethod (c$, "superProcessMouseMotionEvent", 
881 function (e) {
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);
887 }, "~B");
888 Clazz.defineMethod (c$, "getCreatedDoubleBuffer", 
889 function () {
890 return this.getFlag (9);
891 });
892 Clazz.defineMethod (c$, "getClientProperties", 
893  function () {
894 if (this.clientProperties == null) {
895 this.clientProperties =  new javax.swing.ArrayTable ();
896 }return this.clientProperties;
897 });
898 Clazz.defineMethod (c$, "getClientProperty", 
899 function (key) {
900 if (this.clientProperties == null) {
901 return null;
902 } else {
903 {
904 return this.clientProperties.get (key);
905 }}}, "~O");
906 Clazz.defineMethod (c$, "putClientProperty", 
907 function (key, value) {
908 if (value == null && this.clientProperties == null) {
909 return;
910 }var clientProperties = this.getClientProperties ();
911 var oldValue;
912 {
913 oldValue = clientProperties.get (key);
914 if (value != null) {
915 clientProperties.put (key, value);
916 } else if (oldValue != null) {
917 clientProperties.remove (key);
918 } else {
919 return;
920 }}this.clientPropertyChanged (key, oldValue, value);
921 this.firePropertyChangeObject (key.toString (), oldValue, value);
922 }, "~O,~O");
923 Clazz.defineMethod (c$, "clientPropertyChanged", 
924 function (key, oldValue, newValue) {
925 }, "~O,~O,~O");
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") {
938 } else {
939 System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5));
940 }}, "~S,~O");
941 c$.isLightweightComponent = Clazz.defineMethod (c$, "isLightweightComponent", 
942 function (c) {
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", 
946 function () {
947 return this.getFlag (3);
948 });
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);
955 }, "~B");
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);
961 var cx;
962 var cy;
963 var cw;
964 var ch;
965 cx = child.getX ();
966 cy = child.getY ();
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 ();
972 } else {
973 return false;
974 }}}
975 return false;
976 }, "~N,~N,~N,~N");
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);
983 } else {
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", 
994 function () {
995 var visibleRect =  new java.awt.Rectangle ();
996 this.computeVisibleRect (visibleRect);
997 return visibleRect;
998 });
999 Clazz.defineMethod (c$, "getTopLevelAncestor", 
1000 function () {
1001 for (var p = this; p != null; p = p.getParent ()) {
1002 if (Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
1003 return p;
1004 }}
1005 return null;
1006 });
1007 Clazz.defineMethod (c$, "getAncestorNotifier", 
1008  function () {
1009 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER);
1010 });
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) {
1023 return;
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", 
1030 function () {
1031 var ancestorNotifier = this.getAncestorNotifier ();
1032 if (ancestorNotifier == null) {
1033 return  new Array (0);
1034 }return ancestorNotifier.getAncestorListeners ();
1035 });
1036 Clazz.defineMethod (c$, "getListeners", 
1037 function (listenerType) {
1038 var result;
1039 if (listenerType === javax.swing.event.AncestorListener) {
1040 result = this.getAncestorListeners ();
1041 } else if (listenerType === java.beans.PropertyChangeListener) {
1042 result = this.getPropertyChangeListeners ();
1043 } else {
1044 result = this.listenerList.getListeners (listenerType);
1045 }if (result.length == 0) {
1046 return Clazz.superCall (this, javax.swing.JComponent, "getListeners", [listenerType]);
1047 }return result;
1048 }, "Class");
1049 Clazz.defineMethod (c$, "addNotify", 
1050 function () {
1051 Clazz.superCall (this, javax.swing.JComponent, "addNotify", []);
1052 this.firePropertyChangeObject ("ancestor", null, this.getParent ());
1053 this.registerWithKeyboardManager (false);
1054 this.registerNextFocusableComponent ();
1055 });
1056 Clazz.defineMethod (c$, "removeNotify", 
1057 function () {
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);
1065 }});
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", 
1071 function (r) {
1072 this.repaint (0, r.x, r.y, r.width, r.height);
1073 }, "java.awt.Rectangle");
1074 Clazz.defineMethod (c$, "revalidate", 
1075 function () {
1076 if (this.getParent () == null) {
1077 return;
1078 }if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
1079 this.invalidate ();
1080 javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this);
1081 } else {
1082 {
1083 if (this.getFlag (28)) {
1084 return;
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);
1088 }});
1089 Clazz.defineMethod (c$, "isValidateRoot", 
1090 function () {
1091 return false;
1092 });
1093 Clazz.defineMethod (c$, "isOptimizedDrawingEnabled", 
1094 function () {
1095 return true;
1096 });
1097 Clazz.defineMethod (c$, "isPaintingOrigin", 
1098 function () {
1099 return false;
1100 });
1101 Clazz.defineMethod (c$, "paintImmediately", 
1102 function (x, y, w, h) {
1103 {
1104 if (arguments.length == 1) {
1105 var r = x;
1106 x = r.x;
1107 y = r.y;
1108 w = r.width;
1109 h = r.height;
1110 }
1111 }var c = this;
1112 var parent;
1113 if (!this.isShowing ()) {
1114 return;
1115 }while (!(c).isOpaque ()) {
1116 parent = c.getParent ();
1117 if (parent != null) {
1118 x += c.getX ();
1119 y += c.getY ();
1120 c = parent;
1121 } else {
1122 break;
1123 }if (!(Clazz.instanceOf (c, javax.swing.JComponent))) {
1124 break;
1125 }}
1126 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
1127 (c)._paintImmediately (x, y, w, h);
1128 } else {
1129 c.repaint (x, y, w, h);
1130 }}, "~N,~N,~N,~N");
1131 Clazz.defineMethod (c$, "paintImmediately", 
1132 function (r) {
1133 this.paintImmediately (r.x, r.y, r.width, r.height);
1134 }, "java.awt.Rectangle");
1135 Clazz.defineMethod (c$, "alwaysOnTop", 
1136 function () {
1137 return false;
1138 });
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) {
1145 var g;
1146 var c;
1147 var tmpX;
1148 var tmpY;
1149 var tmpWidth;
1150 var tmpHeight;
1151 var offsetX = 0;
1152 var offsetY = 0;
1153 var hasBuffer = false;
1154 var bufferedComponent = null;
1155 var paintingComponent = this;
1156 var path =  new java.util.ArrayList (7);
1157 var pIndex = -1;
1158 var pCount = 0;
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 ();
1166 if (ontop) {
1167 javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip);
1168 if (paintImmediatelyClip.width == 0) {
1169 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1170 return;
1171 }}var child;
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;
1174 path.add (c);
1175 if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) {
1176 var resetPC;
1177 if (c !== this) {
1178 if (jc.isPaintingOrigin ()) {
1179 resetPC = true;
1180 } else {
1181 var children = c.getComponents ();
1182 var i = 0;
1183 for (; i < children.length; i++) {
1184 if (children[i] === child) break;
1185 }
1186 switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) {
1187 case 0:
1188 resetPC = false;
1189 break;
1190 case 2:
1191 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1192 return;
1193 default:
1194 resetPC = true;
1195 break;
1196 }
1197 }} else {
1198 resetPC = false;
1199 }if (resetPC) {
1200 paintingComponent = jc;
1201 pIndex = pCount;
1202 offsetX = offsetY = 0;
1203 hasBuffer = false;
1204 }}pCount++;
1205 if (!ontop) {
1206 var bx = c.getX ();
1207 var by = c.getY ();
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;
1213 offsetX += bx;
1214 offsetY += by;
1215 }}
1216 if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) {
1217 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1218 return;
1219 }paintingComponent.setFlag (13, true);
1220 paintImmediatelyClip.x -= offsetX;
1221 paintImmediatelyClip.y -= offsetY;
1222 if (paintingComponent !== this) {
1223 var comp;
1224 var i = pIndex;
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));
1229 }}
1230 }try {
1231 g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS ();
1232 try {
1233 if (hasBuffer) {
1234 var rm = javax.swing.RepaintManager.currentManager (bufferedComponent);
1235 rm.beginPaint ();
1236 try {
1237 rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height);
1238 } finally {
1239 rm.endPaint ();
1240 }
1241 } else {
1242 paintingComponent.paint (g);
1243 }} finally {
1244 g.dispose ();
1245 }
1246 } finally {
1247 if (paintingComponent !== this) {
1248 var comp;
1249 var i = pIndex;
1250 for (; i > 0; i--) {
1251 comp = path.get (i);
1252 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
1253 (comp).setPaintingChild (null);
1254 }}
1255 }paintingComponent.setFlag (13, false);
1256 }
1257 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1258 }, "~N,~N,~N,~N");
1259 Clazz.defineMethod (c$, "paintToOffscreen", 
1260 function (g, x, y, w, h, maxX, maxY) {
1261 try {
1262 this.setFlag (1, true);
1263 if ((y + h) < maxY || (x + w) < maxX) {
1264 this.setFlag (2, true);
1265 }if (this.getFlag (13)) {
1266 this.paint (g);
1267 } else {
1268 if (!this.rectangleIsObscured (x, y, w, h)) {
1269 this.paintComponent (g);
1270 this.paintBorder (g);
1271 }this.paintChildren (g);
1272 }} finally {
1273 this.setFlag (1, false);
1274 this.setFlag (2, false);
1275 }
1276 }, "java.awt.Graphics,~N,~N,~N,~N,~N,~N");
1277 Clazz.defineMethod (c$, "getObscuredState", 
1278  function (compIndex, x, y, width, height) {
1279 var retValue = 0;
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 ()) {
1284 continue;
1285 }var siblingRect;
1286 var opaque;
1287 if (Clazz.instanceOf (sibling, javax.swing.JComponent)) {
1288 opaque = (sibling).isOpaque ();
1289 if (!opaque) {
1290 if (retValue == 1) {
1291 continue;
1292 }}} else {
1293 opaque = true;
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);
1297 return 2;
1298 } else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) {
1299 retValue = 1;
1300 }}
1301 javax.swing.JComponent.recycleRectangle (tmpRect);
1302 return retValue;
1303 }, "~N,~N,~N,~N,~N");
1304 Clazz.defineMethod (c$, "checkIfChildObscuredBySibling", 
1305 function () {
1306 return true;
1307 });
1308 Clazz.defineMethod (c$, "setFlag", 
1309  function (aFlag, aValue) {
1310 if (aValue) {
1311 this.flags |= (1 << aFlag);
1312 } else {
1313 this.flags &= ~(1 << aFlag);
1314 }}, "~N,~B");
1315 Clazz.defineMethod (c$, "getFlag", 
1316  function (aFlag) {
1317 var mask = (1 << aFlag);
1318 return ((this.flags & mask) == mask);
1319 }, "~N");
1320 Clazz.defineMethod (c$, "setDoubleBuffered", 
1321 function (aFlag) {
1322 }, "~B");
1323 Clazz.overrideMethod (c$, "isDoubleBuffered", 
1324 function () {
1325 return this.getFlag (0);
1326 });
1327 Clazz.defineMethod (c$, "getRootPane", 
1328 function () {
1329 return javax.swing.SwingUtilities.getRootPane (this);
1330 });
1331 Clazz.defineMethod (c$, "paramString", 
1332 function () {
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;
1338 });
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;
1345 this.action = null;
1346 Clazz.instantialize (this, arguments);
1347 }, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action);
1348 Clazz.makeConstructor (c$, 
1349 function (a, b) {
1350 this.actionListener = a;
1351 if (Clazz.instanceOf (a, javax.swing.Action)) {
1352 this.action = a;
1353 } else {
1354 this.action = null;
1355 }this.command = b;
1356 }, "java.awt.event.ActionListener,~S");
1357 Clazz.defineMethod (c$, "getValue", 
1358 function (a) {
1359 if (a != null) {
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";
1366 }}return null;
1367 }, "~S");
1368 Clazz.defineMethod (c$, "isEnabled", 
1369 function () {
1370 if (this.actionListener == null) {
1371 return false;
1372 }if (this.action == null) {
1373 return true;
1374 }return this.action.isEnabled ();
1375 });
1376 Clazz.defineMethod (c$, "actionPerformed", 
1377 function (a) {
1378 if (this.actionListener != null) {
1379 this.actionListener.actionPerformed (a);
1380 }}, "java.awt.event.ActionEvent");
1381 Clazz.overrideMethod (c$, "putValue", 
1382 function (a, b) {
1383 }, "~S,~O");
1384 Clazz.overrideMethod (c$, "setEnabled", 
1385 function (a) {
1386 }, "~B");
1387 Clazz.overrideMethod (c$, "addPropertyChangeListener", 
1388 function (a) {
1389 }, "java.beans.PropertyChangeListener");
1390 Clazz.overrideMethod (c$, "removePropertyChangeListener", 
1391 function (a) {
1392 }, "java.beans.PropertyChangeListener");
1393 c$ = Clazz.p0p ();
1394 };
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", 
1399 function () {
1400 {
1401 this.b$["javax.swing.JComponent"].setFlag (28, false);
1402 }this.b$["javax.swing.JComponent"].revalidate ();
1403 });
1404 c$ = Clazz.p0p ();
1405 };
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))) {
1412 return true;
1413 }if ((from == null) || !(Clazz.instanceOf (from, javax.swing.JComponent))) {
1414 return true;
1415 }var target = to;
1416 if (!target.getVerifyInputWhenFocusTarget ()) {
1417 return true;
1418 }var jFocusOwner = from;
1419 var iv = jFocusOwner.getInputVerifier ();
1420 if (iv == null) {
1421 return true;
1422 } else {
1423 var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1424 if (currentSource === jFocusOwner) {
1425 return true;
1426 }javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner);
1427 try {
1428 return iv.shouldYieldFocus (jFocusOwner);
1429 } finally {
1430 if (currentSource != null) {
1431 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource);
1432 } else {
1433 javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1434 }}
1435 }}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause");
1436 c$ = Clazz.p0p ();
1437 };
1438 Clazz.pu$h(self.c$);
1439 c$ = Clazz.decorateAsClass (function () {
1440 this.array = null;
1441 this.count = 0;
1442 this.capacity = 0;
1443 Clazz.instantialize (this, arguments);
1444 }, javax.swing.JComponent, "IntVector");
1445 Clazz.defineMethod (c$, "size", 
1446 function () {
1447 return this.count;
1448 });
1449 Clazz.defineMethod (c$, "elementAt", 
1450 function (a) {
1451 return this.array[a];
1452 }, "~N");
1453 Clazz.defineMethod (c$, "addElement", 
1454 function (a) {
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);
1460 }this.array = b;
1461 }this.array[this.count++] = a;
1462 }, "~N");
1463 Clazz.defineMethod (c$, "setElementAt", 
1464 function (a, b) {
1465 this.array[b] = a;
1466 }, "~N,~N");
1467 c$ = Clazz.p0p ();
1468 Clazz.pu$h(self.c$);
1469 c$ = Clazz.declareType (javax.swing.JComponent, "KeyboardState");
1470 c$.getKeyCodeArray = Clazz.defineMethod (c$, "getKeyCodeArray", 
1471 function () {
1472 var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey);
1473 if (a == null) {
1474 a =  new javax.swing.JComponent.IntVector ();
1475 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a);
1476 }return a;
1477 });
1478 c$.registerKeyPressed = Clazz.defineMethod (c$, "registerKeyPressed", 
1479 function (a) {
1480 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1481 var c = b.size ();
1482 var d;
1483 for (d = 0; d < c; d++) {
1484 if (b.elementAt (d) == -1) {
1485 b.setElementAt (a, d);
1486 return;
1487 }}
1488 b.addElement (a);
1489 }, "~N");
1490 c$.registerKeyReleased = Clazz.defineMethod (c$, "registerKeyReleased", 
1491 function (a) {
1492 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1493 var c = b.size ();
1494 var d;
1495 for (d = 0; d < c; d++) {
1496 if (b.elementAt (d) == a) {
1497 b.setElementAt (-1, d);
1498 return;
1499 }}
1500 }, "~N");
1501 c$.keyIsPressed = Clazz.defineMethod (c$, "keyIsPressed", 
1502 function (a) {
1503 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1504 var c = b.size ();
1505 var d;
1506 for (d = 0; d < c; d++) {
1507 if (b.elementAt (d) == a) {
1508 return true;
1509 }}
1510 return false;
1511 }, "~N");
1512 c$.shouldProcess = Clazz.defineMethod (c$, "shouldProcess", 
1513 function (a) {
1514 switch (a.getID ()) {
1515 case 401:
1516 if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) {
1517 javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ());
1518 }return true;
1519 case 402:
1520 if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) {
1521 javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ());
1522 return true;
1523 }return false;
1524 case 400:
1525 return true;
1526 default:
1527 return false;
1528 }
1529 }, "java.awt.event.KeyEvent");
1530 c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState;
1531 c$ = Clazz.p0p ();
1532 Clazz.defineStatics (c$,
1533 "uiClassID", "ComponentUI",
1534 "managingFocusForwardTraversalKeys", null,
1535 "managingFocusBackwardTraversalKeys", null,
1536 "NOT_OBSCURED", 0,
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$,
1542 "WHEN_FOCUSED", 0,
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,
1552 "IS_OPAQUE", 3,
1553 "FOCUS_INPUTMAP_CREATED", 5,
1554 "ANCESTOR_INPUTMAP_CREATED", 6,
1555 "WIF_INPUTMAP_CREATED", 7,
1556 "ACTIONMAP_CREATED", 8,
1557 "CREATED_DOUBLE_BUFFER", 9,
1558 "IS_PRINTING", 11,
1559 "IS_PRINTING_ALL", 12,
1560 "IS_REPAINTING", 13,
1561 "REQUEST_FOCUS_DISABLED", 22,
1562 "INHERITS_POPUP_MENU", 23,
1563 "OPAQUE_SET", 24,
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));
1572 });