456bc68881126a09816357b93fdc34aaa608d59b
[jalviewjs.git] / site / swingjs / 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 var i = this.getComponentCount () - 1;
169 if (i < 0) {
170 return;
171 }if (this.paintingChild != null && (Clazz.instanceOf (this.paintingChild, javax.swing.JComponent))) {
172 for (; i >= 0; i--) {
173 if (this.getComponent (i) === this.paintingChild) {
174 break;
175 }}
176 }var tmpRect = javax.swing.JComponent.fetchRectangle ();
177 for (; i >= 0; i--) {
178 var comp = this.getComponent (i);
179 isJComponent = (Clazz.instanceOf (comp, javax.swing.JComponent));
180 if (comp != null && (isJComponent || javax.swing.JComponent.isLightweightComponent (comp)) && (comp.isVisible () == true)) {
181 var cr = comp.getBounds (tmpRect);
182 var cg = sg.create4 (cr.x, cr.y, cr.width, cr.height);
183 cg.setColor (comp.getForeground ());
184 cg.setFont (comp.getFont ());
185 var shouldSetFlagBack = false;
186 try {
187 if (isJComponent) {
188 (comp).paint (cg);
189 } else {
190 comp.paint (cg);
191 }} finally {
192 cg.dispose ();
193 if (shouldSetFlagBack) {
194 (comp).setFlag (1, false);
195 (comp).setFlag (2, false);
196 }}
197 }}
198 javax.swing.JComponent.recycleRectangle (tmpRect);
199 }}, "java.awt.Graphics");
200 Clazz.defineMethod (c$, "paintBorder", 
201 function (g) {
202 var border = this.getBorder ();
203 if (border != null) {
204 border.paintBorder (this, g, 0, 0, this.getWidth (), this.getHeight ());
205 }}, "java.awt.Graphics");
206 Clazz.overrideMethod (c$, "update", 
207 function (g) {
208 this.paint (g);
209 }, "java.awt.Graphics");
210 Clazz.overrideMethod (c$, "paint", 
211 function (g) {
212 var shouldClearPaintFlags = false;
213 if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) {
214 return;
215 }var componentGraphics = this.getComponentGraphics (g);
216 var co = componentGraphics.createSwingJS ();
217 try {
218 if (this.getParent () != null && !(Clazz.instanceOf (this.getParent (), javax.swing.JComponent))) {
219 this.adjustPaintFlags ();
220 shouldClearPaintFlags = true;
221 }this.paintComponent (co);
222 this.paintBorder (co);
223 this.paintChildren (co);
224 } finally {
225 co.dispose ();
226 if (shouldClearPaintFlags) {
227 this.setFlag (1, false);
228 this.setFlag (2, false);
229 this.setFlag (11, false);
230 this.setFlag (12, false);
231 }}
232 }, "java.awt.Graphics");
233 Clazz.defineMethod (c$, "paintForceDoubleBuffered", 
234 function (g) {
235 var rm = javax.swing.RepaintManager.currentManager (this);
236 var clip = g.getClipBounds ();
237 rm.beginPaint ();
238 this.setFlag (13, true);
239 try {
240 rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height);
241 } finally {
242 rm.endPaint ();
243 this.setFlag (13, false);
244 }
245 }, "java.awt.Graphics");
246 Clazz.defineMethod (c$, "isPainting", 
247 function () {
248 var component = this;
249 while (component != null) {
250 if (Clazz.instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) {
251 return true;
252 }component = component.getParent ();
253 }
254 return false;
255 });
256 Clazz.defineMethod (c$, "adjustPaintFlags", 
257  function () {
258 var jparent = null;
259 var parent;
260 for (parent = this.getParent (); parent != null; parent = parent.getParent ()) {
261 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
262 jparent = parent;
263 if (jparent.getFlag (1)) this.setFlag (1, true);
264 if (jparent.getFlag (2)) this.setFlag (2, true);
265 if (jparent.getFlag (11)) this.setFlag (11, true);
266 if (jparent.getFlag (12)) this.setFlag (12, true);
267 break;
268 }}
269 });
270 Clazz.overrideMethod (c$, "printAll", 
271 function (g) {
272 this.setFlag (12, true);
273 try {
274 this.print (g);
275 } finally {
276 this.setFlag (12, false);
277 }
278 }, "java.awt.Graphics");
279 Clazz.overrideMethod (c$, "print", 
280 function (g) {
281 this.setFlag (11, true);
282 this.firePropertyChangeBool ("paintingForPrint", false, true);
283 try {
284 this.paint (g);
285 } finally {
286 this.setFlag (11, false);
287 this.firePropertyChangeBool ("paintingForPrint", true, false);
288 }
289 }, "java.awt.Graphics");
290 Clazz.defineMethod (c$, "printComponent", 
291 function (g) {
292 this.paintComponent (g);
293 }, "java.awt.Graphics");
294 Clazz.defineMethod (c$, "printChildren", 
295 function (g) {
296 this.paintChildren (g);
297 }, "java.awt.Graphics");
298 Clazz.defineMethod (c$, "printBorder", 
299 function (g) {
300 this.paintBorder (g);
301 }, "java.awt.Graphics");
302 Clazz.defineMethod (c$, "isPaintingTile", 
303 function () {
304 return this.getFlag (2);
305 });
306 Clazz.defineMethod (c$, "isPaintingForPrint", 
307 function () {
308 return this.getFlag (11);
309 });
310 Clazz.defineMethod (c$, "isManagingFocus", 
311 function () {
312 return false;
313 });
314 Clazz.defineMethod (c$, "registerNextFocusableComponent", 
315  function () {
316 this.registerNextFocusableComponent (this.getNextFocusableComponent ());
317 });
318 Clazz.defineMethod (c$, "registerNextFocusableComponent", 
319  function (nextFocusableComponent) {
320 if (nextFocusableComponent == null) {
321 return;
322 }}, "java.awt.Component");
323 Clazz.defineMethod (c$, "deregisterNextFocusableComponent", 
324  function () {
325 var nextFocusableComponent = this.getNextFocusableComponent ();
326 if (nextFocusableComponent == null) {
327 return;
328 }var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
329 if (nearestRoot == null) {
330 return;
331 }});
332 Clazz.defineMethod (c$, "setNextFocusableComponent", 
333 function (aComponent) {
334 var displayable = this.isDisplayable ();
335 if (displayable) {
336 this.deregisterNextFocusableComponent ();
337 }this.putClientProperty ("nextFocus", aComponent);
338 if (displayable) {
339 this.registerNextFocusableComponent (aComponent);
340 }}, "java.awt.Component");
341 Clazz.defineMethod (c$, "getNextFocusableComponent", 
342 function () {
343 return this.getClientProperty ("nextFocus");
344 });
345 Clazz.defineMethod (c$, "setRequestFocusEnabled", 
346 function (requestFocusEnabled) {
347 this.setFlag (22, !requestFocusEnabled);
348 }, "~B");
349 Clazz.defineMethod (c$, "isRequestFocusEnabled", 
350 function () {
351 return !this.getFlag (22);
352 });
353 Clazz.defineMethod (c$, "requestFocus", 
354 function (temporary) {
355 Clazz.superCall (this, javax.swing.JComponent, "requestFocus", []);
356 return true;
357 }, "~B");
358 Clazz.defineMethod (c$, "requestFocusInWindow", 
359 function (temporary) {
360 return Clazz.superCall (this, javax.swing.JComponent, "requestFocusInWindow", []);
361 }, "~B");
362 Clazz.defineMethod (c$, "grabFocus", 
363 function () {
364 this.requestFocus ();
365 });
366 Clazz.defineMethod (c$, "setVerifyInputWhenFocusTarget", 
367 function (verifyInputWhenFocusTarget) {
368 var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget;
369 this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget;
370 this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget);
371 }, "~B");
372 Clazz.defineMethod (c$, "getVerifyInputWhenFocusTarget", 
373 function () {
374 return this.verifyInputWhenFocusTarget;
375 });
376 Clazz.overrideMethod (c$, "getFontMetrics", 
377 function (font) {
378 return jssun.font.FontDesignMetrics.getMetrics (font);
379 }, "java.awt.Font");
380 Clazz.overrideMethod (c$, "getPreferredSize", 
381 function () {
382 return this.getPrefSizeJComp ();
383 });
384 Clazz.defineMethod (c$, "getPrefSizeJComp", 
385 function () {
386 var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this));
387 return (size == null ? this.preferredSize () : size);
388 });
389 Clazz.defineMethod (c$, "getMaximumSize", 
390 function () {
391 if (this.isMaximumSizeSet ()) {
392 return Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
393 }var size = null;
394 if (this.ui != null) {
395 size = this.ui.getMaximumSize (this);
396 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMaximumSize", []);
397 });
398 Clazz.defineMethod (c$, "getMinimumSize", 
399 function () {
400 if (this.isMinimumSizeSet ()) {
401 return Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
402 }var size = null;
403 if (this.ui != null) {
404 size = this.ui.getMinimumSize (this);
405 }return (size != null) ? size : Clazz.superCall (this, javax.swing.JComponent, "getMinimumSize", []);
406 });
407 Clazz.overrideMethod (c$, "contains", 
408 function (x, y) {
409 return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y);
410 }, "~N,~N");
411 Clazz.defineMethod (c$, "setBorder", 
412 function (border) {
413 var oldBorder = this.border;
414 this.border = border;
415 this.firePropertyChangeObject ("border", oldBorder, border);
416 if (border !== oldBorder) {
417 if (border == null || oldBorder == null || !(border.getBorderInsets (this).equals (oldBorder.getBorderInsets (this)))) {
418 this.revalidate ();
419 }this.repaint ();
420 }}, "javax.swing.border.Border");
421 Clazz.defineMethod (c$, "getBorder", 
422 function () {
423 return this.border;
424 });
425 Clazz.defineMethod (c$, "getInsets", 
426 function () {
427 if (this.border != null) {
428 return this.border.getBorderInsets (this);
429 }return Clazz.superCall (this, javax.swing.JComponent, "getInsets", []);
430 });
431 Clazz.defineMethod (c$, "getInsets", 
432 function (insets) {
433 if (insets == null) {
434 insets =  new java.awt.Insets (0, 0, 0, 0);
435 }if (this.border != null) {
436 if (Clazz.instanceOf (this.border, javax.swing.border.AbstractBorder)) {
437 return (this.border).getBorderInsets (this, insets);
438 } else {
439 return this.border.getBorderInsets (this);
440 }} else {
441 insets.left = insets.top = insets.right = insets.bottom = 0;
442 return insets;
443 }}, "java.awt.Insets");
444 Clazz.defineMethod (c$, "getAlignmentY", 
445 function () {
446 if (this.isAlignmentYSet) {
447 return this.alignmentY;
448 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentY", []);
449 });
450 Clazz.defineMethod (c$, "setAlignmentY", 
451 function (alignmentY) {
452 this.alignmentY = alignmentY > 1.0 ? 1.0 : alignmentY < 0.0 ? 0.0 : alignmentY;
453 this.isAlignmentYSet = true;
454 }, "~N");
455 Clazz.defineMethod (c$, "getAlignmentX", 
456 function () {
457 if (this.isAlignmentXSet) {
458 return this.alignmentX;
459 }return Clazz.superCall (this, javax.swing.JComponent, "getAlignmentX", []);
460 });
461 Clazz.defineMethod (c$, "setAlignmentX", 
462 function (alignmentX) {
463 this.alignmentX = alignmentX > 1.0 ? 1.0 : alignmentX < 0.0 ? 0.0 : alignmentX;
464 this.isAlignmentXSet = true;
465 }, "~N");
466 Clazz.defineMethod (c$, "setInputVerifier", 
467 function (inputVerifier) {
468 var oldInputVerifier = this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
469 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER, inputVerifier);
470 this.firePropertyChangeObject ("inputVerifier", oldInputVerifier, inputVerifier);
471 }, "javax.swing.InputVerifier");
472 Clazz.defineMethod (c$, "getInputVerifier", 
473 function () {
474 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER);
475 });
476 Clazz.defineMethod (c$, "registerKeyboardAction", 
477 function (anAction, aCommand, aKeyStroke, aCondition) {
478 var inputMap = this.getInputMap (aCondition, true);
479 if (inputMap != null) {
480 var actionMap = this.getActionMap (true);
481 var action = Clazz.innerTypeInstance (javax.swing.JComponent.ActionStandin, this, null, anAction, aCommand);
482 inputMap.put (aKeyStroke, action);
483 if (actionMap != null) {
484 actionMap.put (action, action);
485 }}}, "java.awt.event.ActionListener,~S,javax.swing.KeyStroke,~N");
486 Clazz.defineMethod (c$, "registerWithKeyboardManager", 
487  function (onlyIfNew) {
488 var inputMap = this.getInputMap (2, false);
489 var strokes;
490 var registered = this.getClientProperty ("_WhenInFocusedWindow");
491 if (inputMap != null) {
492 strokes = inputMap.allKeys ();
493 if (strokes != null) {
494 for (var counter = strokes.length - 1; counter >= 0; counter--) {
495 if (!onlyIfNew || registered == null || registered.get (strokes[counter]) == null) {
496 this.registerWithKeyboardManager (strokes[counter]);
497 }if (registered != null) {
498 registered.remove (strokes[counter]);
499 }}
500 }} else {
501 strokes = null;
502 }if (registered != null && registered.size () > 0) {
503 var keys = registered.keys ();
504 while (keys.hasMoreElements ()) {
505 var ks = keys.nextElement ();
506 this.unregisterWithKeyboardManager (ks);
507 }
508 registered.clear ();
509 }if (strokes != null && strokes.length > 0) {
510 if (registered == null) {
511 registered =  new java.util.Hashtable (strokes.length);
512 this.putClientProperty ("_WhenInFocusedWindow", registered);
513 }for (var counter = strokes.length - 1; counter >= 0; counter--) {
514 registered.put (strokes[counter], strokes[counter]);
515 }
516 } else {
517 this.putClientProperty ("_WhenInFocusedWindow", null);
518 }}, "~B");
519 Clazz.defineMethod (c$, "unregisterWithKeyboardManager", 
520  function () {
521 var registered = this.getClientProperty ("_WhenInFocusedWindow");
522 if (registered != null && registered.size () > 0) {
523 var keys = registered.keys ();
524 while (keys.hasMoreElements ()) {
525 var ks = keys.nextElement ();
526 this.unregisterWithKeyboardManager (ks);
527 }
528 }this.putClientProperty ("_WhenInFocusedWindow", null);
529 });
530 Clazz.defineMethod (c$, "componentInputMapChanged", 
531 function (inputMap) {
532 var km = this.getInputMap (2, false);
533 while (km !== inputMap && km != null) {
534 km = km.getParent ();
535 }
536 if (km != null) {
537 this.registerWithKeyboardManager (false);
538 }}, "javax.swing.ComponentInputMap");
539 Clazz.defineMethod (c$, "registerWithKeyboardManager", 
540  function (aKeyStroke) {
541 javax.swing.KeyboardManager.getCurrentManager ().registerKeyStroke (aKeyStroke, this);
542 }, "javax.swing.KeyStroke");
543 Clazz.defineMethod (c$, "unregisterWithKeyboardManager", 
544  function (aKeyStroke) {
545 javax.swing.KeyboardManager.getCurrentManager ().unregisterKeyStroke (aKeyStroke, this);
546 }, "javax.swing.KeyStroke");
547 Clazz.defineMethod (c$, "registerKeyboardAction", 
548 function (anAction, aKeyStroke, aCondition) {
549 this.registerKeyboardAction (anAction, null, aKeyStroke, aCondition);
550 }, "java.awt.event.ActionListener,javax.swing.KeyStroke,~N");
551 Clazz.defineMethod (c$, "unregisterKeyboardAction", 
552 function (aKeyStroke) {
553 var am = this.getActionMap (false);
554 for (var counter = 0; counter < 3; counter++) {
555 var km = this.getInputMap (counter, false);
556 if (km != null) {
557 var actionID = km.get (aKeyStroke);
558 if (am != null && actionID != null) {
559 am.remove (actionID);
560 }km.remove (aKeyStroke);
561 }}
562 }, "javax.swing.KeyStroke");
563 Clazz.defineMethod (c$, "getRegisteredKeyStrokes", 
564 function () {
565 var counts =  Clazz.newIntArray (3, 0);
566 var strokes =  new Array (3);
567 for (var counter = 0; counter < 3; counter++) {
568 var km = this.getInputMap (counter, false);
569 strokes[counter] = (km != null) ? km.allKeys () : null;
570 counts[counter] = (strokes[counter] != null) ? strokes[counter].length : 0;
571 }
572 var retValue =  new Array (counts[0] + counts[1] + counts[2]);
573 for (var counter = 0, last = 0; counter < 3; counter++) {
574 if (counts[counter] > 0) {
575 System.arraycopy (strokes[counter], 0, retValue, last, counts[counter]);
576 last += counts[counter];
577 }}
578 return retValue;
579 });
580 Clazz.defineMethod (c$, "getConditionForKeyStroke", 
581 function (aKeyStroke) {
582 for (var counter = 0; counter < 3; counter++) {
583 var inputMap = this.getInputMap (counter, false);
584 if (inputMap != null && inputMap.get (aKeyStroke) != null) {
585 return counter;
586 }}
587 return -1;
588 }, "javax.swing.KeyStroke");
589 Clazz.defineMethod (c$, "getActionForKeyStroke", 
590 function (aKeyStroke) {
591 var am = this.getActionMap (false);
592 if (am == null) {
593 return null;
594 }for (var counter = 0; counter < 3; counter++) {
595 var inputMap = this.getInputMap (counter, false);
596 if (inputMap != null) {
597 var actionBinding = inputMap.get (aKeyStroke);
598 if (actionBinding != null) {
599 var action = am.get (actionBinding);
600 if (Clazz.instanceOf (action, javax.swing.JComponent.ActionStandin)) {
601 return (action).actionListener;
602 }return action;
603 }}}
604 return null;
605 }, "javax.swing.KeyStroke");
606 Clazz.defineMethod (c$, "resetKeyboardActions", 
607 function () {
608 for (var counter = 0; counter < 3; counter++) {
609 var inputMap = this.getInputMap (counter, false);
610 if (inputMap != null) {
611 inputMap.clear ();
612 }}
613 var am = this.getActionMap (false);
614 if (am != null) {
615 am.clear ();
616 }});
617 Clazz.defineMethod (c$, "setInputMap", 
618 function (condition, map) {
619 switch (condition) {
620 case 2:
621 if (map != null && !(Clazz.instanceOf (map, javax.swing.ComponentInputMap))) {
622 throw  new IllegalArgumentException ("WHEN_IN_FOCUSED_WINDOW InputMaps must be of type ComponentInputMap");
623 }this.windowInputMap = map;
624 this.setFlag (7, true);
625 this.registerWithKeyboardManager (false);
626 break;
627 case 1:
628 this.ancestorInputMap = map;
629 this.setFlag (6, true);
630 break;
631 case 0:
632 this.focusInputMap = map;
633 this.setFlag (5, true);
634 break;
635 default:
636 throw  new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
637 }
638 }, "~N,javax.swing.InputMap");
639 Clazz.defineMethod (c$, "getInputMap", 
640 function (condition) {
641 return this.getInputMap (condition, true);
642 }, "~N");
643 Clazz.defineMethod (c$, "getInputMap", 
644 function () {
645 return this.getInputMap (0, true);
646 });
647 Clazz.defineMethod (c$, "setActionMap", 
648 function (am) {
649 this.actionMap = am;
650 this.setFlag (8, true);
651 }, "javax.swing.ActionMap");
652 Clazz.defineMethod (c$, "getActionMap", 
653 function () {
654 return this.getActionMap (true);
655 });
656 Clazz.defineMethod (c$, "getInputMap", 
657 function (condition, create) {
658 switch (condition) {
659 case 0:
660 if (this.getFlag (5)) {
661 return this.focusInputMap;
662 }if (create) {
663 var km =  new javax.swing.InputMap ();
664 this.setInputMap (condition, km);
665 return km;
666 }break;
667 case 1:
668 if (this.getFlag (6)) {
669 return this.ancestorInputMap;
670 }if (create) {
671 var km =  new javax.swing.InputMap ();
672 this.setInputMap (condition, km);
673 return km;
674 }break;
675 case 2:
676 if (this.getFlag (7)) {
677 return this.windowInputMap;
678 }if (create) {
679 var km =  new javax.swing.ComponentInputMap (this);
680 this.setInputMap (condition, km);
681 return km;
682 }break;
683 default:
684 throw  new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
685 }
686 return null;
687 }, "~N,~B");
688 Clazz.defineMethod (c$, "getActionMap", 
689 function (create) {
690 {
691 (arguments.length == 0) && (create = true);
692 }if (this.getFlag (8)) {
693 return this.actionMap;
694 }if (create) {
695 var am =  new javax.swing.ActionMap ();
696 this.setActionMap (am);
697 return am;
698 }return null;
699 }, "~B");
700 Clazz.defineMethod (c$, "getBaseline", 
701 function (width, height) {
702 Clazz.superCall (this, javax.swing.JComponent, "getBaseline", [width, height]);
703 if (this.ui != null) {
704 return this.ui.getBaseline (this, width, height);
705 }return -1;
706 }, "~N,~N");
707 Clazz.overrideMethod (c$, "getBaselineResizeBehavior", 
708 function () {
709 if (this.ui != null) {
710 return this.ui.getBaselineResizeBehavior (this);
711 }return java.awt.Component.BaselineResizeBehavior.OTHER;
712 });
713 Clazz.defineMethod (c$, "requestDefaultFocus", 
714 function () {
715 var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor ();
716 if (nearestRoot == null) {
717 return false;
718 }return false;
719 });
720 Clazz.defineMethod (c$, "setVisible", 
721 function (aFlag) {
722 if (aFlag != this.isVisible ()) {
723 Clazz.superCall (this, javax.swing.JComponent, "setVisible", [aFlag]);
724 var parent = this.getParent ();
725 if (parent != null) {
726 var r = this.getBounds ();
727 parent.repaint (r.x, r.y, r.width, r.height);
728 }this.revalidate ();
729 }}, "~B");
730 Clazz.defineMethod (c$, "setEnabled", 
731 function (enabled) {
732 var oldEnabled = this.isEnabled ();
733 Clazz.superCall (this, javax.swing.JComponent, "setEnabled", [enabled]);
734 this.firePropertyChangeBool ("enabled", oldEnabled, enabled);
735 if (enabled != oldEnabled) {
736 this.repaint ();
737 }}, "~B");
738 Clazz.defineMethod (c$, "setForeground", 
739 function (fg) {
740 var oldFg = this.getForeground ();
741 Clazz.superCall (this, javax.swing.JComponent, "setForeground", [fg]);
742 if ((oldFg != null) ? !oldFg.equals (fg) : ((fg != null) && !fg.equals (oldFg))) {
743 this.repaint ();
744 }}, "java.awt.Color");
745 Clazz.defineMethod (c$, "setBackground", 
746 function (bg) {
747 var oldBg = this.getBackground ();
748 Clazz.superCall (this, javax.swing.JComponent, "setBackground", [bg]);
749 if ((oldBg != null) ? !oldBg.equals (bg) : ((bg != null) && !bg.equals (oldBg))) {
750 this.repaint ();
751 }}, "java.awt.Color");
752 Clazz.defineMethod (c$, "setFont", 
753 function (font) {
754 var oldFont = this.getFont ();
755 Clazz.superCall (this, javax.swing.JComponent, "setFont", [font]);
756 if (font !== oldFont) {
757 this.revalidate ();
758 this.repaint ();
759 }}, "java.awt.Font");
760 c$.getDefaultLocale = Clazz.defineMethod (c$, "getDefaultLocale", 
761 function () {
762 var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale");
763 if (l == null) {
764 l = java.util.Locale.getDefault ();
765 javax.swing.JComponent.setDefaultLocale (l);
766 }return l;
767 });
768 c$.setDefaultLocale = Clazz.defineMethod (c$, "setDefaultLocale", 
769 function (l) {
770 javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l);
771 }, "java.util.Locale");
772 Clazz.defineMethod (c$, "processComponentKeyEvent", 
773 function (e) {
774 }, "java.awt.event.KeyEvent");
775 Clazz.defineMethod (c$, "processKeyEvent", 
776 function (e) {
777 var shouldProcessKey;
778 Clazz.superCall (this, javax.swing.JComponent, "processKeyEvent", [e]);
779 if (!e.isConsumed ()) {
780 this.processComponentKeyEvent (e);
781 }shouldProcessKey = javax.swing.JComponent.KeyboardState.shouldProcess (e);
782 if (e.isConsumed ()) {
783 return;
784 }if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) {
785 e.consume ();
786 }}, "java.awt.event.KeyEvent");
787 Clazz.defineMethod (c$, "processKeyBinding", 
788 function (ks, e, condition, pressed) {
789 var map = this.getInputMap (condition, false);
790 var am = this.getActionMap (false);
791 if (map != null && am != null && this.isEnabled ()) {
792 var binding = map.get (ks);
793 var action = (binding == null) ? null : am.get (binding);
794 if (action != null) {
795 return javax.swing.SwingUtilities.notifyAction (action, ks, e, this, e.getModifiers ());
796 }}return false;
797 }, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B");
798 Clazz.defineMethod (c$, "processKeyBindings", 
799 function (e, pressed) {
800 if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (e)) {
801 return false;
802 }var ks;
803 if (e.getID () == 400) {
804 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ());
805 } else {
806 ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true));
807 }if (this.processKeyBinding (ks, e, 0, pressed)) return true;
808 var parent = this;
809 while (parent != null && !(Clazz.instanceOf (parent, java.awt.Window)) && !(Clazz.instanceOf (parent, java.applet.Applet))) {
810 if (Clazz.instanceOf (parent, javax.swing.JComponent)) {
811 if ((parent).processKeyBinding (ks, e, 1, pressed)) return true;
812 }parent = parent.getParent ();
813 }
814 if (parent != null) {
815 return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed);
816 }return false;
817 }, "java.awt.event.KeyEvent,~B");
818 c$.processKeyBindingsForAllComponents = Clazz.defineMethod (c$, "processKeyBindingsForAllComponents", 
819 function (e, container, pressed) {
820 while (true) {
821 if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) {
822 return true;
823 }if (Clazz.instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) {
824 container = (container).getOwner ();
825 } else {
826 return false;
827 }}
828 }, "java.awt.event.KeyEvent,java.awt.Container,~B");
829 Clazz.defineMethod (c$, "setToolTipText", 
830 function (text) {
831 this.putClientProperty ("ToolTipText", text);
832 }, "~S");
833 Clazz.defineMethod (c$, "getToolTipText", 
834 function () {
835 return this.getClientProperty ("ToolTipText");
836 });
837 Clazz.defineMethod (c$, "getToolTipText", 
838 function (event) {
839 return this.getToolTipText ();
840 }, "java.awt.event.MouseEvent");
841 Clazz.defineMethod (c$, "getToolTipLocation", 
842 function (event) {
843 return null;
844 }, "java.awt.event.MouseEvent");
845 Clazz.defineMethod (c$, "getPopupLocation", 
846 function (event) {
847 return null;
848 }, "java.awt.event.MouseEvent");
849 Clazz.defineMethod (c$, "createToolTip", 
850 function () {
851 var tip =  new javax.swing.JToolTip ();
852 tip.setComponent (this);
853 return tip;
854 });
855 Clazz.defineMethod (c$, "scrollRectToVisible", 
856 function (aRect) {
857 var parent;
858 var dx = this.getX ();
859 var dy = this.getY ();
860 for (parent = this.getParent (); !(parent == null) && !(Clazz.instanceOf (parent, javax.swing.JComponent)) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane)); parent = parent.getParent ()) {
861 var bounds = parent.getBounds ();
862 dx += bounds.x;
863 dy += bounds.y;
864 }
865 if (!(parent == null) && !(Clazz.instanceOf (parent, javax.swing.CellRendererPane))) {
866 aRect.x += dx;
867 aRect.y += dy;
868 (parent).scrollRectToVisible (aRect);
869 aRect.x -= dx;
870 aRect.y -= dy;
871 }}, "java.awt.Rectangle");
872 Clazz.defineMethod (c$, "setAutoscrolls", 
873 function (autoscrolls) {
874 }, "~B");
875 Clazz.defineMethod (c$, "getAutoscrolls", 
876 function () {
877 return this.autoscrolls;
878 });
879 Clazz.defineMethod (c$, "superProcessMouseMotionEvent", 
880 function (e) {
881 Clazz.superCall (this, javax.swing.JComponent, "processMouseMotionEvent", [e]);
882 }, "java.awt.event.MouseEvent");
883 Clazz.defineMethod (c$, "setCreatedDoubleBuffer", 
884 function (newValue) {
885 this.setFlag (9, newValue);
886 }, "~B");
887 Clazz.defineMethod (c$, "getCreatedDoubleBuffer", 
888 function () {
889 return this.getFlag (9);
890 });
891 Clazz.defineMethod (c$, "getClientProperties", 
892  function () {
893 if (this.clientProperties == null) {
894 this.clientProperties =  new javax.swing.ArrayTable ();
895 }return this.clientProperties;
896 });
897 Clazz.defineMethod (c$, "getClientProperty", 
898 function (key) {
899 if (this.clientProperties == null) {
900 return null;
901 } else {
902 {
903 return this.clientProperties.get (key);
904 }}}, "~O");
905 Clazz.defineMethod (c$, "putClientProperty", 
906 function (key, value) {
907 if (value == null && this.clientProperties == null) {
908 return;
909 }var clientProperties = this.getClientProperties ();
910 var oldValue;
911 {
912 oldValue = clientProperties.get (key);
913 if (value != null) {
914 clientProperties.put (key, value);
915 } else if (oldValue != null) {
916 clientProperties.remove (key);
917 } else {
918 return;
919 }}this.clientPropertyChanged (key, oldValue, value);
920 this.firePropertyChangeObject (key.toString (), oldValue, value);
921 }, "~O,~O");
922 Clazz.defineMethod (c$, "clientPropertyChanged", 
923 function (key, oldValue, newValue) {
924 }, "~O,~O,~O");
925 Clazz.defineMethod (c$, "setUIProperty", 
926 function (propertyName, value) {
927 if (propertyName === "opaque") {
928 if (!this.getFlag (24)) {
929 this.setOpaque ((value).booleanValue ());
930 this.setFlag (24, false);
931 }} else if (propertyName === "autoscrolls") {
932 if (!this.getFlag (25)) {
933 this.setAutoscrolls ((value).booleanValue ());
934 this.setFlag (25, false);
935 }} else if (propertyName === "focusTraversalKeysForward") {
936 } else if (propertyName === "focusTraversalKeysBackward") {
937 } else {
938 System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5));
939 }}, "~S,~O");
940 c$.isLightweightComponent = Clazz.defineMethod (c$, "isLightweightComponent", 
941 function (c) {
942 return !(Clazz.instanceOf (c, javax.swing.JApplet) || Clazz.instanceOf (c, javax.swing.JFrame) || Clazz.instanceOf (c, javax.swing.JWindow) || Clazz.instanceOf (c, javax.swing.JDialog));
943 }, "java.awt.Component");
944 Clazz.overrideMethod (c$, "isOpaque", 
945 function () {
946 return this.getFlag (3);
947 });
948 Clazz.defineMethod (c$, "setOpaque", 
949 function (isOpaque) {
950 var oldValue = this.getFlag (3);
951 this.setFlag (3, isOpaque);
952 this.setFlag (24, true);
953 this.firePropertyChangeBool ("opaque", oldValue, isOpaque);
954 }, "~B");
955 Clazz.defineMethod (c$, "rectangleIsObscured", 
956 function (x, y, width, height) {
957 var numChildren = this.getComponentCount ();
958 for (var i = 0; i < numChildren; i++) {
959 var child = this.getComponent (i);
960 var cx;
961 var cy;
962 var cw;
963 var ch;
964 cx = child.getX ();
965 cy = child.getY ();
966 cw = child.getWidth ();
967 ch = child.getHeight ();
968 if (x >= cx && (x + width) <= (cx + cw) && y >= cy && (y + height) <= (cy + ch) && child.isVisible ()) {
969 if (Clazz.instanceOf (child, javax.swing.JComponent)) {
970 return (child).isOpaque ();
971 } else {
972 return false;
973 }}}
974 return false;
975 }, "~N,~N,~N,~N");
976 c$.computeVisibleRect = Clazz.defineMethod (c$, "computeVisibleRect", 
977 function (c, visibleRect) {
978 var p = c.getParent ();
979 var bounds = c.getBounds ();
980 if (p == null || Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
981 visibleRect.reshape (0, 0, bounds.width, bounds.height);
982 } else {
983 javax.swing.JComponent.computeVisibleRect (p, visibleRect);
984 visibleRect.x -= bounds.x;
985 visibleRect.y -= bounds.y;
986 javax.swing.SwingUtilities.computeIntersection (0, 0, bounds.width, bounds.height, visibleRect);
987 }}, "java.awt.Component,java.awt.Rectangle");
988 Clazz.defineMethod (c$, "computeVisibleRect", 
989 function (visibleRect) {
990 javax.swing.JComponent.computeVisibleRect (this, visibleRect);
991 }, "java.awt.Rectangle");
992 Clazz.defineMethod (c$, "getVisibleRect", 
993 function () {
994 var visibleRect =  new java.awt.Rectangle ();
995 this.computeVisibleRect (visibleRect);
996 return visibleRect;
997 });
998 Clazz.defineMethod (c$, "getTopLevelAncestor", 
999 function () {
1000 for (var p = this; p != null; p = p.getParent ()) {
1001 if (Clazz.instanceOf (p, java.awt.Window) || Clazz.instanceOf (p, java.applet.Applet)) {
1002 return p;
1003 }}
1004 return null;
1005 });
1006 Clazz.defineMethod (c$, "getAncestorNotifier", 
1007  function () {
1008 return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER);
1009 });
1010 Clazz.defineMethod (c$, "addAncestorListener", 
1011 function (listener) {
1012 var ancestorNotifier = this.getAncestorNotifier ();
1013 if (ancestorNotifier == null) {
1014 ancestorNotifier =  new javax.swing.AncestorNotifier (this);
1015 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, ancestorNotifier);
1016 }ancestorNotifier.addAncestorListener (listener);
1017 }, "javax.swing.event.AncestorListener");
1018 Clazz.defineMethod (c$, "removeAncestorListener", 
1019 function (listener) {
1020 var ancestorNotifier = this.getAncestorNotifier ();
1021 if (ancestorNotifier == null) {
1022 return;
1023 }ancestorNotifier.removeAncestorListener (listener);
1024 if (ancestorNotifier.listenerList.getListenerList ().length == 0) {
1025 ancestorNotifier.removeAllListeners ();
1026 this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, null);
1027 }}, "javax.swing.event.AncestorListener");
1028 Clazz.defineMethod (c$, "getAncestorListeners", 
1029 function () {
1030 var ancestorNotifier = this.getAncestorNotifier ();
1031 if (ancestorNotifier == null) {
1032 return  new Array (0);
1033 }return ancestorNotifier.getAncestorListeners ();
1034 });
1035 Clazz.defineMethod (c$, "getListeners", 
1036 function (listenerType) {
1037 var result;
1038 if (listenerType === javax.swing.event.AncestorListener) {
1039 result = this.getAncestorListeners ();
1040 } else if (listenerType === java.beans.PropertyChangeListener) {
1041 result = this.getPropertyChangeListeners ();
1042 } else {
1043 result = this.listenerList.getListeners (listenerType);
1044 }if (result.length == 0) {
1045 return Clazz.superCall (this, javax.swing.JComponent, "getListeners", [listenerType]);
1046 }return result;
1047 }, "Class");
1048 Clazz.defineMethod (c$, "addNotify", 
1049 function () {
1050 Clazz.superCall (this, javax.swing.JComponent, "addNotify", []);
1051 this.firePropertyChangeObject ("ancestor", null, this.getParent ());
1052 this.registerWithKeyboardManager (false);
1053 this.registerNextFocusableComponent ();
1054 });
1055 Clazz.defineMethod (c$, "removeNotify", 
1056 function () {
1057 Clazz.superCall (this, javax.swing.JComponent, "removeNotify", []);
1058 this.firePropertyChangeObject ("ancestor", this.getParent (), null);
1059 this.unregisterWithKeyboardManager ();
1060 this.deregisterNextFocusableComponent ();
1061 if (this.getCreatedDoubleBuffer ()) {
1062 javax.swing.RepaintManager.currentManager (this).resetDoubleBuffer ();
1063 this.setCreatedDoubleBuffer (false);
1064 }});
1065 Clazz.defineMethod (c$, "repaint", 
1066 function (tm, x, y, width, height) {
1067 javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height);
1068 }, "~N,~N,~N,~N,~N");
1069 Clazz.defineMethod (c$, "repaint", 
1070 function (r) {
1071 this.repaint (0, r.x, r.y, r.width, r.height);
1072 }, "java.awt.Rectangle");
1073 Clazz.defineMethod (c$, "revalidate", 
1074 function () {
1075 if (this.getParent () == null) {
1076 return;
1077 }if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
1078 this.invalidate ();
1079 javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this);
1080 } else {
1081 {
1082 if (this.getFlag (28)) {
1083 return;
1084 }this.setFlag (28, true);
1085 }var callRevalidate = ((Clazz.isClassDefined ("javax.swing.JComponent$2") ? 0 : javax.swing.JComponent.$JComponent$2$ ()), Clazz.innerTypeInstance (javax.swing.JComponent$2, this, null));
1086 javax.swing.SwingUtilities.invokeLater (callRevalidate);
1087 }});
1088 Clazz.defineMethod (c$, "isValidateRoot", 
1089 function () {
1090 return false;
1091 });
1092 Clazz.defineMethod (c$, "isOptimizedDrawingEnabled", 
1093 function () {
1094 return true;
1095 });
1096 Clazz.defineMethod (c$, "isPaintingOrigin", 
1097 function () {
1098 return false;
1099 });
1100 Clazz.defineMethod (c$, "paintImmediately", 
1101 function (x, y, w, h) {
1102 {
1103 if (arguments.length == 1) {
1104 var r = x;
1105 x = r.x;
1106 y = r.y;
1107 w = r.width;
1108 h = r.height;
1109 }
1110 }var c = this;
1111 var parent;
1112 if (!this.isShowing ()) {
1113 return;
1114 }while (!(c).isOpaque ()) {
1115 parent = c.getParent ();
1116 if (parent != null) {
1117 x += c.getX ();
1118 y += c.getY ();
1119 c = parent;
1120 } else {
1121 break;
1122 }if (!(Clazz.instanceOf (c, javax.swing.JComponent))) {
1123 break;
1124 }}
1125 if (Clazz.instanceOf (c, javax.swing.JComponent)) {
1126 (c)._paintImmediately (x, y, w, h);
1127 } else {
1128 c.repaint (x, y, w, h);
1129 }}, "~N,~N,~N,~N");
1130 Clazz.defineMethod (c$, "paintImmediately", 
1131 function (r) {
1132 this.paintImmediately (r.x, r.y, r.width, r.height);
1133 }, "java.awt.Rectangle");
1134 Clazz.defineMethod (c$, "alwaysOnTop", 
1135 function () {
1136 return false;
1137 });
1138 Clazz.defineMethod (c$, "setPaintingChild", 
1139 function (paintingChild) {
1140 this.paintingChild = paintingChild;
1141 }, "java.awt.Component");
1142 Clazz.defineMethod (c$, "_paintImmediately", 
1143 function (x, y, w, h) {
1144 var g;
1145 var c;
1146 var tmpX;
1147 var tmpY;
1148 var tmpWidth;
1149 var tmpHeight;
1150 var offsetX = 0;
1151 var offsetY = 0;
1152 var hasBuffer = false;
1153 var bufferedComponent = null;
1154 var paintingComponent = this;
1155 var path =  new java.util.ArrayList (7);
1156 var pIndex = -1;
1157 var pCount = 0;
1158 tmpX = tmpY = tmpWidth = tmpHeight = 0;
1159 var paintImmediatelyClip = javax.swing.JComponent.fetchRectangle ();
1160 paintImmediatelyClip.x = x;
1161 paintImmediatelyClip.y = y;
1162 paintImmediatelyClip.width = w;
1163 paintImmediatelyClip.height = h;
1164 var ontop = this.alwaysOnTop () && this.isOpaque ();
1165 if (ontop) {
1166 javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip);
1167 if (paintImmediatelyClip.width == 0) {
1168 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1169 return;
1170 }}var child;
1171 for (c = this, child = null; c != null && !(Clazz.instanceOf (c, java.awt.Window)) && !(Clazz.instanceOf (c, java.applet.Applet)); child = c, c = c.getParent ()) {
1172 var jc = (Clazz.instanceOf (c, javax.swing.JComponent)) ? c : null;
1173 path.add (c);
1174 if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) {
1175 var resetPC;
1176 if (c !== this) {
1177 if (jc.isPaintingOrigin ()) {
1178 resetPC = true;
1179 } else {
1180 var children = c.getComponents ();
1181 var i = 0;
1182 for (; i < children.length; i++) {
1183 if (children[i] === child) break;
1184 }
1185 switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) {
1186 case 0:
1187 resetPC = false;
1188 break;
1189 case 2:
1190 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1191 return;
1192 default:
1193 resetPC = true;
1194 break;
1195 }
1196 }} else {
1197 resetPC = false;
1198 }if (resetPC) {
1199 paintingComponent = jc;
1200 pIndex = pCount;
1201 offsetX = offsetY = 0;
1202 hasBuffer = false;
1203 }}pCount++;
1204 if (!ontop) {
1205 var bx = c.getX ();
1206 var by = c.getY ();
1207 tmpWidth = c.getWidth ();
1208 tmpHeight = c.getHeight ();
1209 javax.swing.SwingUtilities.computeIntersection (tmpX, tmpY, tmpWidth, tmpHeight, paintImmediatelyClip);
1210 paintImmediatelyClip.x += bx;
1211 paintImmediatelyClip.y += by;
1212 offsetX += bx;
1213 offsetY += by;
1214 }}
1215 if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) {
1216 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1217 return;
1218 }paintingComponent.setFlag (13, true);
1219 paintImmediatelyClip.x -= offsetX;
1220 paintImmediatelyClip.y -= offsetY;
1221 if (paintingComponent !== this) {
1222 var comp;
1223 var i = pIndex;
1224 for (; i > 0; i--) {
1225 comp = path.get (i);
1226 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
1227 (comp).setPaintingChild (path.get (i - 1));
1228 }}
1229 }try {
1230 g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS ();
1231 try {
1232 if (hasBuffer) {
1233 var rm = javax.swing.RepaintManager.currentManager (bufferedComponent);
1234 rm.beginPaint ();
1235 try {
1236 rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height);
1237 } finally {
1238 rm.endPaint ();
1239 }
1240 } else {
1241 paintingComponent.paint (g);
1242 }} finally {
1243 g.dispose ();
1244 }
1245 } finally {
1246 if (paintingComponent !== this) {
1247 var comp;
1248 var i = pIndex;
1249 for (; i > 0; i--) {
1250 comp = path.get (i);
1251 if (Clazz.instanceOf (comp, javax.swing.JComponent)) {
1252 (comp).setPaintingChild (null);
1253 }}
1254 }paintingComponent.setFlag (13, false);
1255 }
1256 javax.swing.JComponent.recycleRectangle (paintImmediatelyClip);
1257 }, "~N,~N,~N,~N");
1258 Clazz.defineMethod (c$, "paintToOffscreen", 
1259 function (g, x, y, w, h, maxX, maxY) {
1260 try {
1261 this.setFlag (1, true);
1262 if ((y + h) < maxY || (x + w) < maxX) {
1263 this.setFlag (2, true);
1264 }if (this.getFlag (13)) {
1265 this.paint (g);
1266 } else {
1267 if (!this.rectangleIsObscured (x, y, w, h)) {
1268 this.paintComponent (g);
1269 this.paintBorder (g);
1270 }this.paintChildren (g);
1271 }} finally {
1272 this.setFlag (1, false);
1273 this.setFlag (2, false);
1274 }
1275 }, "java.awt.Graphics,~N,~N,~N,~N,~N,~N");
1276 Clazz.defineMethod (c$, "getObscuredState", 
1277  function (compIndex, x, y, width, height) {
1278 var retValue = 0;
1279 var tmpRect = javax.swing.JComponent.fetchRectangle ();
1280 for (var i = compIndex - 1; i >= 0; i--) {
1281 var sibling = this.getComponent (i);
1282 if (!sibling.isVisible ()) {
1283 continue;
1284 }var siblingRect;
1285 var opaque;
1286 if (Clazz.instanceOf (sibling, javax.swing.JComponent)) {
1287 opaque = (sibling).isOpaque ();
1288 if (!opaque) {
1289 if (retValue == 1) {
1290 continue;
1291 }}} else {
1292 opaque = true;
1293 }siblingRect = sibling.getBounds (tmpRect);
1294 if (opaque && x >= siblingRect.x && (x + width) <= (siblingRect.x + siblingRect.width) && y >= siblingRect.y && (y + height) <= (siblingRect.y + siblingRect.height)) {
1295 javax.swing.JComponent.recycleRectangle (tmpRect);
1296 return 2;
1297 } else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) {
1298 retValue = 1;
1299 }}
1300 javax.swing.JComponent.recycleRectangle (tmpRect);
1301 return retValue;
1302 }, "~N,~N,~N,~N,~N");
1303 Clazz.defineMethod (c$, "checkIfChildObscuredBySibling", 
1304 function () {
1305 return true;
1306 });
1307 Clazz.defineMethod (c$, "setFlag", 
1308  function (aFlag, aValue) {
1309 if (aValue) {
1310 this.flags |= (1 << aFlag);
1311 } else {
1312 this.flags &= ~(1 << aFlag);
1313 }}, "~N,~B");
1314 Clazz.defineMethod (c$, "getFlag", 
1315  function (aFlag) {
1316 var mask = (1 << aFlag);
1317 return ((this.flags & mask) == mask);
1318 }, "~N");
1319 Clazz.defineMethod (c$, "setDoubleBuffered", 
1320 function (aFlag) {
1321 }, "~B");
1322 Clazz.overrideMethod (c$, "isDoubleBuffered", 
1323 function () {
1324 return this.getFlag (0);
1325 });
1326 Clazz.defineMethod (c$, "getRootPane", 
1327 function () {
1328 return javax.swing.SwingUtilities.getRootPane (this);
1329 });
1330 Clazz.defineMethod (c$, "paramString", 
1331 function () {
1332 var preferredSizeString = (this.isPreferredSizeSet () ? this.getPreferredSize ().toString () : "");
1333 var minimumSizeString = (this.isMinimumSizeSet () ? this.getMinimumSize ().toString () : "");
1334 var maximumSizeString = (this.isMaximumSizeSet () ? this.getMaximumSize ().toString () : "");
1335 var borderString = (this.border == null ? "" : (this.border === this ? "this" : this.border.toString ()));
1336 return Clazz.superCall (this, javax.swing.JComponent, "paramString", []) + ",alignmentX=" + this.alignmentX + ",alignmentY=" + this.alignmentY + ",border=" + borderString + ",flags=" + this.flags + ",maximumSize=" + maximumSizeString + ",minimumSize=" + minimumSizeString + ",preferredSize=" + preferredSizeString;
1337 });
1338 c$.$JComponent$ActionStandin$ = function () {
1339 Clazz.pu$h(self.c$);
1340 c$ = Clazz.decorateAsClass (function () {
1341 Clazz.prepareCallback (this, arguments);
1342 this.actionListener = null;
1343 this.command = null;
1344 this.action = null;
1345 Clazz.instantialize (this, arguments);
1346 }, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action);
1347 Clazz.makeConstructor (c$, 
1348 function (a, b) {
1349 this.actionListener = a;
1350 if (Clazz.instanceOf (a, javax.swing.Action)) {
1351 this.action = a;
1352 } else {
1353 this.action = null;
1354 }this.command = b;
1355 }, "java.awt.event.ActionListener,~S");
1356 Clazz.defineMethod (c$, "getValue", 
1357 function (a) {
1358 if (a != null) {
1359 if (a.equals ("ActionCommandKey")) {
1360 return this.command;
1361 }if (this.action != null) {
1362 return this.action.getValue (a);
1363 }if (a.equals ("Name")) {
1364 return "ActionStandin";
1365 }}return null;
1366 }, "~S");
1367 Clazz.defineMethod (c$, "isEnabled", 
1368 function () {
1369 if (this.actionListener == null) {
1370 return false;
1371 }if (this.action == null) {
1372 return true;
1373 }return this.action.isEnabled ();
1374 });
1375 Clazz.defineMethod (c$, "actionPerformed", 
1376 function (a) {
1377 if (this.actionListener != null) {
1378 this.actionListener.actionPerformed (a);
1379 }}, "java.awt.event.ActionEvent");
1380 Clazz.overrideMethod (c$, "putValue", 
1381 function (a, b) {
1382 }, "~S,~O");
1383 Clazz.overrideMethod (c$, "setEnabled", 
1384 function (a) {
1385 }, "~B");
1386 Clazz.overrideMethod (c$, "addPropertyChangeListener", 
1387 function (a) {
1388 }, "java.beans.PropertyChangeListener");
1389 Clazz.overrideMethod (c$, "removePropertyChangeListener", 
1390 function (a) {
1391 }, "java.beans.PropertyChangeListener");
1392 c$ = Clazz.p0p ();
1393 };
1394 c$.$JComponent$2$ = function () {
1395 Clazz.pu$h(self.c$);
1396 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$2", null, Runnable);
1397 Clazz.overrideMethod (c$, "run", 
1398 function () {
1399 {
1400 this.b$["javax.swing.JComponent"].setFlag (28, false);
1401 }this.b$["javax.swing.JComponent"].revalidate ();
1402 });
1403 c$ = Clazz.p0p ();
1404 };
1405 c$.$JComponent$1$ = function () {
1406 Clazz.pu$h(self.c$);
1407 c$ = Clazz.declareAnonymous (javax.swing, "JComponent$1", null, jssun.awt.RequestFocusController);
1408 Clazz.overrideMethod (c$, "acceptRequestFocus", 
1409 function (from, to, temporary, focusedWindowChangeAllowed, cause) {
1410 if ((to == null) || !(Clazz.instanceOf (to, javax.swing.JComponent))) {
1411 return true;
1412 }if ((from == null) || !(Clazz.instanceOf (from, javax.swing.JComponent))) {
1413 return true;
1414 }var target = to;
1415 if (!target.getVerifyInputWhenFocusTarget ()) {
1416 return true;
1417 }var jFocusOwner = from;
1418 var iv = jFocusOwner.getInputVerifier ();
1419 if (iv == null) {
1420 return true;
1421 } else {
1422 var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1423 if (currentSource === jFocusOwner) {
1424 return true;
1425 }javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner);
1426 try {
1427 return iv.shouldYieldFocus (jFocusOwner);
1428 } finally {
1429 if (currentSource != null) {
1430 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource);
1431 } else {
1432 javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY);
1433 }}
1434 }}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause");
1435 c$ = Clazz.p0p ();
1436 };
1437 Clazz.pu$h(self.c$);
1438 c$ = Clazz.decorateAsClass (function () {
1439 this.array = null;
1440 this.count = 0;
1441 this.capacity = 0;
1442 Clazz.instantialize (this, arguments);
1443 }, javax.swing.JComponent, "IntVector");
1444 Clazz.defineMethod (c$, "size", 
1445 function () {
1446 return this.count;
1447 });
1448 Clazz.defineMethod (c$, "elementAt", 
1449 function (a) {
1450 return this.array[a];
1451 }, "~N");
1452 Clazz.defineMethod (c$, "addElement", 
1453 function (a) {
1454 if (this.count == this.capacity) {
1455 this.capacity = (this.capacity + 2) * 2;
1456 var b =  Clazz.newIntArray (this.capacity, 0);
1457 if (this.count > 0) {
1458 System.arraycopy (this.array, 0, b, 0, this.count);
1459 }this.array = b;
1460 }this.array[this.count++] = a;
1461 }, "~N");
1462 Clazz.defineMethod (c$, "setElementAt", 
1463 function (a, b) {
1464 this.array[b] = a;
1465 }, "~N,~N");
1466 c$ = Clazz.p0p ();
1467 Clazz.pu$h(self.c$);
1468 c$ = Clazz.declareType (javax.swing.JComponent, "KeyboardState");
1469 c$.getKeyCodeArray = Clazz.defineMethod (c$, "getKeyCodeArray", 
1470 function () {
1471 var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey);
1472 if (a == null) {
1473 a =  new javax.swing.JComponent.IntVector ();
1474 javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a);
1475 }return a;
1476 });
1477 c$.registerKeyPressed = Clazz.defineMethod (c$, "registerKeyPressed", 
1478 function (a) {
1479 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1480 var c = b.size ();
1481 var d;
1482 for (d = 0; d < c; d++) {
1483 if (b.elementAt (d) == -1) {
1484 b.setElementAt (a, d);
1485 return;
1486 }}
1487 b.addElement (a);
1488 }, "~N");
1489 c$.registerKeyReleased = Clazz.defineMethod (c$, "registerKeyReleased", 
1490 function (a) {
1491 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1492 var c = b.size ();
1493 var d;
1494 for (d = 0; d < c; d++) {
1495 if (b.elementAt (d) == a) {
1496 b.setElementAt (-1, d);
1497 return;
1498 }}
1499 }, "~N");
1500 c$.keyIsPressed = Clazz.defineMethod (c$, "keyIsPressed", 
1501 function (a) {
1502 var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray ();
1503 var c = b.size ();
1504 var d;
1505 for (d = 0; d < c; d++) {
1506 if (b.elementAt (d) == a) {
1507 return true;
1508 }}
1509 return false;
1510 }, "~N");
1511 c$.shouldProcess = Clazz.defineMethod (c$, "shouldProcess", 
1512 function (a) {
1513 switch (a.getID ()) {
1514 case 401:
1515 if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) {
1516 javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ());
1517 }return true;
1518 case 402:
1519 if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) {
1520 javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ());
1521 return true;
1522 }return false;
1523 case 400:
1524 return true;
1525 default:
1526 return false;
1527 }
1528 }, "java.awt.event.KeyEvent");
1529 c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState;
1530 c$ = Clazz.p0p ();
1531 Clazz.defineStatics (c$,
1532 "uiClassID", "ComponentUI",
1533 "managingFocusForwardTraversalKeys", null,
1534 "managingFocusBackwardTraversalKeys", null,
1535 "NOT_OBSCURED", 0,
1536 "PARTIALLY_OBSCURED", 1,
1537 "COMPLETELY_OBSCURED", 2,
1538 "DEBUG_GRAPHICS_LOADED", false);
1539 c$.INPUT_VERIFIER_SOURCE_KEY = c$.prototype.INPUT_VERIFIER_SOURCE_KEY =  new Clazz._O ();
1540 Clazz.defineStatics (c$,
1541 "WHEN_FOCUSED", 0,
1542 "WHEN_ANCESTOR_OF_FOCUSED_COMPONENT", 1,
1543 "WHEN_IN_FOCUSED_WINDOW", 2,
1544 "UNDEFINED_CONDITION", -1,
1545 "WHEN_IN_FOCUSED_WINDOW_BINDINGS", "_WhenInFocusedWindow",
1546 "TOOL_TIP_TEXT_KEY", "ToolTipText",
1547 "NEXT_FOCUS", "nextFocus",
1548 "IS_DOUBLE_BUFFERED", 0,
1549 "ANCESTOR_USING_BUFFER", 1,
1550 "IS_PAINTING_TILE", 2,
1551 "IS_OPAQUE", 3,
1552 "FOCUS_INPUTMAP_CREATED", 5,
1553 "ANCESTOR_INPUTMAP_CREATED", 6,
1554 "WIF_INPUTMAP_CREATED", 7,
1555 "ACTIONMAP_CREATED", 8,
1556 "CREATED_DOUBLE_BUFFER", 9,
1557 "IS_PRINTING", 11,
1558 "IS_PRINTING_ALL", 12,
1559 "IS_REPAINTING", 13,
1560 "REQUEST_FOCUS_DISABLED", 22,
1561 "INHERITS_POPUP_MENU", 23,
1562 "OPAQUE_SET", 24,
1563 "AUTOSCROLLS_SET", 25,
1564 "REVALIDATE_RUNNABLE_SCHEDULED", 28);
1565 c$.tempRectangles = c$.prototype.tempRectangles =  new java.util.ArrayList (11);
1566 Clazz.defineStatics (c$,
1567 "defaultLocale", "JComponent.defaultLocale",
1568 "componentObtainingGraphicsFrom", null);
1569 c$.componentObtainingGraphicsFromLock = c$.prototype.componentObtainingGraphicsFromLock =  new Clazz._O ();
1570 c$.focusController = c$.prototype.focusController = ((Clazz.isClassDefined ("javax.swing.JComponent$1") ? 0 : javax.swing.JComponent.$JComponent$1$ ()), Clazz.innerTypeInstance (javax.swing.JComponent$1, this, null));
1571 });