1 Clazz.declarePackage ("java.awt");
2 Clazz.load (["java.lang.Enum", "java.awt.image.ImageObserver", "java.util.HashMap", "java.awt.ComponentOrientation"], "java.awt.Component", ["java.lang.Boolean", "$.Character", "$.Double", "$.Float", "$.IllegalArgumentException", "$.Long", "$.NullPointerException", "$.Short", "$.Thread", "java.awt.AWTEventMulticaster", "$.Cursor", "$.Dimension", "$.EventQueue", "$.IllegalComponentStateException", "$.Point", "$.Rectangle", "$.Toolkit", "java.awt.event.ComponentEvent", "$.ComponentListener", "$.FocusEvent", "$.FocusListener", "$.HierarchyBoundsListener", "$.HierarchyEvent", "$.HierarchyListener", "$.InputEvent", "$.InputMethodEvent", "$.InputMethodListener", "$.KeyEvent", "$.KeyListener", "$.MouseEvent", "$.MouseListener", "$.MouseMotionListener", "$.MouseWheelEvent", "$.MouseWheelListener", "$.PaintEvent", "java.awt.peer.LightweightPeer", "java.beans.PropertyChangeListener", "$.PropertyChangeSupport", "jssun.awt.AppContext", "$.SunToolkit", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.threadGroup = null;
8 this.appContext = null;
13 this.foreground = null;
14 this.background = null;
24 this.nameExplicitlySet = false;
25 this.focusable = true;
26 this.$isFocusTraversableOverridden = 0;
27 this.focusTraversalKeysEnabled = false;
29 this.minSizeSet = false;
31 this.prefSizeSet = false;
33 this.maxSizeSet = false;
34 this.componentOrientation = null;
35 this.newEventsOnly = false;
36 this.componentListener = null;
37 this.focusListener = null;
38 this.hierarchyListener = null;
39 this.hierarchyBoundsListener = null;
40 this.keyListener = null;
41 this.mouseListener = null;
42 this.mouseMotionListener = null;
43 this.mouseWheelListener = null;
44 this.inputMethodListener = null;
45 this.windowClosingException = null;
46 this.eventMask = 4096;
47 this.changeSupport = null;
48 this.changeSupportLock = null;
49 this.isPacked = false;
51 this.isAddNotifyComplete = false;
52 this.backgroundEraseDisabled = false;
55 this.graphicsConfig = null;
56 this.eventCache = null;
57 this.coalescingEnabled = false;
58 this.autoFocusTransferOnDisposal = true;
59 Clazz.instantialize (this, arguments);
60 }, java.awt, "Component", null, java.awt.image.ImageObserver);
61 Clazz.prepareFields (c$, function () {
62 this.componentOrientation = java.awt.ComponentOrientation.UNKNOWN;
63 this.changeSupportLock = new Clazz._O ();
64 this.coalescingEnabled = this.checkCoalescing ();
66 Clazz.defineMethod (c$, "getAppContext",
68 return this.appContext;
70 Clazz.defineMethod (c$, "getChangeSupportLock",
72 return this.changeSupportLock;
74 Clazz.defineMethod (c$, "getBoundsOp",
78 Clazz.defineMethod (c$, "setBoundsOp",
82 } else if (this.boundsOp == 3) {
85 Clazz.makeConstructor (c$,
87 this.setAppContext ();
89 Clazz.defineMethod (c$, "setAppContext",
91 this.appContext = jssun.awt.AppContext.getAppContext ();
92 this.num = ++java.awt.Component.incr;
94 Clazz.defineMethod (c$, "getHTMLName",
96 return (this.htmlName == null ? this.htmlName = this.appContext.getThreadGroup ().getName () + "_" + uid + "_" + this.num : this.htmlName);
98 Clazz.defineMethod (c$, "constructComponentName",
102 Clazz.defineMethod (c$, "getName",
104 if (this.name == null && !this.nameExplicitlySet) {
106 if (this.name == null && !this.nameExplicitlySet) this.name = this.constructComponentName ();
109 Clazz.defineMethod (c$, "setName",
115 this.nameExplicitlySet = true;
116 }this.firePropertyChangeObject ("name", oldName, name);
118 Clazz.defineMethod (c$, "getParent",
120 return this.getParent_NoClientCode ();
122 Clazz.defineMethod (c$, "getParent_NoClientCode",
126 Clazz.defineMethod (c$, "getContainer",
128 return this.getParent ();
130 Clazz.defineMethod (c$, "getPeer",
134 Clazz.defineMethod (c$, "getGraphicsConfiguration",
136 return swingjs.JSToolkit.getGraphicsConfiguration ();
138 Clazz.defineMethod (c$, "resetGC",
141 Clazz.defineMethod (c$, "getToolkit",
143 return this.getToolkitImpl ();
145 Clazz.defineMethod (c$, "getToolkitImpl",
147 var peer = this.peer;
148 if ((peer != null) && !(Clazz.instanceOf (peer, java.awt.peer.LightweightPeer))) {
149 return peer.getToolkit ();
150 }var parent = this.parent;
151 if (parent != null) {
152 return parent.getToolkitImpl ();
153 }return java.awt.Toolkit.getDefaultToolkit ();
155 Clazz.defineMethod (c$, "isValid",
159 Clazz.defineMethod (c$, "isDisplayable",
163 Clazz.defineMethod (c$, "isVisible",
165 return this.isVisible_NoClientCode ();
167 Clazz.defineMethod (c$, "isVisible_NoClientCode",
171 Clazz.defineMethod (c$, "isRecursivelyVisible",
173 return this.visible && (this.parent == null || this.parent.isRecursivelyVisible ());
175 Clazz.defineMethod (c$, "pointRelativeToComponent",
176 function (absolute) {
177 var compCoords = this.getLocationOnScreen ();
178 return new java.awt.Point (absolute.x - compCoords.x, absolute.y - compCoords.y);
179 }, "java.awt.Point");
180 Clazz.defineMethod (c$, "getMousePosition",
184 Clazz.defineMethod (c$, "isSameOrAncestorOf",
185 function (comp, allowChildren) {
186 return comp === this;
187 }, "java.awt.Component,~B");
188 Clazz.defineMethod (c$, "isShowing",
191 var parent = this.parent;
192 return (parent == null) || parent.isShowing ();
195 Clazz.defineMethod (c$, "isEnabled",
197 return this.isEnabledImpl ();
199 Clazz.defineMethod (c$, "isEnabledImpl",
203 Clazz.defineMethod (c$, "setEnabled",
207 Clazz.defineMethod (c$, "enable",
211 var peer = this.peer;
213 peer.setEnabled (true);
215 this.updateCursorImmediately ();
217 Clazz.defineMethod (c$, "enable",
224 Clazz.defineMethod (c$, "disable",
227 this.enabled = false;
228 var peer = this.peer;
230 peer.setEnabled (false);
232 this.updateCursorImmediately ();
234 Clazz.defineMethod (c$, "isDoubleBuffered",
238 Clazz.defineMethod (c$, "setVisible",
242 Clazz.defineMethod (c$, "show",
246 var peer = this.peer;
248 peer.setVisible (true);
249 this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768));
250 if (Clazz.instanceOf (peer, java.awt.peer.LightweightPeer)) {
252 }this.updateCursorImmediately ();
253 }if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) {
254 var e = new java.awt.event.ComponentEvent (this, 102);
255 java.awt.Toolkit.getEventQueue ().postEvent (e);
256 }}var parent = this.parent;
257 if (parent != null) {
258 parent.invalidate ();
260 Clazz.defineMethod (c$, "containsFocus",
262 return this.isFocusOwner ();
264 Clazz.defineMethod (c$, "clearCurrentFocusCycleRootOnHide",
267 Clazz.defineMethod (c$, "hide",
269 this.isPacked = false;
271 this.clearCurrentFocusCycleRootOnHide ();
272 this.visible = false;
273 this.mixOnHiding (this.isLightweight ());
274 var peer = this.peer;
276 peer.setVisible (false);
277 this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768));
278 if (Clazz.instanceOf (peer, java.awt.peer.LightweightPeer)) {
280 }this.updateCursorImmediately ();
281 }if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) {
282 var e = new java.awt.event.ComponentEvent (this, 103);
283 java.awt.Toolkit.getEventQueue ().postEvent (e);
284 }}var parent = this.parent;
285 if (parent != null) {
286 parent.invalidate ();
288 Clazz.defineMethod (c$, "getForeground",
290 var foreground = this.foreground;
291 if (foreground != null) {
293 }var parent = this.parent;
294 return (parent != null) ? parent.getForeground () : null;
296 Clazz.defineMethod (c$, "setForeground",
298 var oldColor = this.foreground;
299 var peer = this.peer;
302 c = this.getForeground ();
304 peer.setForeground (c);
305 }}this.firePropertyChangeObject ("foreground", oldColor, c);
306 }, "java.awt.Color");
307 Clazz.defineMethod (c$, "isForegroundSet",
309 return (this.foreground != null);
311 Clazz.defineMethod (c$, "getBackground",
313 var background = this.background;
314 if (background != null) {
316 }var parent = this.parent;
317 return (parent != null) ? parent.getBackground () : null;
319 Clazz.defineMethod (c$, "setBackground",
321 var oldColor = this.background;
322 var peer = this.peer;
325 c = this.getBackground ();
327 peer.setBackground (c);
328 }}this.firePropertyChangeObject ("background", oldColor, c);
329 }, "java.awt.Color");
330 Clazz.defineMethod (c$, "isBackgroundSet",
332 return (this.background != null);
334 Clazz.defineMethod (c$, "getFont",
336 return this.getFont_NoClientCode ();
338 Clazz.defineMethod (c$, "getFont_NoClientCode",
340 var font = this.font;
343 }var parent = this.parent;
344 return (parent != null) ? parent.getFont_NoClientCode () : null;
346 Clazz.defineMethod (c$, "setFont",
348 this.setFontComp (f);
350 Clazz.defineMethod (c$, "setFontComp",
355 newFont = this.font = f;
358 }var peer = this.peer;
364 }}}this.firePropertyChangeObject ("font", oldFont, newFont);
365 if (f !== oldFont && (oldFont == null || !oldFont.equals (f))) {
366 this.invalidateIfValid ();
367 }}, "java.awt.Font");
368 Clazz.defineMethod (c$, "isFontSet",
370 return (this.font != null);
372 Clazz.defineMethod (c$, "getLocale",
374 var locale = this.locale;
375 if (locale != null) {
377 }var parent = this.parent;
378 if (parent == null) {
379 throw new java.awt.IllegalComponentStateException ("This component must have a parent in order to determine its locale");
381 return parent.getLocale ();
383 Clazz.defineMethod (c$, "setLocale",
385 var oldValue = this.locale;
387 this.firePropertyChangeObject ("locale", oldValue, l);
388 this.invalidateIfValid ();
389 }, "java.util.Locale");
390 Clazz.defineMethod (c$, "getLocation",
392 return this.location ();
394 Clazz.defineMethod (c$, "getLocationOnScreen",
396 return this.getLocationOnScreen_NoTreeLock ();
398 Clazz.defineMethod (c$, "getLocationOnScreen_NoTreeLock",
400 if (this.isShowing ()) {
401 if (Clazz.instanceOf (this.peer, java.awt.peer.LightweightPeer)) {
402 var host = this.getNativeContainer ();
403 var pt = host.peer.getLocationOnScreen ();
404 for (var c = this; c !== host; c = c.getParent ()) {
410 var pt = this.peer.getLocationOnScreen ();
413 throw new java.awt.IllegalComponentStateException ("component must be showing on the screen to determine its location");
415 Clazz.defineMethod (c$, "location",
417 return this.location_NoClientCode ();
419 Clazz.defineMethod (c$, "location_NoClientCode",
421 return new java.awt.Point (this.x, this.y);
423 Clazz.defineMethod (c$, "setLocation",
425 this.setBoundsOp (1);
426 this.setBounds (x, y, this.width, this.height);
428 Clazz.defineMethod (c$, "setLocation",
430 this.setLocation (p.x, p.y);
431 }, "java.awt.Point");
432 Clazz.defineMethod (c$, "getSize",
436 Clazz.defineMethod (c$, "size",
438 return new java.awt.Dimension (this.width, this.height);
440 Clazz.defineMethod (c$, "setSize",
441 function (width, height) {
443 if (arguments.length == 1) {
444 var d = arguments[0];
448 }this.resize (width, height);
450 Clazz.defineMethod (c$, "resize",
451 function (width, height) {
452 this.setBoundsOp (2);
453 this.setBounds (this.x, this.y, width, height);
455 Clazz.defineMethod (c$, "setBounds",
456 function (x, y, width, height) {
457 this.reshape (x, y, width, height);
459 Clazz.defineMethod (c$, "setBounds",
461 this.setBounds (r.x, r.y, r.width, r.height);
462 }, "java.awt.Rectangle");
463 Clazz.defineMethod (c$, "reshape",
464 function (x, y, width, height) {
466 this.setBoundsOp (3);
467 var resized = (this.width != width) || (this.height != height);
468 var moved = (this.x != x) || (this.y != y);
469 if (!resized && !moved) {
473 var oldWidth = this.width;
474 var oldHeight = this.height;
478 this.height = height;
480 this.isPacked = false;
481 System.out.println ("C " + swingjs.JSToolkit.getClassName (this) + " resized to " + this.getBounds ());
482 }var needNotify = true;
483 this.mixOnReshaping ();
484 if (this.peer != null) {
485 this.reshapeNativePeer (x, y, width, height, this.getBoundsOp ());
486 resized = (oldWidth != this.width) || (oldHeight != this.height);
487 moved = (oldX != this.x) || (oldY != this.y);
488 if (Clazz.instanceOf (this, java.awt.Window)) {
492 }if (this.parent != null) {
493 this.parent.invalidateIfValid ();
495 this.notifyNewBounds (resized, moved);
496 }this.repaintParentIfNeeded (oldX, oldY, oldWidth, oldHeight);
498 this.setBoundsOp (5);
501 Clazz.defineMethod (c$, "repaintParentIfNeeded",
502 function (oldX, oldY, oldWidth, oldHeight) {
503 if (this.parent != null && Clazz.instanceOf (this.peer, java.awt.peer.LightweightPeer) && this.isShowing ()) {
504 this.parent.repaint (oldX, oldY, oldWidth, oldHeight);
507 Clazz.defineMethod (c$, "reshapeNativePeer",
508 function (x, y, width, height, op) {
511 for (var c = this.parent; (c != null) && (Clazz.instanceOf (c.peer, java.awt.peer.LightweightPeer)); c = c.parent) {
515 this.peer.setBounds (nativeX, nativeY, width, height, op);
516 }, "~N,~N,~N,~N,~N");
517 Clazz.defineMethod (c$, "notifyNewBounds",
518 function (resized, moved) {
519 if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) {
521 var e = new java.awt.event.ComponentEvent (this, 101);
522 java.awt.Toolkit.getEventQueue ().postEvent (e);
524 var e = new java.awt.event.ComponentEvent (this, 100);
525 java.awt.Toolkit.getEventQueue ().postEvent (e);
527 if (Clazz.instanceOf (this, java.awt.Container) && (this).countComponents () > 0) {
528 var enabledOnToolkit = java.awt.Toolkit.enabledOnToolkit (65536);
530 (this).createChildHierarchyEvents (1402, 0, enabledOnToolkit);
532 (this).createChildHierarchyEvents (1401, 0, enabledOnToolkit);
534 Clazz.defineMethod (c$, "getX",
538 Clazz.defineMethod (c$, "getY",
542 Clazz.defineMethod (c$, "getWidth",
546 Clazz.defineMethod (c$, "getHeight",
550 Clazz.defineMethod (c$, "getBounds",
552 if (rv == null) return new java.awt.Rectangle (this.getX (), this.getY (), this.getWidth (), this.getHeight ());
553 rv.reshape (this.getX (), this.getY (), this.getWidth (), this.getHeight ());
555 }, "java.awt.Rectangle");
556 Clazz.defineMethod (c$, "getSize",
559 return new java.awt.Dimension (this.getWidth (), this.getHeight ());
561 rv.setSize (this.getWidth (), this.getHeight ());
563 }}, "java.awt.Dimension");
564 Clazz.defineMethod (c$, "getLocation",
567 return new java.awt.Point (this.getX (), this.getY ());
569 rv.setLocation (this.getX (), this.getY ());
571 }}, "java.awt.Point");
572 Clazz.defineMethod (c$, "isOpaque",
576 Clazz.defineMethod (c$, "isLightweight",
580 Clazz.defineMethod (c$, "setPreferredSize",
581 function (preferredSize) {
582 this.setPrefSizeComp (preferredSize);
583 }, "java.awt.Dimension");
584 Clazz.defineMethod (c$, "setPrefSizeComp",
585 function (preferredSize) {
586 var old = (this.prefSizeSet ? this.prefSize : null);
587 this.prefSize = preferredSize;
588 this.prefSizeSet = (preferredSize != null);
589 this.firePropertyChangeObject ("preferredSize", old, preferredSize);
590 }, "java.awt.Dimension");
591 Clazz.defineMethod (c$, "isPreferredSizeSet",
593 return this.prefSizeSet;
595 Clazz.defineMethod (c$, "getPreferredSize",
597 return this.preferredSize ();
599 Clazz.defineMethod (c$, "preferredSize",
601 return this.prefSizeComp ();
603 Clazz.defineMethod (c$, "prefSizeComp",
605 var dim = this.prefSize;
606 if (dim == null || !(this.isPreferredSizeSet () || this.isValid ())) {
607 this.prefSize = this.getMinimumSize ();
609 }return new java.awt.Dimension (dim);
611 Clazz.defineMethod (c$, "setMinimumSize",
612 function (minimumSize) {
614 if (this.minSizeSet) {
618 }this.minSize = minimumSize;
619 this.minSizeSet = (minimumSize != null);
620 this.firePropertyChangeObject ("minimumSize", old, minimumSize);
621 }, "java.awt.Dimension");
622 Clazz.defineMethod (c$, "isMinimumSizeSet",
624 return this.minSizeSet;
626 Clazz.defineMethod (c$, "getMinimumSize",
628 return this.minimumSize ();
630 Clazz.defineMethod (c$, "minimumSize",
632 var dim = this.minSize;
633 if (dim == null || !(this.isMinimumSizeSet () || this.isValid ())) {
634 this.minSize = this.getSize ();
636 }return new java.awt.Dimension (dim);
638 Clazz.defineMethod (c$, "setMaximumSize",
639 function (maximumSize) {
641 if (this.maxSizeSet) {
645 }this.maxSize = maximumSize;
646 this.maxSizeSet = (maximumSize != null);
647 this.firePropertyChangeObject ("maximumSize", old, maximumSize);
648 }, "java.awt.Dimension");
649 Clazz.defineMethod (c$, "isMaximumSizeSet",
651 return this.maxSizeSet;
653 Clazz.defineMethod (c$, "getMaximumSize",
655 return this.getMaxSizeComp ();
657 Clazz.defineMethod (c$, "getMaxSizeComp",
659 if (this.isMaximumSizeSet ()) {
660 return new java.awt.Dimension (this.maxSize);
661 }return new java.awt.Dimension (32767, 32767);
663 Clazz.defineMethod (c$, "getAlignmentX",
665 return this.getAlignmentXComp ();
667 Clazz.defineMethod (c$, "getAlignmentXComp",
671 Clazz.defineMethod (c$, "getAlignmentY",
673 return this.getAlignmentYComp ();
675 Clazz.defineMethod (c$, "getAlignmentYComp",
679 Clazz.defineMethod (c$, "getBaseline",
680 function (width, height) {
681 if (width < 0 || height < 0) {
682 throw new IllegalArgumentException ("Width and height must be >= 0");
685 Clazz.defineMethod (c$, "getBaselineResizeBehavior",
687 return java.awt.Component.BaselineResizeBehavior.OTHER;
689 Clazz.defineMethod (c$, "doLayout",
693 Clazz.defineMethod (c$, "layout",
696 Clazz.defineMethod (c$, "validate",
698 this.validateComponent ();
700 Clazz.defineMethod (c$, "validateComponent",
703 var peer = this.peer;
704 var wasValid = this.isValid ();
705 if (!wasValid && peer != null) {
706 var newfont = this.getFont ();
707 var oldfont = this.peerFont;
708 if (newfont !== oldfont && (oldfont == null || !oldfont.equals (newfont))) {
709 peer.setFont (newfont);
710 this.peerFont = newfont;
714 this.mixOnValidating ();
716 Clazz.defineMethod (c$, "invalidate",
718 this.invalidateComp ();
720 Clazz.defineMethod (c$, "invalidateComp",
723 if (!this.isPreferredSizeSet ()) {
724 this.prefSize = null;
725 }if (!this.isMinimumSizeSet ()) {
727 }if (!this.isMaximumSizeSet ()) {
729 }if (this.parent != null) {
730 this.parent.invalidateIfValid ();
732 Clazz.defineMethod (c$, "invalidateIfValid",
734 if (this.isValid ()) {
737 Clazz.defineMethod (c$, "getGraphics",
739 if (Clazz.instanceOf (this.peer, java.awt.peer.LightweightPeer)) {
740 if (this.parent == null) return null;
741 var g = this.parent.getGraphics ();
742 if (g == null) return null;
743 g.setFont (this.getFont ());
746 var peer = this.peer;
747 return (peer != null) ? peer.getGraphics () : null;
749 Clazz.defineMethod (c$, "getTreeLock",
753 Clazz.defineMethod (c$, "getFontMetrics",
755 return jssun.font.FontDesignMetrics.getMetrics (font);
757 Clazz.defineMethod (c$, "setCursor",
759 this.cursor = cursor;
760 this.updateCursorImmediately ();
761 }, "java.awt.Cursor");
762 Clazz.defineMethod (c$, "updateCursorImmediately",
765 Clazz.defineMethod (c$, "getCursor",
767 return this.getCursor_NoClientCode ();
769 Clazz.defineMethod (c$, "getCursor_NoClientCode",
771 var cursor = this.cursor;
772 if (cursor != null) {
774 }var parent = this.parent;
775 if (parent != null) {
776 return parent.getCursor_NoClientCode ();
778 return java.awt.Cursor.getPredefinedCursor (0);
780 Clazz.defineMethod (c$, "isCursorSet",
782 return (this.cursor != null);
784 Clazz.defineMethod (c$, "paint",
786 }, "java.awt.Graphics");
787 Clazz.defineMethod (c$, "update",
790 }, "java.awt.Graphics");
791 Clazz.defineMethod (c$, "paintAll",
793 }, "java.awt.Graphics");
794 Clazz.defineMethod (c$, "lightweightPaint",
796 this.lwPaintComp (g);
797 }, "java.awt.Graphics");
798 Clazz.defineMethod (c$, "lwPaintComp",
801 }, "java.awt.Graphics");
802 Clazz.defineMethod (c$, "paintHeavyweightComponents",
804 }, "java.awt.Graphics");
805 Clazz.defineMethod (c$, "repaint",
807 this.repaintImpl (0, 0, 0, this.width, this.height);
809 Clazz.defineMethod (c$, "repaint",
811 this.repaintImpl (tm, 0, 0, this.width, this.height);
813 Clazz.defineMethod (c$, "repaint",
814 function (x, y, width, height) {
815 this.repaintImpl (0, x, y, width, height);
817 Clazz.defineMethod (c$, "repaint",
818 function (tm, x, y, width, height) {
819 this.repaintImpl (tm, x, y, width, height);
820 }, "~N,~N,~N,~N,~N");
821 Clazz.defineMethod (c$, "repaintImpl",
822 function (tm, x, y, width, height) {
823 if (Clazz.instanceOf (this.peer, java.awt.peer.LightweightPeer)) {
824 if (this.parent != null) {
825 var px = this.x + ((x < 0) ? 0 : x);
826 var py = this.y + ((y < 0) ? 0 : y);
827 var pwidth = (width > this.width) ? this.width : width;
828 var pheight = (height > this.height) ? this.height : height;
829 this.parent.repaint (tm, px, py, pwidth, pheight);
831 if (this.isVisible () && (this.peer != null) && (width > 0) && (height > 0)) {
832 var e = new java.awt.event.PaintEvent (this, 801, new java.awt.Rectangle (x, y, width, height));
833 java.awt.Toolkit.getEventQueue ().postEvent (e);
834 }}}, "~N,~N,~N,~N,~N");
835 Clazz.defineMethod (c$, "print",
838 }, "java.awt.Graphics");
839 Clazz.defineMethod (c$, "printAll",
841 }, "java.awt.Graphics");
842 Clazz.defineMethod (c$, "printHeavyweightComponents",
844 }, "java.awt.Graphics");
845 Clazz.overrideMethod (c$, "imageUpdate",
846 function (img, infoflags, x, y, w, h) {
848 }, "java.awt.Image,~N,~N,~N,~N,~N");
849 Clazz.defineMethod (c$, "createImage",
850 function (producer) {
851 return this.getToolkit ().createImage (producer);
852 }, "java.awt.image.ImageProducer");
853 Clazz.defineMethod (c$, "createImage",
854 function (width, height) {
855 return java.awt.Toolkit.getDefaultToolkit ().createImage (null, width, height);
857 Clazz.defineMethod (c$, "createVolatileImage",
858 function (width, height) {
861 Clazz.defineMethod (c$, "createVolatileImage",
862 function (width, height, caps) {
863 return this.createVolatileImage (width, height);
864 }, "~N,~N,java.awt.ImageCapabilities");
865 Clazz.defineMethod (c$, "prepareImage",
866 function (image, observer) {
867 return this.prepareImage (image, -1, -1, observer);
868 }, "java.awt.Image,java.awt.image.ImageObserver");
869 Clazz.defineMethod (c$, "prepareImage",
870 function (image, width, height, observer) {
872 }, "java.awt.Image,~N,~N,java.awt.image.ImageObserver");
873 Clazz.defineMethod (c$, "checkImage",
874 function (image, observer) {
875 return this.checkImage (image, -1, -1, observer);
876 }, "java.awt.Image,java.awt.image.ImageObserver");
877 Clazz.defineMethod (c$, "checkImage",
878 function (image, width, height, observer) {
880 }, "java.awt.Image,~N,~N,java.awt.image.ImageObserver");
881 Clazz.defineMethod (c$, "setIgnoreRepaint",
882 function (ignoreRepaint) {
884 Clazz.defineMethod (c$, "getIgnoreRepaint",
888 Clazz.defineMethod (c$, "contains",
890 return this.inside (x, y);
892 Clazz.defineMethod (c$, "inside",
894 return (x >= 0) && (x < this.width) && (y >= 0) && (y < this.height);
896 Clazz.defineMethod (c$, "getComponentAt",
898 return this.locate (x, y);
900 Clazz.defineMethod (c$, "locate",
902 return this.contains (x, y) ? this : null;
904 Clazz.defineMethod (c$, "getComponentAt",
906 return this.getComponentAt (p.x, p.y);
907 }, "java.awt.Point");
908 Clazz.defineMethod (c$, "deliverEvent",
911 }, "java.awt.Event");
912 Clazz.defineMethod (c$, "dispatchEvent",
914 this.dispatchEventImpl (e);
915 }, "java.awt.AWTEvent");
916 Clazz.defineMethod (c$, "dispatchEventImpl",
918 this.dispatchEventImplComp (e);
919 }, "java.awt.AWTEvent");
920 Clazz.defineMethod (c$, "dispatchEventImplComp",
923 java.awt.EventQueue.setCurrentEventAndMostRecentTime (e);
924 if (!e.focusManagerIsDispatching) {
927 }}if (!e.isConsumed ()) {
928 if (Clazz.instanceOf (e, java.awt.event.KeyEvent)) {
929 if (e.isConsumed ()) {
931 }}}if (this.areInputMethodsEnabled ()) {
932 if ((Clazz.instanceOf (e, java.awt.event.InputEvent)) || (Clazz.instanceOf (e, java.awt.event.FocusEvent))) {
938 var p = ((Clazz.instanceOf (this, java.awt.Container)) ? this : this.parent);
940 p.preProcessKeyEvent (e);
947 if (this.newEventsOnly) {
948 if (this.eventEnabled (e)) {
949 this.processEvent (e);
950 }} else if (id == 507) {
951 this.autoProcessMouseWheel (e);
952 } else if (!(Clazz.instanceOf (e, java.awt.event.MouseEvent) && !this.postsOldMouseEvents ())) {
953 }if (id == 201 && !e.isConsumed ()) {
954 }if (!(Clazz.instanceOf (e, java.awt.event.KeyEvent))) {
955 }}, "java.awt.AWTEvent");
956 Clazz.defineMethod (c$, "autoProcessMouseWheel",
958 }, "java.awt.event.MouseWheelEvent");
959 Clazz.defineMethod (c$, "dispatchMouseWheelToAncestor",
963 newX = e.getX () + this.getX ();
964 newY = e.getY () + this.getY ();
967 var anc = this.getParent ();
968 while (anc != null && !anc.eventEnabled (e)) {
971 if (!(Clazz.instanceOf (anc, java.awt.Window))) {
972 anc = anc.getParent ();
976 if (anc != null && anc.eventEnabled (e)) {
977 newMWE = new java.awt.event.MouseWheelEvent (anc, e.getID (), e.getWhen (), e.getModifiers (), newX, newY, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), e.getScrollType (), e.getScrollAmount (), e.getWheelRotation ());
978 (e).copyPrivateDataInto (newMWE);
979 anc.dispatchEventToSelf (newMWE);
981 }, "java.awt.event.MouseWheelEvent");
982 Clazz.defineMethod (c$, "checkWindowClosingException",
984 if (this.windowClosingException != null) {
985 if (Clazz.instanceOf (this, java.awt.Dialog)) {
986 (this).interruptBlocking ();
988 this.windowClosingException.fillInStackTrace ();
989 this.windowClosingException.printStackTrace ();
990 this.windowClosingException = null;
994 Clazz.defineMethod (c$, "areInputMethodsEnabled",
996 return ((this.eventMask & 4096) != 0) && ((this.eventMask & 8) != 0 || this.keyListener != null);
998 Clazz.defineMethod (c$, "eventEnabled",
1000 return this.eventTypeEnabled (e.id);
1001 }, "java.awt.AWTEvent");
1002 Clazz.defineMethod (c$, "eventTypeEnabled",
1009 if ((this.eventMask & 1) != 0 || this.componentListener != null) {
1014 if ((this.eventMask & 4) != 0 || this.focusListener != null) {
1020 if ((this.eventMask & 8) != 0 || this.keyListener != null) {
1028 if ((this.eventMask & 16) != 0 || this.mouseListener != null) {
1033 if ((this.eventMask & 32) != 0 || this.mouseMotionListener != null) {
1037 if ((this.eventMask & 131072) != 0 || this.mouseWheelListener != null) {
1042 if ((this.eventMask & 2048) != 0 || this.inputMethodListener != null) {
1046 if ((this.eventMask & 32768) != 0 || this.hierarchyListener != null) {
1051 if ((this.eventMask & 65536) != 0 || this.hierarchyBoundsListener != null) {
1055 if ((this.eventMask & 128) != 0) {
1059 if ((this.eventMask & 1024) != 0) {
1063 if ((this.eventMask & 512) != 0) {
1067 if ((this.eventMask & 256) != 0) {
1077 Clazz.defineMethod (c$, "postEvent",
1079 if (this.handleEvent (e)) {
1082 }var parent = this.parent;
1085 if (parent != null) {
1086 e.translate (this.x, this.y);
1087 if (parent.postEvent (e)) {
1093 }, "java.awt.Event");
1094 Clazz.defineMethod (c$, "addComponentListener",
1098 }this.componentListener = java.awt.AWTEventMulticaster.add (this.componentListener, l);
1099 this.newEventsOnly = true;
1100 }, "java.awt.event.ComponentListener");
1101 Clazz.defineMethod (c$, "removeComponentListener",
1105 }this.componentListener = java.awt.AWTEventMulticaster.remove (this.componentListener, l);
1106 }, "java.awt.event.ComponentListener");
1107 Clazz.defineMethod (c$, "getComponentListeners",
1109 return (this.getListeners (java.awt.event.ComponentListener));
1111 Clazz.defineMethod (c$, "addFocusListener",
1115 }this.focusListener = java.awt.AWTEventMulticaster.add (this.focusListener, l);
1116 this.newEventsOnly = true;
1117 }, "java.awt.event.FocusListener");
1118 Clazz.defineMethod (c$, "removeFocusListener",
1122 }this.focusListener = java.awt.AWTEventMulticaster.remove (this.focusListener, l);
1123 }, "java.awt.event.FocusListener");
1124 Clazz.defineMethod (c$, "getFocusListeners",
1126 return (this.getListeners (java.awt.event.FocusListener));
1128 Clazz.defineMethod (c$, "addHierarchyListener",
1130 }, "java.awt.event.HierarchyListener");
1131 Clazz.defineMethod (c$, "removeHierarchyListener",
1133 }, "java.awt.event.HierarchyListener");
1134 Clazz.defineMethod (c$, "getHierarchyListeners",
1136 return (this.getListeners (java.awt.event.HierarchyListener));
1138 Clazz.defineMethod (c$, "addHierarchyBoundsListener",
1142 }var notifyAncestors;
1144 notifyAncestors = (this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0);
1145 this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.add (this.hierarchyBoundsListener, l);
1146 notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener != null);
1147 this.newEventsOnly = true;
1148 }if (notifyAncestors) {
1150 this.adjustListeningChildrenOnParent (65536, 1);
1151 }}}, "java.awt.event.HierarchyBoundsListener");
1152 Clazz.defineMethod (c$, "removeHierarchyBoundsListener",
1156 }var notifyAncestors;
1158 notifyAncestors = (this.hierarchyBoundsListener != null && (this.eventMask & 65536) == 0);
1159 this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.remove (this.hierarchyBoundsListener, l);
1160 notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener == null);
1161 }if (notifyAncestors) {
1163 this.adjustListeningChildrenOnParent (65536, -1);
1164 }}}, "java.awt.event.HierarchyBoundsListener");
1165 Clazz.defineMethod (c$, "numListening",
1167 return this.numListeningMask (mask);
1169 Clazz.defineMethod (c$, "numListeningMask",
1171 if ((mask == 32768 && (this.hierarchyListener != null || (this.eventMask & 32768) != 0)) || (mask == 65536 && (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0))) {
1176 Clazz.defineMethod (c$, "countHierarchyMembers",
1180 Clazz.defineMethod (c$, "createHierarchyEvents",
1181 function (id, changed, changedParent, changeFlags, enabledOnToolkit) {
1182 return this.createHierEventsComp (id, changed, changedParent, changeFlags, enabledOnToolkit);
1183 }, "~N,java.awt.Component,java.awt.Container,~N,~B");
1184 Clazz.defineMethod (c$, "createHierEventsComp",
1185 function (id, changed, changedParent, changeFlags, enabledOnToolkit) {
1188 if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || enabledOnToolkit) {
1189 var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent, changeFlags);
1190 this.dispatchEvent (e);
1195 if (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0 || enabledOnToolkit) {
1196 var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent);
1197 this.dispatchEvent (e);
1204 }, "~N,java.awt.Component,java.awt.Container,~N,~B");
1205 Clazz.defineMethod (c$, "getHierarchyBoundsListeners",
1207 return (this.getListeners (java.awt.event.HierarchyBoundsListener));
1209 Clazz.defineMethod (c$, "adjustListeningChildrenOnParent",
1210 function (mask, num) {
1211 if (this.parent != null) {
1212 this.parent.adjustListeningChildren (mask, num);
1214 Clazz.defineMethod (c$, "addKeyListener",
1218 }this.keyListener = java.awt.AWTEventMulticaster.add (this.keyListener, l);
1219 this.newEventsOnly = true;
1220 }, "java.awt.event.KeyListener");
1221 Clazz.defineMethod (c$, "removeKeyListener",
1225 }this.keyListener = java.awt.AWTEventMulticaster.remove (this.keyListener, l);
1226 }, "java.awt.event.KeyListener");
1227 Clazz.defineMethod (c$, "getKeyListeners",
1229 return (this.getListeners (java.awt.event.KeyListener));
1231 Clazz.defineMethod (c$, "addMouseListener",
1235 }System.out.println ("C adding mouse listener " + l);
1236 this.mouseListener = java.awt.AWTEventMulticaster.add (this.mouseListener, l);
1237 this.newEventsOnly = true;
1238 }, "java.awt.event.MouseListener");
1239 Clazz.defineMethod (c$, "removeMouseListener",
1243 }this.mouseListener = java.awt.AWTEventMulticaster.remove (this.mouseListener, l);
1244 }, "java.awt.event.MouseListener");
1245 Clazz.defineMethod (c$, "getMouseListeners",
1247 return (this.getListeners (java.awt.event.MouseListener));
1249 Clazz.defineMethod (c$, "addMouseMotionListener",
1253 }this.mouseMotionListener = java.awt.AWTEventMulticaster.add (this.mouseMotionListener, l);
1254 this.newEventsOnly = true;
1255 }, "java.awt.event.MouseMotionListener");
1256 Clazz.defineMethod (c$, "removeMouseMotionListener",
1260 }this.mouseMotionListener = java.awt.AWTEventMulticaster.remove (this.mouseMotionListener, l);
1261 }, "java.awt.event.MouseMotionListener");
1262 Clazz.defineMethod (c$, "getMouseMotionListeners",
1264 return (this.getListeners (java.awt.event.MouseMotionListener));
1266 Clazz.defineMethod (c$, "addMouseWheelListener",
1270 }this.mouseWheelListener = java.awt.AWTEventMulticaster.add (this.mouseWheelListener, l);
1271 this.newEventsOnly = true;
1272 }, "java.awt.event.MouseWheelListener");
1273 Clazz.defineMethod (c$, "removeMouseWheelListener",
1277 }this.mouseWheelListener = java.awt.AWTEventMulticaster.remove (this.mouseWheelListener, l);
1278 }, "java.awt.event.MouseWheelListener");
1279 Clazz.defineMethod (c$, "getMouseWheelListeners",
1281 return (this.getListeners (java.awt.event.MouseWheelListener));
1283 Clazz.defineMethod (c$, "addInputMethodListener",
1287 }this.inputMethodListener = java.awt.AWTEventMulticaster.add (this.inputMethodListener, l);
1288 this.newEventsOnly = true;
1289 }, "java.awt.event.InputMethodListener");
1290 Clazz.defineMethod (c$, "removeInputMethodListener",
1294 }this.inputMethodListener = java.awt.AWTEventMulticaster.remove (this.inputMethodListener, l);
1295 }, "java.awt.event.InputMethodListener");
1296 Clazz.defineMethod (c$, "getInputMethodListeners",
1298 return (this.getListeners (java.awt.event.InputMethodListener));
1300 Clazz.defineMethod (c$, "getListeners",
1301 function (listenerType) {
1302 return this.getListenersComp (listenerType);
1304 Clazz.defineMethod (c$, "getListenersComp",
1305 function (listenerType) {
1307 if (listenerType === java.awt.event.ComponentListener) {
1308 l = this.componentListener;
1309 } else if (listenerType === java.awt.event.FocusListener) {
1310 l = this.focusListener;
1311 } else if (listenerType === java.awt.event.HierarchyListener) {
1312 l = this.hierarchyListener;
1313 } else if (listenerType === java.awt.event.HierarchyBoundsListener) {
1314 l = this.hierarchyBoundsListener;
1315 } else if (listenerType === java.awt.event.KeyListener) {
1316 l = this.keyListener;
1317 } else if (listenerType === java.awt.event.MouseListener) {
1318 l = this.mouseListener;
1319 } else if (listenerType === java.awt.event.MouseMotionListener) {
1320 l = this.mouseMotionListener;
1321 } else if (listenerType === java.awt.event.MouseWheelListener) {
1322 l = this.mouseWheelListener;
1323 } else if (listenerType === java.awt.event.InputMethodListener) {
1324 l = this.inputMethodListener;
1325 } else if (listenerType === java.beans.PropertyChangeListener) {
1326 return this.getPropertyChangeListeners ();
1327 }return java.awt.AWTEventMulticaster.getListeners (l, listenerType);
1329 Clazz.defineMethod (c$, "enableEvents",
1330 function (eventsToEnable) {
1331 var notifyAncestors = 0;
1333 if ((eventsToEnable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) == 0) {
1334 notifyAncestors |= 32768;
1335 }if ((eventsToEnable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0) {
1336 notifyAncestors |= 65536;
1337 }this.eventMask |= eventsToEnable;
1338 this.newEventsOnly = true;
1339 }if (Clazz.instanceOf (this.peer, java.awt.peer.LightweightPeer)) {
1340 this.parent.proxyEnableEvents (this.eventMask);
1341 }if (notifyAncestors != 0) {
1343 this.adjustListeningChildrenOnParent (notifyAncestors, 1);
1345 Clazz.defineMethod (c$, "disableEvents",
1346 function (eventsToDisable) {
1347 var notifyAncestors = 0;
1349 if ((eventsToDisable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) != 0) {
1350 notifyAncestors |= 32768;
1351 }if ((eventsToDisable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) != 0) {
1352 notifyAncestors |= 65536;
1353 }this.eventMask &= ~eventsToDisable;
1354 }if (notifyAncestors != 0) {
1356 this.adjustListeningChildrenOnParent (notifyAncestors, -1);
1358 Clazz.defineMethod (c$, "checkCoalescing",
1360 if (this.getClass ().getClassLoader () == null) {
1362 }var clazz = this.getClass ();
1364 var value = java.awt.Component.coalesceMap.get (clazz);
1365 if (value != null) {
1367 }var enabled = Boolean.$valueOf (swingjs.JSToolkit.checkClassMethod (this, "coalesceEvents", "\\java.awt.AWTEvent\\java.awt.AWTEvent"));
1368 java.awt.Component.coalesceMap.put (clazz, enabled);
1371 Clazz.defineMethod (c$, "isCoalescingEnabled",
1373 return this.coalescingEnabled;
1375 Clazz.defineMethod (c$, "coalesceEvents",
1376 function (existingEvent, newEvent) {
1378 }, "java.awt.AWTEvent,java.awt.AWTEvent");
1379 Clazz.defineMethod (c$, "processEvent",
1381 this.processEventComp (e);
1382 }, "java.awt.AWTEvent");
1383 Clazz.defineMethod (c$, "processEventComp",
1385 if (Clazz.instanceOf (e, java.awt.event.FocusEvent)) {
1386 this.processFocusEvent (e);
1387 } else if (Clazz.instanceOf (e, java.awt.event.MouseEvent)) {
1388 switch (e.getID ()) {
1394 this.processMouseEvent (e);
1398 this.processMouseMotionEvent (e);
1401 this.processMouseWheelEvent (e);
1404 } else if (Clazz.instanceOf (e, java.awt.event.KeyEvent)) {
1405 this.processKeyEvent (e);
1406 } else if (Clazz.instanceOf (e, java.awt.event.ComponentEvent)) {
1407 this.processComponentEvent (e);
1408 } else if (Clazz.instanceOf (e, java.awt.event.InputMethodEvent)) {
1409 this.processInputMethodEvent (e);
1410 } else if (Clazz.instanceOf (e, java.awt.event.HierarchyEvent)) {
1411 switch (e.getID ()) {
1413 this.processHierarchyEvent (e);
1417 this.processHierarchyBoundsEvent (e);
1420 }}, "java.awt.AWTEvent");
1421 Clazz.defineMethod (c$, "processComponentEvent",
1423 var listener = this.componentListener;
1424 if (listener != null) {
1425 var id = e.getID ();
1428 listener.componentResized (e);
1431 listener.componentMoved (e);
1434 listener.componentShown (e);
1437 listener.componentHidden (e);
1440 }}, "java.awt.event.ComponentEvent");
1441 Clazz.defineMethod (c$, "processFocusEvent",
1443 var listener = this.focusListener;
1444 if (listener != null) {
1445 var id = e.getID ();
1448 listener.focusGained (e);
1451 listener.focusLost (e);
1454 }}, "java.awt.event.FocusEvent");
1455 Clazz.defineMethod (c$, "processKeyEvent",
1457 var listener = this.keyListener;
1458 if (listener != null) {
1459 var id = e.getID ();
1462 listener.keyTyped (e);
1465 listener.keyPressed (e);
1468 listener.keyReleased (e);
1471 }}, "java.awt.event.KeyEvent");
1472 Clazz.defineMethod (c$, "processMouseEvent",
1474 var listener = this.mouseListener;
1475 if (listener != null) {
1476 var id = e.getID ();
1479 listener.mousePressed (e);
1482 listener.mouseReleased (e);
1485 listener.mouseClicked (e);
1488 listener.mouseExited (e);
1491 listener.mouseEntered (e);
1494 }}, "java.awt.event.MouseEvent");
1495 Clazz.defineMethod (c$, "processMouseMotionEvent",
1497 var listener = this.mouseMotionListener;
1498 if (listener != null) {
1499 var id = e.getID ();
1502 listener.mouseMoved (e);
1505 listener.mouseDragged (e);
1508 }}, "java.awt.event.MouseEvent");
1509 Clazz.defineMethod (c$, "processMouseWheelEvent",
1511 var listener = this.mouseWheelListener;
1512 if (listener != null) {
1513 var id = e.getID ();
1516 listener.mouseWheelMoved (e);
1519 }}, "java.awt.event.MouseWheelEvent");
1520 Clazz.defineMethod (c$, "postsOldMouseEvents",
1524 Clazz.defineMethod (c$, "processInputMethodEvent",
1526 var listener = this.inputMethodListener;
1527 if (listener != null) {
1528 var id = e.getID ();
1531 listener.inputMethodTextChanged (e);
1534 listener.caretPositionChanged (e);
1537 }}, "java.awt.event.InputMethodEvent");
1538 Clazz.defineMethod (c$, "processHierarchyEvent",
1540 var listener = this.hierarchyListener;
1541 if (listener != null) {
1542 var id = e.getID ();
1545 listener.hierarchyChanged (e);
1548 }}, "java.awt.event.HierarchyEvent");
1549 Clazz.defineMethod (c$, "processHierarchyBoundsEvent",
1551 var listener = this.hierarchyBoundsListener;
1552 if (listener != null) {
1553 var id = e.getID ();
1556 listener.ancestorMoved (e);
1559 listener.ancestorResized (e);
1562 }}, "java.awt.event.HierarchyEvent");
1563 Clazz.defineMethod (c$, "handleEvent",
1567 return this.mouseEnter (evt, evt.x, evt.y);
1569 return this.mouseExit (evt, evt.x, evt.y);
1571 return this.mouseMove (evt, evt.x, evt.y);
1573 return this.mouseDown (evt, evt.x, evt.y);
1575 return this.mouseDrag (evt, evt.x, evt.y);
1577 return this.mouseUp (evt, evt.x, evt.y);
1580 return this.keyDown (evt, evt.key);
1583 return this.keyUp (evt, evt.key);
1585 return this.action (evt, evt.arg);
1587 return this.gotFocus (evt, evt.arg);
1589 return this.lostFocus (evt, evt.arg);
1592 }, "java.awt.Event");
1593 Clazz.defineMethod (c$, "mouseDown",
1594 function (evt, x, y) {
1596 }, "java.awt.Event,~N,~N");
1597 Clazz.defineMethod (c$, "mouseDrag",
1598 function (evt, x, y) {
1600 }, "java.awt.Event,~N,~N");
1601 Clazz.defineMethod (c$, "mouseUp",
1602 function (evt, x, y) {
1604 }, "java.awt.Event,~N,~N");
1605 Clazz.defineMethod (c$, "mouseMove",
1606 function (evt, x, y) {
1608 }, "java.awt.Event,~N,~N");
1609 Clazz.defineMethod (c$, "mouseEnter",
1610 function (evt, x, y) {
1612 }, "java.awt.Event,~N,~N");
1613 Clazz.defineMethod (c$, "mouseExit",
1614 function (evt, x, y) {
1616 }, "java.awt.Event,~N,~N");
1617 Clazz.defineMethod (c$, "keyDown",
1618 function (evt, key) {
1620 }, "java.awt.Event,~N");
1621 Clazz.defineMethod (c$, "keyUp",
1622 function (evt, key) {
1624 }, "java.awt.Event,~N");
1625 Clazz.defineMethod (c$, "action",
1626 function (evt, what) {
1628 }, "java.awt.Event,~O");
1629 Clazz.defineMethod (c$, "addNotify",
1631 this.addNotifyComp ();
1633 Clazz.defineMethod (c$, "addNotifyComp",
1636 var peer = this.peer;
1637 if (peer == null || Clazz.instanceOf (peer, java.awt.peer.LightweightPeer)) {
1639 this.peer = peer = this.getToolkit ().createComponent (this);
1640 }if (this.parent != null) {
1642 if ((this.mouseListener != null) || ((this.eventMask & 16) != 0)) {
1644 }if ((this.mouseMotionListener != null) || ((this.eventMask & 32) != 0)) {
1646 }if ((this.mouseWheelListener != null) || ((this.eventMask & 131072) != 0)) {
1648 }if (this.focusListener != null || (this.eventMask & 4) != 0) {
1650 }if (this.keyListener != null || (this.eventMask & 8) != 0) {
1653 this.parent.proxyEnableEvents (mask);
1655 var parent = this.parent;
1656 if (parent != null && Clazz.instanceOf (parent.peer, java.awt.peer.LightweightPeer)) {
1657 this.relocateComponent ();
1658 }}this.invalidate ();
1659 this.peerFont = this.getFont ();
1660 if (this.getContainer () != null && !this.isAddNotifyComplete) {
1661 this.getContainer ().increaseComponentCount (this);
1662 }if (this.parent != null && this.parent.peer != null) {
1663 var parentContPeer = this.parent.peer;
1664 if (Clazz.instanceOf (parentContPeer, java.awt.peer.LightweightPeer) && !(Clazz.instanceOf (peer, java.awt.peer.LightweightPeer))) {
1665 var hwParent = this.getNativeContainer ();
1666 if (hwParent != null && hwParent.peer != null) {
1667 parentContPeer = hwParent.peer;
1668 }}}if (!this.isAddNotifyComplete) {
1669 this.mixOnShowing ();
1670 }this.isAddNotifyComplete = true;
1671 if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) {
1672 var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0));
1673 this.dispatchEvent (e);
1675 Clazz.defineMethod (c$, "getNativeContainer",
1677 var p = this.parent;
1678 while (p != null && Clazz.instanceOf (p.peer, java.awt.peer.LightweightPeer)) {
1683 Clazz.defineMethod (c$, "removeNotify",
1685 this.removeNotifyComp ();
1687 Clazz.defineMethod (c$, "removeNotifyComp",
1690 if (this.getContainer () != null && this.isAddNotifyComplete) {
1691 this.getContainer ().decreaseComponentCount (this);
1694 var isLightweight = this.isLightweight ();
1696 this.peerFont = null;
1697 java.awt.Toolkit.getEventQueue ().removeSourceEvents (this, false);
1699 this.mixOnHiding (isLightweight);
1700 this.isAddNotifyComplete = false;
1701 }if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) {
1702 var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0));
1703 this.dispatchEvent (e);
1705 Clazz.defineMethod (c$, "gotFocus",
1706 function (evt, what) {
1708 }, "java.awt.Event,~O");
1709 Clazz.defineMethod (c$, "lostFocus",
1710 function (evt, what) {
1712 }, "java.awt.Event,~O");
1713 Clazz.defineMethod (c$, "isFocusTraversable",
1715 if (this.$isFocusTraversableOverridden == 0) {
1716 this.$isFocusTraversableOverridden = 1;
1717 }return this.focusable;
1719 Clazz.defineMethod (c$, "isFocusable",
1721 return this.isFocusTraversable ();
1723 Clazz.defineMethod (c$, "setFocusable",
1724 function (focusable) {
1727 oldFocusable = this.focusable;
1728 this.focusable = focusable;
1729 }this.$isFocusTraversableOverridden = 2;
1730 this.firePropertyChangeObject ("focusable", new Boolean (oldFocusable), new Boolean (focusable));
1732 Clazz.defineMethod (c$, "isFocusTraversableOverridden",
1734 return (this.$isFocusTraversableOverridden != 1);
1736 Clazz.defineMethod (c$, "getFocusTraversalKeysEnabled",
1738 return this.focusTraversalKeysEnabled;
1740 Clazz.defineMethod (c$, "requestFocus",
1742 swingjs.JSToolkit.requestFocus (this);
1744 Clazz.defineMethod (c$, "requestFocus",
1745 function (temporary) {
1746 return swingjs.JSToolkit.requestFocus (this);
1748 Clazz.defineMethod (c$, "requestFocusInWindow",
1750 return swingjs.JSToolkit.requestFocus (this);
1752 Clazz.defineMethod (c$, "requestFocusInWindow",
1753 function (temporary) {
1754 return swingjs.JSToolkit.requestFocus (this);
1756 Clazz.defineMethod (c$, "getFocusCycleRootAncestor",
1758 var rootAncestor = this.parent;
1759 while (rootAncestor != null && !rootAncestor.isFocusCycleRoot ()) {
1760 rootAncestor = rootAncestor.parent;
1762 return rootAncestor;
1764 Clazz.defineMethod (c$, "isFocusCycleRoot",
1765 function (container) {
1766 return this.isFocusCycleRootComp (container);
1767 }, "java.awt.Container");
1768 Clazz.defineMethod (c$, "isFocusCycleRootComp",
1769 function (container) {
1770 var rootAncestor = this.getFocusCycleRootAncestor ();
1771 return (rootAncestor === container);
1772 }, "java.awt.Container");
1773 Clazz.defineMethod (c$, "hasFocus",
1775 return swingjs.JSToolkit.hasFocus (this);
1777 Clazz.defineMethod (c$, "isFocusOwner",
1779 return this.hasFocus ();
1781 Clazz.defineMethod (c$, "setAutoFocusTransferOnDisposal",
1783 this.autoFocusTransferOnDisposal = value;
1785 Clazz.defineMethod (c$, "isAutoFocusTransferOnDisposal",
1787 return this.autoFocusTransferOnDisposal;
1789 Clazz.defineMethod (c$, "paramString",
1791 return this.paramStringComp ();
1793 Clazz.defineMethod (c$, "paramStringComp",
1795 var thisName = this.getName ();
1796 var str = (thisName != null ? thisName : "");
1797 if (!this.isValid ()) {
1799 }if (!this.visible) {
1801 }if (!this.enabled) {
1803 }str += ",parent:" + (this.parent == null ? null : this.parent.getName ()) + "," + this.x + "," + this.y + "," + this.width + "x" + this.height;
1806 Clazz.overrideMethod (c$, "toString",
1808 return this.getClass ().getName () + "[" + this.paramString () + "]";
1810 Clazz.defineMethod (c$, "addPropertyChangeListener",
1811 function (listener) {
1812 this.addPropChangeListenerComp (listener);
1813 }, "java.beans.PropertyChangeListener");
1814 Clazz.defineMethod (c$, "addPropChangeListenerComp",
1815 function (listener) {
1817 if (listener == null) {
1819 }if (this.changeSupport == null) {
1820 this.changeSupport = new java.beans.PropertyChangeSupport (this);
1821 }this.changeSupport.addPropertyChangeListener1 (listener);
1822 }}, "java.beans.PropertyChangeListener");
1823 Clazz.defineMethod (c$, "removePropertyChangeListener",
1824 function (listener) {
1826 if (listener == null || this.changeSupport == null) {
1828 }this.changeSupport.removePropertyChangeListener (listener);
1829 }}, "java.beans.PropertyChangeListener");
1830 Clazz.defineMethod (c$, "getPropertyChangeListeners",
1833 if (this.changeSupport == null) {
1834 return new Array (0);
1835 }return this.changeSupport.getPropertyChangeListeners ();
1837 Clazz.defineMethod (c$, "addPropertyChangeListener",
1838 function (propertyName, listener) {
1839 this.addPropChangeListComp (propertyName, listener);
1840 }, "~S,java.beans.PropertyChangeListener");
1841 Clazz.defineMethod (c$, "addPropChangeListComp",
1842 function (propertyName, listener) {
1844 if (arguments.length == 1) {
1845 addPropertyChangeListener1(propertyName); return; }
1847 if (listener == null) {
1849 }if (this.changeSupport == null) {
1850 this.changeSupport = new java.beans.PropertyChangeSupport (this);
1851 }this.changeSupport.addPropertyChangeListener2 (propertyName, listener);
1852 }}, "~S,java.beans.PropertyChangeListener");
1853 Clazz.defineMethod (c$, "removePropertyChangeListener",
1854 function (propertyName, listener) {
1856 if (listener == null || this.changeSupport == null) {
1858 }this.changeSupport.removePropertyChangeListener (propertyName, listener);
1859 }}, "~S,java.beans.PropertyChangeListener");
1860 Clazz.defineMethod (c$, "getPropertyChangeListeners",
1861 function (propertyName) {
1863 if (this.changeSupport == null) {
1864 return new Array (0);
1865 }return this.changeSupport.getPropertyChangeListeners (propertyName);
1867 Clazz.defineMethod (c$, "firePropertyChange",
1868 function (propertyName, oldValue, newValue) {
1869 this.firePropertyChangeObject (propertyName, oldValue, newValue);
1871 Clazz.defineMethod (c$, "firePropertyChangeObject",
1872 function (propertyName, oldValue, newValue) {
1875 changeSupport = this.changeSupport;
1876 }if (changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) {
1878 }changeSupport.firePropertyChange (propertyName, oldValue, newValue);
1880 Clazz.defineMethod (c$, "firePropertyChange",
1881 function (propertyName, oldValue, newValue) {
1882 this.firePropertyChangeBool (propertyName, oldValue, newValue);
1884 Clazz.defineMethod (c$, "firePropertyChangeBool",
1885 function (propertyName, oldValue, newValue) {
1886 var changeSupport = this.changeSupport;
1887 if (changeSupport == null || oldValue == newValue) {
1889 }changeSupport.firePropertyChange (propertyName, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue));
1891 Clazz.defineMethod (c$, "firePropertyChange",
1892 function (propertyName, oldValue, newValue) {
1893 this.firePropertyChangeInt (propertyName, oldValue, newValue);
1895 Clazz.defineMethod (c$, "firePropertyChangeInt",
1896 function (propertyName, oldValue, newValue) {
1897 var changeSupport = this.changeSupport;
1898 if (changeSupport == null || oldValue == newValue) {
1900 }changeSupport.firePropertyChange (propertyName, Integer.$valueOf (oldValue), Integer.$valueOf (newValue));
1902 Clazz.defineMethod (c$, "firePropertyChange",
1903 function (propertyName, oldValue, newValue) {
1904 this.firePropertyChangeChar (propertyName, oldValue, newValue);
1906 Clazz.defineMethod (c$, "firePropertyChangeChar",
1907 function (propertyName, oldValue, newValue) {
1908 if (this.changeSupport == null || oldValue == newValue) {
1910 }this.firePropertyChangeObject (propertyName, new Character (oldValue), new Character (newValue));
1912 Clazz.defineMethod (c$, "firePropertyChangeShort",
1913 function (propertyName, oldValue, newValue) {
1914 if (this.changeSupport == null || oldValue == newValue) {
1916 }this.firePropertyChangeObject (propertyName, Short.$valueOf (oldValue), Short.$valueOf (newValue));
1918 Clazz.defineMethod (c$, "firePropertyChangeLong",
1919 function (propertyName, oldValue, newValue) {
1920 if (this.changeSupport == null || oldValue == newValue) {
1922 }this.firePropertyChangeObject (propertyName, Long.$valueOf (oldValue), Long.$valueOf (newValue));
1924 Clazz.defineMethod (c$, "firePropertyChangeFloat",
1925 function (propertyName, oldValue, newValue) {
1926 if (this.changeSupport == null || oldValue == newValue) {
1928 }this.firePropertyChangeObject (propertyName, Float.$valueOf (oldValue), Float.$valueOf (newValue));
1930 Clazz.defineMethod (c$, "firePropertyChangeDouble",
1931 function (propertyName, oldValue, newValue) {
1932 if (this.changeSupport == null || oldValue == newValue) {
1934 }this.firePropertyChangeObject (propertyName, Double.$valueOf (oldValue), Double.$valueOf (newValue));
1936 Clazz.defineMethod (c$, "setComponentOrientation",
1938 var oldValue = this.componentOrientation;
1939 this.componentOrientation = o;
1940 this.firePropertyChangeObject ("componentOrientation", oldValue, o);
1941 this.invalidateIfValid ();
1942 }, "java.awt.ComponentOrientation");
1943 Clazz.defineMethod (c$, "getComponentOrientation",
1945 return this.componentOrientation;
1947 Clazz.defineMethod (c$, "applyComponentOrientation",
1948 function (orientation) {
1949 this.applyCompOrientComp (orientation);
1950 }, "java.awt.ComponentOrientation");
1951 Clazz.defineMethod (c$, "applyCompOrientComp",
1952 function (orientation) {
1953 if (orientation == null) {
1954 throw new NullPointerException ();
1955 }this.setComponentOrientation (orientation);
1956 }, "java.awt.ComponentOrientation");
1957 Clazz.defineMethod (c$, "canBeFocusOwner",
1959 if (this.isEnabled () && this.isDisplayable () && this.isVisible () && this.isFocusable ()) {
1963 Clazz.defineMethod (c$, "canBeFocusOwnerRecursively",
1965 if (!this.canBeFocusOwner ()) {
1967 }if (this.parent != null) {
1968 return this.parent.canContainFocusOwner (this);
1971 Clazz.defineMethod (c$, "relocateComponent",
1974 Clazz.defineMethod (c$, "getContainingWindow",
1976 return jssun.awt.SunToolkit.getContainingWindow (this);
1978 c$.isInstanceOf = Clazz.defineMethod (c$, "isInstanceOf",
1979 function (obj, className) {
1980 if (obj == null) return false;
1981 if (className == null) return false;
1982 var cls = obj.getClass ();
1983 while (cls != null) {
1984 if (cls.getName ().equals (className)) {
1986 }cls = cls.getSuperclass ();
1990 Clazz.defineMethod (c$, "areBoundsValid",
1992 var cont = this.getContainer ();
1993 return cont == null || cont.isValid () || cont.getLayout () == null;
1995 Clazz.defineMethod (c$, "getLocationOnWindow",
1997 var curLocation = this.getLocation ();
1998 for (var parent = this.getContainer (); parent != null && !(Clazz.instanceOf (parent, java.awt.Window)); parent = parent.getContainer ()) {
1999 curLocation.x += parent.getX ();
2000 curLocation.y += parent.getY ();
2004 Clazz.defineMethod (c$, "getSiblingIndexAbove",
2006 var parent = this.getContainer ();
2007 if (parent == null) {
2009 }var nextAbove = parent.getComponentZOrder (this) - 1;
2010 return nextAbove < 0 ? -1 : nextAbove;
2012 Clazz.defineMethod (c$, "getSiblingIndexBelow",
2014 var parent = this.getContainer ();
2015 if (parent == null) {
2017 }var nextBelow = parent.getComponentZOrder (this) + 1;
2018 return nextBelow >= parent.getComponentCount () ? -1 : nextBelow;
2020 Clazz.defineMethod (c$, "mixOnShowing",
2023 Clazz.defineMethod (c$, "mixOnHiding",
2024 function (isLightweight) {
2026 Clazz.defineMethod (c$, "mixOnReshaping",
2028 swingjs.JSToolkit.taintUI (this);
2030 Clazz.defineMethod (c$, "mixOnZOrderChanging",
2031 function (oldZorder, newZorder) {
2033 Clazz.defineMethod (c$, "mixOnValidating",
2036 c$.doesClassImplement = Clazz.defineMethod (c$, "doesClassImplement",
2037 function (cls, interfaceName) {
2038 if (cls == null) return false;
2039 for (var c, $c = 0, $$c = cls.getInterfaces (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) {
2040 if (c.getName ().equals (interfaceName)) {
2043 return java.awt.Component.doesClassImplement (cls.getSuperclass (), interfaceName);
2045 c$.doesImplement = Clazz.defineMethod (c$, "doesImplement",
2046 function (obj, interfaceName) {
2047 if (obj == null) return false;
2048 if (interfaceName == null) return false;
2049 return java.awt.Component.doesClassImplement (obj.getClass (), interfaceName);
2051 Clazz.pu$h(self.c$);
2052 c$ = Clazz.declareType (java.awt.Component, "BaselineResizeBehavior", Enum);
2053 Clazz.defineEnumConstant (c$, "CONSTANT_ASCENT", 0, []);
2054 Clazz.defineEnumConstant (c$, "CONSTANT_DESCENT", 1, []);
2055 Clazz.defineEnumConstant (c$, "CENTER_OFFSET", 2, []);
2056 Clazz.defineEnumConstant (c$, "OTHER", 3, []);
2058 Clazz.pu$h(self.c$);
2059 c$ = Clazz.declareType (java.awt.Component, "AWTTreeLock");
2061 Clazz.defineStatics (c$,
2062 "FOCUS_TRAVERSABLE_UNKNOWN", 0,
2063 "FOCUS_TRAVERSABLE_DEFAULT", 1,
2064 "FOCUS_TRAVERSABLE_SET", 2,
2065 "actionListenerK", "actionL",
2066 "adjustmentListenerK", "adjustmentL",
2067 "componentListenerK", "componentL",
2068 "containerListenerK", "containerL",
2069 "focusListenerK", "focusL",
2070 "itemListenerK", "itemL",
2071 "keyListenerK", "keyL",
2072 "mouseListenerK", "mouseL",
2073 "mouseMotionListenerK", "mouseMotionL",
2074 "mouseWheelListenerK", "mouseWheelL",
2075 "textListenerK", "textL",
2076 "ownedWindowK", "ownedL",
2077 "windowListenerK", "windowL",
2078 "inputMethodListenerK", "inputMethodL",
2079 "hierarchyListenerK", "hierarchyL",
2080 "hierarchyBoundsListenerK", "hierarchyBoundsL",
2081 "windowStateListenerK", "windowStateL",
2082 "windowFocusListenerK", "windowFocusL",
2085 "TOP_ALIGNMENT", 0.0,
2086 "CENTER_ALIGNMENT", 0.5,
2087 "BOTTOM_ALIGNMENT", 1.0,
2088 "LEFT_ALIGNMENT", 0.0,
2089 "RIGHT_ALIGNMENT", 1.0,
2091 c$.coalesceMap = c$.prototype.coalesceMap = new java.util.HashMap ();