1 /*
   2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation. Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package org.netbeans.jemmy.operators;
  26 
  27 import java.awt.AWTEvent;
  28 import java.awt.Color;
  29 import java.awt.Component;
  30 import java.awt.ComponentOrientation;
  31 import java.awt.Container;
  32 import java.awt.Cursor;
  33 import java.awt.Dimension;
  34 import java.awt.Font;
  35 import java.awt.FontMetrics;
  36 import java.awt.Graphics;
  37 import java.awt.Image;
  38 import java.awt.MenuComponent;
  39 import java.awt.Point;
  40 import java.awt.PopupMenu;
  41 import java.awt.Rectangle;
  42 import java.awt.Toolkit;
  43 import java.awt.Window;
  44 import java.awt.dnd.DropTarget;
  45 import java.awt.event.ComponentListener;
  46 import java.awt.event.FocusListener;
  47 import java.awt.event.InputMethodListener;
  48 import java.awt.event.KeyListener;
  49 import java.awt.event.MouseListener;
  50 import java.awt.event.MouseMotionListener;
  51 import java.awt.im.InputContext;
  52 import java.awt.im.InputMethodRequests;
  53 import java.awt.image.ColorModel;
  54 import java.awt.image.ImageObserver;
  55 import java.awt.image.ImageProducer;
  56 import java.beans.PropertyChangeListener;
  57 import java.io.PrintStream;
  58 import java.io.PrintWriter;
  59 import java.util.Hashtable;
  60 import java.util.Locale;
  61 
  62 import static java.lang.Math.abs;
  63 
  64 import org.netbeans.jemmy.CharBindingMap;
  65 import org.netbeans.jemmy.ComponentChooser;
  66 import org.netbeans.jemmy.ComponentSearcher;
  67 import org.netbeans.jemmy.EventDispatcher;
  68 import org.netbeans.jemmy.JemmyException;
  69 import org.netbeans.jemmy.JemmyProperties;
  70 import org.netbeans.jemmy.Outputable;
  71 import org.netbeans.jemmy.QueueTool;
  72 import org.netbeans.jemmy.TestOut;
  73 import org.netbeans.jemmy.TimeoutExpiredException;
  74 import org.netbeans.jemmy.Timeoutable;
  75 import org.netbeans.jemmy.Timeouts;
  76 import org.netbeans.jemmy.Waitable;
  77 import org.netbeans.jemmy.Waiter;
  78 import org.netbeans.jemmy.drivers.DriverManager;
  79 import org.netbeans.jemmy.drivers.FocusDriver;
  80 import org.netbeans.jemmy.drivers.KeyDriver;
  81 import org.netbeans.jemmy.drivers.MouseDriver;
  82 
  83 /**
  84  * Root class for all component operators.
  85  *
  86  * Provides basic methods to operate with mouse and keyboard.<BR>
  87  * <BR>
  88  * Almost all input methods can throw JemmyInputException or its subclass.<BR>
  89  *
  90  * ComponentOperator and its subclasses has a lot of methods which name and
  91  * parameters just like consistent component has. In this case operator class
  92  * just invokes consistent component method through AWT Event Queue
  93  * (invokeAndWait method).
  94  *
  95  * <BR><BR>Timeouts used: <BR>
  96  * ComponentOperator.PushKeyTimeout - time between key pressing and releasing
  97  * <BR>
  98  * ComponentOperator.MouseClickTimeout - time between mouse pressing and
  99  * releasing <BR>
 100  * ComponentOperator.WaitComponentTimeout - time to wait component displayed
 101  * <BR>
 102  * ComponentOperator.WaitComponentEnabledTimeout - time to wait component
 103  * enabled <BR>
 104  * ComponentOperator.BeforeDragTimeout - time to sleep before grag'n'drop
 105  * operations <BR>
 106  * ComponentOperator.AfterDragTimeout - time to sleep after grag'n'drop
 107  * operations <BR>
 108  * ComponentOperator.WaitFocusTimeout - time to wait component focus <BR>
 109  * ComponentOperator.WaitStateTimeout- time to wait component to be in some
 110  * state. Typically used from methods like
 111  * {@code Operator.wait"something happened"(*)}<br>.
 112  *
 113  * @see org.netbeans.jemmy.Timeouts
 114  *
 115  * @author Alexandre Iline (alexandre.iline@oracle.com)
 116  */
 117 public class ComponentOperator extends Operator
 118         implements Timeoutable, Outputable {
 119 
 120     /**
 121      * Identifier for a name property.
 122      *
 123      * @see #getDump
 124      */
 125     public static final String NAME_DPROP = "Name:";
 126 
 127     /**
 128      * Identifier for a visible property.
 129      *
 130      * @see #getDump
 131      */
 132     public static final String IS_VISIBLE_DPROP = "Visible";
 133 
 134     /**
 135      * Identifier for a showing property.
 136      *
 137      * @see #getDump
 138      */
 139     public static final String IS_SHOWING_DPROP = "Showing";
 140 
 141     /**
 142      * Identifier for a x coordinate property.
 143      *
 144      * @see #getDump
 145      */
 146     public static final String X_DPROP = "X";
 147 
 148     /**
 149      * Identifier for a y coordinate property.
 150      *
 151      * @see #getDump
 152      */
 153     public static final String Y_DPROP = "Y";
 154 
 155     /**
 156      * Identifier for a width property.
 157      *
 158      * @see #getDump
 159      */
 160     public static final String WIDTH_DPROP = "Width";
 161 
 162     /**
 163      * Identifier for a height property.
 164      *
 165      * @see #getDump
 166      */
 167     public static final String HEIGHT_DPROP = "Height";
 168 
 169     private static final long PUSH_KEY_TIMEOUT = 0;
 170     private static final long MOUSE_CLICK_TIMEOUT = 0;
 171     private static final long BEFORE_DRAG_TIMEOUT = 0;
 172     private static final long AFTER_DRAG_TIMEOUT = 0;
 173     private static final long WAIT_COMPONENT_TIMEOUT = 60000;
 174     private static final long WAIT_COMPONENT_ENABLED_TIMEOUT = 60000;
 175     private static final long WAIT_FOCUS_TIMEOUT = 60000;
 176     private static final long WAIT_STATE_TIMEOUT = 60000;
 177 
 178     private final Component source;
 179     private volatile Timeouts timeouts; // used in invokeSmoothly in clickMouse
 180     private volatile TestOut output; // used in QueueTool.Locker
 181     private volatile EventDispatcher dispatcher; // used in JInternalFrameByTitleFinder.checkComponent
 182     private KeyDriver kDriver;
 183     private MouseDriver mDriver;
 184     private FocusDriver fDriver;
 185 
 186     /**
 187      * Constructor.
 188      *
 189      * @param comp a component
 190      */
 191     public ComponentOperator(Component comp) {
 192         super();
 193         source = comp;
 194         kDriver = DriverManager.getKeyDriver(getClass());
 195         mDriver = DriverManager.getMouseDriver(getClass());
 196         fDriver = DriverManager.getFocusDriver(getClass());
 197         setEventDispatcher(new EventDispatcher(comp));
 198     }
 199 
 200     /**
 201      * Constructs a ComponentOperator object.
 202      *
 203      * @param cont container
 204      * @param chooser a component chooser specifying searching criteria.
 205      * @param index an index between appropriate ones.
 206      */
 207     public ComponentOperator(ContainerOperator<?> cont, ComponentChooser chooser, int index) {
 208         this(waitComponent((Container) cont.getSource(),
 209                 chooser,
 210                 index, cont.getTimeouts(), cont.getOutput()));
 211         copyEnvironment(cont);
 212     }
 213 
 214     /**
 215      * Constructs a ComponentOperator object.
 216      *
 217      * @param cont container
 218      * @param chooser a component chooser specifying searching criteria.
 219      */
 220     public ComponentOperator(ContainerOperator<?> cont, ComponentChooser chooser) {
 221         this(cont, chooser, 0);
 222     }
 223 
 224     /**
 225      * Constructor. Waits for a component in a container to show. The component
 226      * is iis the {@code index+1}'th {@code java.awt.Component} that
 227      * shows and that lies below the container in the display containment
 228      * hierarchy. Uses cont's timeout and output for waiting and to init
 229      * operator.
 230      *
 231      * @param cont Operator for a java.awt.Container.
 232      * @param index an index between appropriate ones.
 233      * @throws TimeoutExpiredException
 234      */
 235     public ComponentOperator(ContainerOperator<?> cont, int index) {
 236         this(cont, ComponentSearcher.getTrueChooser("Any component"), index);
 237     }
 238 
 239     /**
 240      * Constructor. Waits for a component in a container to show. The component
 241      * is is the first {@code java.awt.Component} that shows and that lies
 242      * below the container in the display containment hierarchy. Uses cont's
 243      * timeout and output for waiting and to init operator.
 244      *
 245      * @param cont Operator for a java.awt.Container.
 246      * @throws TimeoutExpiredException
 247      */
 248     public ComponentOperator(ContainerOperator<?> cont) {
 249         this(cont, 0);
 250     }
 251 
 252     /**
 253      * Searches Component in container.
 254      *
 255      * @param cont Container to search component in.
 256      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 257      * @param index Ordinal component index.
 258      * @return Component instance or null if component was not found.
 259      */
 260     public static Component findComponent(Container cont, ComponentChooser chooser, int index) {
 261         return findComponent(cont, chooser, index, false);
 262     }
 263 
 264     /**
 265      * Searches Component in container.
 266      *
 267      * @param cont Container to search component in.
 268      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 269      * @return Component instance or null if component was not found.
 270      */
 271     public static Component findComponent(Container cont, ComponentChooser chooser) {
 272         return findComponent(cont, chooser, 0);
 273     }
 274 
 275     /**
 276      * Waits Component in container.
 277      *
 278      * @param cont Container to search component in.
 279      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 280      * @param index Ordinal component index.
 281      * @return Component instance or null if component was not found.
 282      * @throws TimeoutExpiredException
 283      */
 284     public static Component waitComponent(Container cont, ComponentChooser chooser, int index) {
 285         return (waitComponent(cont, chooser, index,
 286                 JemmyProperties.getCurrentTimeouts(),
 287                 JemmyProperties.getCurrentOutput()));
 288     }
 289 
 290     /**
 291      * Waits Component in container.
 292      *
 293      * @param cont Container to search component in.
 294      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 295      * @return Component instance or null if component was not found.
 296      * @throws TimeoutExpiredException
 297      */
 298     public static Component waitComponent(Container cont, ComponentChooser chooser) {
 299         return waitComponent(cont, chooser, 0);
 300     }
 301 
 302     /**
 303      * A method to be used from subclasses. Uses {@code contOper}'s
 304      * timeouts and output during the waiting.
 305      *
 306      * @param contOper Container to search component in.
 307      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 308      * @param index Ordinal component index.
 309      * @return Component instance or null if component was not found.
 310      * @throws TimeoutExpiredException
 311      */
 312     protected static Component waitComponent(ContainerOperator<?> contOper,
 313             ComponentChooser chooser, int index) {
 314         return (waitComponent((Container) contOper.getSource(),
 315                 chooser, index,
 316                 contOper.getTimeouts(),
 317                 contOper.getOutput()));
 318     }
 319 
 320     /**
 321      * A method to be used from subclasses. Uses timeouts and output passed as
 322      * parameters during the waiting.
 323      *
 324      * @param cont Container to search component in.
 325      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 326      * @param index Ordinal component index.
 327      * @param timeouts timeouts to be used during the waiting.
 328      * @param output an output to be used during the waiting.
 329      * @return Component instance or null if component was not found.
 330      * @throws TimeoutExpiredException
 331      */
 332     protected static Component waitComponent(final Container cont,
 333             final ComponentChooser chooser,
 334             final int index,
 335             Timeouts timeouts, final TestOut output) {
 336         try {
 337             Waiter<Component, Void> waiter = new Waiter<>(new Waitable<Component, Void>() {
 338                 @Override
 339                 public Component actionProduced(Void obj) {
 340                     return findComponent(cont, new VisibleComponentFinder(chooser), index,
 341                             output.createErrorOutput());
 342                 }
 343 
 344                 @Override
 345                 public String getDescription() {
 346                     return "Wait " + chooser.getDescription() + " loaded";
 347                 }
 348 
 349                 @Override
 350                 public String toString() {
 351                     return "ComponentOperator.waitComponent.Waitable{description = " + getDescription() + '}';
 352                 }
 353             });
 354             waiter.setTimeoutsToCloneOf(timeouts, "ComponentOperator.WaitComponentTimeout");
 355             waiter.setOutput(output);
 356             return waiter.waitAction(null);
 357         } catch (InterruptedException e) {
 358             return null;
 359         }
 360     }
 361 
 362     /**
 363      * Searches Components in container.
 364      *
 365      * @param cont Container to search components in.
 366      * @param chooser org.netbeans.jemmy.ComponentChooser implementation.
 367      * @return Component array or empty array if component was not found.
 368      */
 369     public static Component[] findComponents(Container cont, ComponentChooser chooser) {
 370         ComponentSearcher searcher = new ComponentSearcher(cont);
 371         return searcher.findComponents(new VisibleComponentFinder(chooser));
 372     }
 373 
 374     private static Component findComponent(Container cont, ComponentChooser chooser, int index, TestOut output) {
 375         ComponentSearcher searcher = new ComponentSearcher(cont);
 376         searcher.setOutput(output);
 377         return searcher.findComponent(new VisibleComponentFinder(chooser), index);
 378     }
 379 
 380     private static Component findComponent(Container cont, ComponentChooser chooser, int index, boolean supressOutout) {
 381         return findComponent(cont, chooser, index, JemmyProperties.getCurrentOutput().createErrorOutput());
 382     }
 383 
 384     static {
 385         Timeouts.initDefault("ComponentOperator.PushKeyTimeout", PUSH_KEY_TIMEOUT);
 386         Timeouts.initDefault("ComponentOperator.MouseClickTimeout", MOUSE_CLICK_TIMEOUT);
 387         Timeouts.initDefault("ComponentOperator.BeforeDragTimeout", BEFORE_DRAG_TIMEOUT);
 388         Timeouts.initDefault("ComponentOperator.AfterDragTimeout", AFTER_DRAG_TIMEOUT);
 389         Timeouts.initDefault("ComponentOperator.WaitComponentTimeout", WAIT_COMPONENT_TIMEOUT);
 390         Timeouts.initDefault("ComponentOperator.WaitComponentEnabledTimeout", WAIT_COMPONENT_ENABLED_TIMEOUT);
 391         Timeouts.initDefault("ComponentOperator.WaitStateTimeout", WAIT_STATE_TIMEOUT);
 392         Timeouts.initDefault("ComponentOperator.WaitFocusTimeout", WAIT_FOCUS_TIMEOUT);
 393     }
 394 
 395     /**
 396      * Returns component.
 397      */
 398     @Override
 399     public Component getSource() {
 400         return source;
 401     }
 402 
 403     /**
 404      * Returns org.netbeans.jemmy.EventDispatcher instance which is used to
 405      * dispatch events.
 406      *
 407      * @return the dispatcher.
 408      * @see org.netbeans.jemmy.EventDispatcher
 409      */
 410     public EventDispatcher getEventDispatcher() {
 411         return dispatcher;
 412     }
 413 
 414     ////////////////////////////////////////////////////////
 415     //Environment                                         //
 416     ////////////////////////////////////////////////////////
 417     @Override
 418     public void setOutput(TestOut out) {
 419         super.setOutput(out);
 420         this.output = out;
 421         if (dispatcher != null) {
 422             dispatcher.setOutput(output.createErrorOutput());
 423         }
 424     }
 425 
 426     @Override
 427     public TestOut getOutput() {
 428         return output;
 429     }
 430 
 431     @Override
 432     public void setTimeouts(Timeouts timeouts) {
 433         super.setTimeouts(timeouts);
 434         this.timeouts = timeouts;
 435         if (dispatcher != null) {
 436             dispatcher.setTimeouts(getTimeouts());
 437         }
 438     }
 439 
 440     @Override
 441     public Timeouts getTimeouts() {
 442         return timeouts;
 443     }
 444 
 445     @Override
 446     public void copyEnvironment(Operator anotherOperator) {
 447         super.copyEnvironment(anotherOperator);
 448         kDriver = (KeyDriver) DriverManager.
 449                 getDriver(DriverManager.KEY_DRIVER_ID,
 450                         getClass(),
 451                         anotherOperator.getProperties());
 452         mDriver = (MouseDriver) DriverManager.
 453                 getDriver(DriverManager.MOUSE_DRIVER_ID,
 454                         getClass(),
 455                         anotherOperator.getProperties());
 456         fDriver = (FocusDriver) DriverManager.
 457                 getDriver(DriverManager.FOCUS_DRIVER_ID,
 458                         getClass(),
 459                         anotherOperator.getProperties());
 460     }
 461 
 462     ////////////////////////////////////////////////////////
 463     //Mouse operations
 464     ////////////////////////////////////////////////////////
 465     /**
 466      * Makes mouse click.
 467      *
 468      * @param x Horizontal click coordinate
 469      * @param y Vertical click coordinate
 470      * @param clickCount Click count
 471      * @param mouseButton Mouse button (InputEvent.BUTTON1/2/3_MASK value)
 472      * @param modifiers Modifiers (combination of InputEvent.*_MASK values)
 473      * @param forPopup signals that click is intended to call popup.
 474      */
 475     public void clickMouse(final int x, final int y, final int clickCount, final int mouseButton,
 476             final int modifiers, final boolean forPopup) {
 477         getQueueTool().invokeSmoothly(new QueueTool.QueueAction<Void>("Path selecting") {
 478             @Override
 479             public Void launch() {
 480                 mDriver.clickMouse(ComponentOperator.this, x, y, clickCount, mouseButton, modifiers,
 481                         timeouts.create("ComponentOperator.MouseClickTimeout"));
 482                 return null;
 483             }
 484         });
 485     }
 486 
 487     /**
 488      * Makes mouse click.
 489      *
 490      * @param x Horizontal click coordinate
 491      * @param y Vertical click coordinate
 492      * @param clickCount Click count
 493      * @param mouseButton Mouse button (InputEvent.BUTTON1/2/3_MASK value)
 494      * @param modifiers Modifiers (combination of InputEvent.*_MASK values)
 495      * @see #clickMouse(int, int, int, int, int, boolean)
 496      */
 497     public void clickMouse(int x, int y, int clickCount, int mouseButton, int modifiers) {
 498         clickMouse(x, y, clickCount, mouseButton, modifiers, false);
 499     }
 500 
 501     /**
 502      * Makes mouse click with 0 modifiers.
 503      *
 504      * @param x Horizontal click coordinate
 505      * @param y Vertical click coordinate
 506      * @param clickCount Click count
 507      * @param mouseButton Mouse button (InputEvent.BUTTON1/2/3_MASK value)
 508      * @see #clickMouse(int, int, int, int, int)
 509      */
 510     public void clickMouse(int x, int y, int clickCount, int mouseButton) {
 511         clickMouse(x, y, clickCount, mouseButton, 0);
 512     }
 513 
 514     /**
 515      * Makes mouse click by default mouse button with 0 modifiers.
 516      *
 517      * @param x Horizontal click coordinate
 518      * @param y Vertical click coordinate
 519      * @param clickCount Click count
 520      * @see #clickMouse(int, int, int, int)
 521      * @see #getDefaultMouseButton()
 522      */
 523     public void clickMouse(int x, int y, int clickCount) {
 524         clickMouse(x, y, clickCount, getDefaultMouseButton());
 525     }
 526 
 527     /**
 528      * Press mouse.
 529      *
 530      * @param x Horizontal click coordinate
 531      * @param y Vertical click coordinate
 532      */
 533     public void pressMouse(int x, int y) {
 534         mDriver.pressMouse(this, x, y, getDefaultMouseButton(), 0);
 535     }
 536 
 537     /**
 538      * Releases mouse.
 539      *
 540      * @param x Horizontal click coordinate
 541      * @param y Vertical click coordinate
 542      */
 543     public void releaseMouse(int x, int y) {
 544         mDriver.releaseMouse(this, x, y, getDefaultMouseButton(), 0);
 545     }
 546 
 547     /**
 548      * Move mouse over the component.
 549      *
 550      * @param x Horisontal destination coordinate.
 551      * @param y Vertical destination coordinate.
 552      */
 553     public void moveMouse(int x, int y) {
 554         mDriver.moveMouse(this, x, y);
 555     }
 556 
 557     /**
 558      * Drag mouse over the component.
 559      *
 560      * @param x Horisontal destination coordinate.
 561      * @param y Vertical destination coordinate.
 562      * @param mouseButton Mouse button
 563      * @param modifiers Modifiers
 564      */
 565     public void dragMouse(int x, int y, int mouseButton, int modifiers) {
 566         mDriver.dragMouse(this, x, y, getDefaultMouseButton(), 0);
 567     }
 568 
 569     /**
 570      * Drag mouse over the component with 0 modifiers.
 571      *
 572      * @param x Horisontal destination coordinate.
 573      * @param y Vertical destination coordinate.
 574      * @param mouseButton Mouse button
 575      * @see #dragMouse(int, int, int, int)
 576      */
 577     public void dragMouse(int x, int y, int mouseButton) {
 578         dragMouse(x, y, mouseButton, 0);
 579     }
 580 
 581     /**
 582      * Drag mouse over the component with 0 modifiers and default mose button
 583      * pressed.
 584      *
 585      * @param x Horisontal destination coordinate.
 586      * @param y Vertical destination coordinate.
 587      * @see #dragMouse(int, int, int)
 588      * @see #getDefaultMouseButton()
 589      */
 590     public void dragMouse(int x, int y) {
 591         dragMouse(x, y, getDefaultMouseButton());
 592     }
 593 
 594     /**
 595      * Makes drag'n'drop operation.
 596      *
 597      * @param start_x Start horizontal coordinate
 598      * @param start_y Start vertical coordinate
 599      * @param end_x End horizontal coordinate
 600      * @param end_y End vertical coordinate
 601      * @param mouseButton Mouse button
 602      * @param modifiers Modifiers
 603      */
 604     public void dragNDrop(int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers) {
 605         mDriver.dragNDrop(this, start_x, start_y, end_x, end_y, mouseButton, modifiers,
 606                 timeouts.create("ComponentOperator.BeforeDragTimeout"),
 607                 timeouts.create("ComponentOperator.AfterDragTimeout"));
 608     }
 609 
 610     /**
 611      * Makes drag'n'drop operation with 0 modifiers.
 612      *
 613      * @param start_x Start horizontal coordinate
 614      * @param start_y Start vertical coordinate
 615      * @param end_x End horizontal coordinate
 616      * @param end_y End vertical coordinate
 617      * @param mouseButton Mouse button
 618      * @see #dragNDrop(int, int, int, int, int, int)
 619      */
 620     public void dragNDrop(int start_x, int start_y, int end_x, int end_y, int mouseButton) {
 621         dragNDrop(start_x, start_y, end_x, end_y, mouseButton, 0);
 622     }
 623 
 624     /**
 625      * Makes drag'n'drop operation by default mouse buttons with 0 modifiers.
 626      *
 627      * @param start_x Start horizontal coordinate
 628      * @param start_y Start vertical coordinate
 629      * @param end_x End horizontal coordinate
 630      * @param end_y End vertical coordinate
 631      * @see #dragNDrop(int, int, int, int, int)
 632      * @see #getDefaultMouseButton()
 633      */
 634     public void dragNDrop(int start_x, int start_y, int end_x, int end_y) {
 635         dragNDrop(start_x, start_y, end_x, end_y, getDefaultMouseButton(), 0);
 636     }
 637 
 638     /**
 639      * Clicks for popup.
 640      *
 641      * @param x Horizontal click coordinate.
 642      * @param y Vertical click coordinate.
 643      * @param mouseButton Mouse button.
 644      * @see #clickMouse(int, int, int, int, int, boolean)
 645      */
 646     public void clickForPopup(int x, int y, int mouseButton) {
 647         makeComponentVisible();
 648         clickMouse(x, y, 1, mouseButton, 0, true);
 649     }
 650 
 651     /**
 652      * Clicks for popup by popup mouse button.
 653      *
 654      * @param x Horizontal click coordinate.
 655      * @param y Vertical click coordinate.
 656      * @see #clickForPopup(int, int, int)
 657      * @see #getPopupMouseButton()
 658      */
 659     public void clickForPopup(int x, int y) {
 660         clickForPopup(x, y, getPopupMouseButton());
 661     }
 662 
 663     /**
 664      * Makes mouse click on the component center with 0 modifiers.
 665      *
 666      * @param clickCount Click count
 667      * @param mouseButton Mouse button (InputEvent.BUTTON1/2/3_MASK value)
 668      * @see #clickMouse(int, int, int, int)
 669      */
 670     public void clickMouse(final int clickCount, final int mouseButton) {
 671         getQueueTool().invokeSmoothly(new QueueTool.QueueAction<Void>("Clicking the mouse button") {
 672             @Override
 673             public Void launch() {
 674                 clickMouse(getCenterXForClick(), getCenterYForClick(), clickCount, mouseButton);
 675                 return null;
 676             }
 677         });
 678     }
 679 
 680     /**
 681      * Makes mouse click on the component center by default mouse button with 0
 682      * modifiers.
 683      *
 684      * @param clickCount Click count
 685      * @see #clickMouse(int, int)
 686      * @see #getDefaultMouseButton()
 687      */
 688     public void clickMouse(int clickCount) {
 689         clickMouse(clickCount, getDefaultMouseButton());
 690     }
 691 
 692     /**
 693      * Makes siple mouse click on the component center by default mouse button
 694      * with 0 modifiers.
 695      *
 696      * @see #clickMouse(int)
 697      * @see #getDefaultMouseButton()
 698      */
 699     public void clickMouse() {
 700         clickMouse(1);
 701     }
 702 
 703     /**
 704      * Move mouse inside the component.
 705      */
 706     public void enterMouse() {
 707         mDriver.enterMouse(this);
 708     }
 709 
 710     /**
 711      * Move mouse outside the component.
 712      */
 713     public void exitMouse() {
 714         mDriver.exitMouse(this);
 715     }
 716 
 717     /**
 718      * Press mouse.
 719      */
 720     public void pressMouse() {
 721         getQueueTool().invokeSmoothly(new QueueTool.QueueAction<Void>("Pressing the mouse button") {
 722             @Override
 723             public Void launch() {
 724                 pressMouse(getCenterXForClick(), getCenterYForClick());
 725                 return null;
 726             }
 727         });
 728     }
 729 
 730     /**
 731      * Releases mouse.
 732      */
 733     public void releaseMouse() {
 734         getQueueTool().invokeSmoothly(new QueueTool.QueueAction<Void>("Releasing the mouse button") {
 735             @Override
 736             public Void launch() {
 737                 releaseMouse(getCenterXForClick(), getCenterYForClick());
 738                 return null;
 739             }
 740         });
 741     }
 742 
 743     /**
 744      * Clicks for popup at the component center.
 745      *
 746      * @param mouseButton Mouse button.
 747      * @see #clickForPopup(int, int)
 748      */
 749     public void clickForPopup(int mouseButton) {
 750         clickForPopup(getCenterXForClick(), getCenterYForClick(), mouseButton);
 751     }
 752 
 753     /**
 754      * Clicks for popup by popup mouse button at the component center.
 755      *
 756      * @see #clickForPopup(int)
 757      * @see #getPopupMouseButton()
 758      */
 759     public void clickForPopup() {
 760         clickForPopup(getPopupMouseButton());
 761     }
 762 
 763     ////////////////////////////////////////////////////////
 764     //Keyboard operations
 765     ////////////////////////////////////////////////////////
 766     /**
 767      * Press key.
 768      *
 769      * @param keyCode Key code (KeyEvent.VK_* value)
 770      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 771      */
 772     public void pressKey(int keyCode, int modifiers) {
 773         kDriver.pressKey(this, keyCode, modifiers);
 774     }
 775 
 776     /**
 777      * Press key with no modifiers.
 778      *
 779      * @param keyCode Key code (KeyEvent.VK_* value)
 780      */
 781     public void pressKey(int keyCode) {
 782         pressKey(keyCode, 0);
 783     }
 784 
 785     /**
 786      * Typed key.
 787      *
 788      * @param keyChar Char to be typed.
 789      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 790      */
 791     public void typedKey(char keyChar, int modifiers) {
 792         kDriver.typedKey(this, getCharBindingMap().getCharKey(keyChar), keyChar, modifiers);
 793     }
 794 
 795     /**
 796      * Releases key.
 797      *
 798      * @param keyCode Key code (KeyEvent.VK_* value)
 799      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 800      */
 801     public void releaseKey(int keyCode, int modifiers) {
 802         kDriver.releaseKey(this, keyCode, modifiers);
 803     }
 804 
 805     /**
 806      * Releases key with no modifiers.
 807      *
 808      * @param keyCode Key code (KeyEvent.VK_* value)
 809      */
 810     public void releaseKey(int keyCode) {
 811         releaseKey(keyCode, 0);
 812     }
 813 
 814     /**
 815      * Pushs key.
 816      *
 817      * @param keyCode Key code (KeyEvent.VK_* value)
 818      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 819      */
 820     public void pushKey(int keyCode, int modifiers) {
 821         kDriver.pushKey(this, keyCode, modifiers, timeouts.create("ComponentOperator.PushKeyTimeout"));
 822     }
 823 
 824     /**
 825      * Pushs key.
 826      *
 827      * @param keyCode Key code (KeyEvent.VK_* value)
 828      */
 829     public void pushKey(int keyCode) {
 830         pushKey(keyCode, 0);
 831     }
 832 
 833     /**
 834      * Types one char.
 835      *
 836      * @param keyCode Key code (KeyEvent.VK_* value)
 837      * @param keyChar Char to be typed.
 838      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 839      */
 840     public void typeKey(int keyCode, char keyChar, int modifiers) {
 841         kDriver.typeKey(this, keyCode, keyChar, modifiers, timeouts.create("ComponentOperator.PushKeyTimeout"));
 842     }
 843 
 844     /**
 845      * Types one char. Uses map defined by setCharBindingMap(CharBindingMap)
 846      * method to find a key should be pressed.
 847      *
 848      * @param keyChar Char to be typed.
 849      * @param modifiers Modifiers (combination of InputEvent.*_MASK fields)
 850      * @see org.netbeans.jemmy.CharBindingMap
 851      * @see #setCharBindingMap(CharBindingMap)
 852      * @see #typeKey(int, char, int)
 853      */
 854     public void typeKey(char keyChar, int modifiers) {
 855         typeKey(getCharKey(keyChar), keyChar, modifiers | getCharModifiers(keyChar));
 856     }
 857 
 858     /**
 859      * Types one char. Uses map defined by setCharBindingMap(CharBindingMap)
 860      * method to find a key and modifiers should be pressed.
 861      *
 862      * @param keyChar Char to be typed.
 863      * @see #setCharBindingMap(CharBindingMap)
 864      * @see #typeKey(char, int)
 865      */
 866     public void typeKey(char keyChar) {
 867         typeKey(keyChar, 0);
 868     }
 869 
 870     ////////////////////////////////////////////////////////
 871     //Util
 872     ////////////////////////////////////////////////////////
 873     /**
 874      * Activates component's window.
 875      *
 876      * @deprecated Use makeComponentVisible() instead.
 877      * @see #makeComponentVisible()
 878      */
 879     @Deprecated
 880     public void activateWindow() {
 881         getVisualizer().makeVisible(this);
 882     }
 883 
 884     /**
 885      * Prepares component for user input. Uses visualizer defined by
 886      * setVisualiser() method.
 887      */
 888     public void makeComponentVisible() {
 889         getVisualizer().makeVisible(this);
 890         /*
 891         final ComponentOperator compOper = (ComponentOperator)this;
 892         runMapping(new MapVoidAction("add") {
 893                 public void map() {
 894                     getVisualizer().makeVisible(compOper);
 895                 }
 896             });
 897          */
 898     }
 899 
 900     /**
 901      * Gives input focus to the component.
 902      */
 903     public void getFocus() {
 904         fDriver.giveFocus(this);
 905     }
 906 
 907     /**
 908      * Return the center x coordinate.
 909      *
 910      * @return the center x coordinate.
 911      */
 912     public int getCenterX() {
 913         return getWidth() / 2;
 914     }
 915 
 916     /**
 917      * Return the center y coordinate.
 918      *
 919      * @return the center y coordinate.
 920      */
 921     public int getCenterY() {
 922         return getHeight() / 2;
 923     }
 924 
 925     /**
 926      * Return the x coordinate which should be used for mouse operations by
 927      * default.
 928      *
 929      * @return the center x coordinate of the visible component part.
 930      */
 931     public int getCenterXForClick() {
 932         return getCenterX();
 933     }
 934 
 935     /**
 936      * Return the y coordinate which should be used for mouse operations by
 937      * default.
 938      *
 939      * @return the center y coordinate of the visible component part.
 940      */
 941     public int getCenterYForClick() {
 942         return getCenterY();
 943     }
 944 
 945     /**
 946      * Waits for the component to be enabled.
 947      *
 948      * @throws TimeoutExpiredException
 949      * @throws InterruptedException
 950      */
 951     public void waitComponentEnabled() throws InterruptedException {
 952         Waiter<Component, Component> waiter = new Waiter<>(new Waitable<Component, Component>() {
 953             @Override
 954             public Component actionProduced(Component obj) {
 955                 if (obj.isEnabled()) {
 956                     return obj;
 957                 } else {
 958                     return null;
 959                 }
 960             }
 961 
 962             @Override
 963             public String getDescription() {
 964                 return ("Component enabled: "
 965                         + getSource().getClass().toString());
 966             }
 967 
 968             @Override
 969             public String toString() {
 970                 return "ComponentOperator.waitComponentEnabled.Waitable{description = " + getDescription() + '}';
 971             }
 972         });
 973         waiter.setOutput(output);
 974         waiter.setTimeoutsToCloneOf(timeouts, "ComponentOperator.WaitComponentEnabledTimeout");
 975         waiter.waitAction(getSource());
 976     }
 977 
 978     /**
 979      * Waits for the component to be enabled. per request: 37831
 980      *
 981      * @throws TimeoutExpiredException
 982      */
 983     public void wtComponentEnabled() {
 984         try {
 985             waitComponentEnabled();
 986         } catch (InterruptedException e) {
 987             throw (new JemmyException("Interrupted!", e));
 988         }
 989     }
 990 
 991     /**
 992      * Returns an array of containers for this component.
 993      *
 994      * @return an array of containers
 995      */
 996     public Container[] getContainers() {
 997         int counter = 0;
 998         Container cont = getSource().getParent();
 999         if (cont == null) {
1000             return new Container[0];
1001         }
1002         do {
1003             counter++;
1004         } while ((cont = cont.getParent()) != null);
1005         Container[] res = new Container[counter];
1006         cont = getSource().getParent();
1007         counter = 0;
1008         do {
1009             counter++;
1010             res[counter - 1] = cont;
1011         } while ((cont = cont.getParent()) != null);
1012         return res;
1013     }
1014 
1015     /**
1016      * Searches a container.
1017      *
1018      * @param chooser a chooser specifying the searching criteria.
1019      * @return a containers specified by searching criteria.
1020      */
1021     public Container getContainer(ComponentChooser chooser) {
1022         int counter = 0;
1023         Container cont = getSource().getParent();
1024         if (cont == null) {
1025             return null;
1026         }
1027         do {
1028             if (chooser.checkComponent(cont)) {
1029                 return cont;
1030             }
1031             counter++;
1032         } while ((cont = cont.getParent()) != null);
1033         return null;
1034     }
1035 
1036     /**
1037      * Searches the window under component.
1038      *
1039      * @return the component window.
1040      */
1041     public Window getWindow() {
1042         if (getSource() instanceof Window) {
1043             return (Window) getSource();
1044         }
1045         Window window = (Window) getContainer(new ComponentChooser() {
1046             @Override
1047             public boolean checkComponent(Component comp) {
1048                 return comp instanceof Window;
1049             }
1050 
1051             @Override
1052             public String getDescription() {
1053                 return "";
1054             }
1055 
1056             @Override
1057             public String toString() {
1058                 return "ComponentOperator.getWindow.ComponentChooser{description = " + getDescription() + '}';
1059             }
1060         });
1061         if (window == null && getSource() instanceof Window) {
1062             return (Window) getSource();
1063         } else {
1064             return window;
1065         }
1066     }
1067 
1068     /**
1069      * Waits for this Component has the keyboard focus.
1070      *
1071      * @throws TimeoutExpiredException
1072      */
1073     public void waitHasFocus() {
1074         Waiter<String, Void> focusWaiter = new Waiter<>(new Waitable<String, Void>() {
1075             @Override
1076             public String actionProduced(Void obj) {
1077                 return hasFocus() ? "" : null;
1078             }
1079 
1080             @Override
1081             public String getDescription() {
1082                 return "Wait component has focus";
1083             }
1084 
1085             @Override
1086             public String toString() {
1087                 return "ComponentOperator.waitHasFocus.Waitable{description = " + getDescription() + '}';
1088             }
1089         });
1090         focusWaiter.setTimeoutsToCloneOf(timeouts, "ComponentOperator.WaitFocusTimeout");
1091         focusWaiter.setOutput(output.createErrorOutput());
1092         try {
1093             focusWaiter.waitAction(null);
1094         } catch (InterruptedException e) {
1095             output.printStackTrace(e);
1096         }
1097     }
1098 
1099     /**
1100      * Waits for the component to be visible or unvisible.
1101      *
1102      * @param visibility required visiblity.
1103      * @throws TimeoutExpiredException
1104      */
1105     public void waitComponentVisible(final boolean visibility) {
1106         waitState(new ComponentChooser() {
1107             @Override
1108             public boolean checkComponent(Component comp) {
1109                 return isVisible() == visibility;
1110             }
1111 
1112             @Override
1113             public String getDescription() {
1114                 return "Component is " + (visibility ? "" : " not ") + "visible";
1115             }
1116 
1117             @Override
1118             public String toString() {
1119                 return "ComponentOperator.waitComponentVisible.ComponentChooser{description = " + getDescription() + '}';
1120             }
1121         });
1122     }
1123 
1124     public void waitComponentShowing(final boolean visibility) {
1125         waitState(new ComponentChooser() {
1126             @Override
1127             public boolean checkComponent(Component comp) {
1128                 return isShowing() == visibility;
1129             }
1130 
1131             @Override
1132             public String getDescription() {
1133                 return "Component is " + (visibility ? "" : " not ") + "showing";
1134             }
1135 
1136             @Override
1137             public String toString() {
1138                 return "ComponentOperator.waitComponentShowing.ComponentChooser{description = " + getDescription() + '}';
1139             }
1140         });
1141     }
1142 
1143     /**
1144      * Wait till the Size of the component becomes as expected.
1145      *
1146      * @param exactSize the exact expected size.
1147      */
1148     public void waitComponentSize(Dimension exactSize) {
1149         waitComponentSize(exactSize, exactSize);
1150     }
1151 
1152     /**
1153      * Wait till the Size of the component becomes between minSize and maxSize.
1154      *
1155      * @param minSize the minimum allowed size.
1156      * @param maxSize the maximum allowed size.
1157      */
1158     public void waitComponentSize(Dimension minSize, Dimension maxSize) {
1159         waitState(new ComponentChooser() {
1160             @Override
1161             public boolean checkComponent(Component comp) {
1162                 Dimension componentSize = comp.getSize();
1163                 return componentSize.height >= minSize.height
1164                         && componentSize.height <= maxSize.height
1165                         && componentSize.width >= minSize.width
1166                         && componentSize.width <= maxSize.width;
1167             }
1168 
1169             @Override
1170             public String getDescription() {
1171                 return "Component Size becomes between: " + minSize
1172                         + "and " + maxSize;
1173             }
1174 
1175             @Override
1176             public String toString() {
1177                 return "ComponentOperator.waitComponentSize"
1178                         + ".Waitable{description = " + getDescription() + '}';
1179             }
1180         });
1181     }
1182 
1183     /**
1184      * Wait till the component reaches exact location.
1185      *
1186      * @param exactlocation exact expected location.
1187      */
1188     public void waitComponentLocation(Point exactlocation) {
1189         waitComponentLocation(exactlocation, exactlocation);
1190     }
1191 
1192     /**
1193      * Wait till the component reaches location between minLocation and
1194      * maxLocation
1195      *
1196      * @param minLocation minimum expected location.
1197      * @param maxLocation maximum expected location.
1198      */
1199     public void waitComponentLocation(Point minLocation, Point maxLocation) {
1200         waitState(new ComponentChooser() {
1201             @Override
1202             public boolean checkComponent(Component comp) {
1203                 Point componentLocation = comp.getLocation();
1204                 return componentLocation.x >= minLocation.x
1205                         && componentLocation.x <= maxLocation.x
1206                         && componentLocation.y >= minLocation.y
1207                         && componentLocation.y <= maxLocation.y;
1208             }
1209 
1210             @Override
1211             public String getDescription() {
1212                 return "Component reaches location between :" + minLocation
1213                         + "and " + maxLocation;
1214             }
1215 
1216             @Override
1217             public String toString() {
1218                 return "ComponentOperator.waitComponentLocation"
1219                         + ".Waitable{description = " + getDescription() + '}';
1220             }
1221         });
1222     }
1223 
1224     /**
1225      * Returns information about component.
1226      */
1227     @Override
1228     public Hashtable<String, Object> getDump() {
1229         Hashtable<String, Object> result = super.getDump();
1230         if (getSource().getName() != null) {
1231             result.put(NAME_DPROP, getSource().getName());
1232         }
1233         result.put(IS_VISIBLE_DPROP, getSource().isVisible() ? "true" : "false");
1234         result.put(IS_SHOWING_DPROP, getSource().isShowing() ? "true" : "false");
1235         result.put(X_DPROP, Integer.toString(getSource().getX()));
1236         result.put(Y_DPROP, Integer.toString(getSource().getY()));
1237         result.put(WIDTH_DPROP, Integer.toString(getSource().getWidth()));
1238         result.put(HEIGHT_DPROP, Integer.toString(getSource().getHeight()));
1239         return result;
1240     }
1241 
1242     ////////////////////////////////////////////////////////
1243     //Mapping                                             //
1244     /**
1245      * Maps {@code Component.add(PopupMenu)} through queue
1246      */
1247     public void add(final PopupMenu popupMenu) {
1248         runMapping(new MapVoidAction("add") {
1249             @Override
1250             public void map() {
1251                 getSource().add(popupMenu);
1252             }
1253         });
1254     }
1255 
1256     /**
1257      * Maps {@code Component.addComponentListener(ComponentListener)}
1258      * through queue
1259      */
1260     public void addComponentListener(final ComponentListener componentListener) {
1261         runMapping(new MapVoidAction("addComponentListener") {
1262             @Override
1263             public void map() {
1264                 getSource().addComponentListener(componentListener);
1265             }
1266         });
1267     }
1268 
1269     /**
1270      * Maps {@code Component.addFocusListener(FocusListener)} through queue
1271      */
1272     public void addFocusListener(final FocusListener focusListener) {
1273         runMapping(new MapVoidAction("addFocusListener") {
1274             @Override
1275             public void map() {
1276                 getSource().addFocusListener(focusListener);
1277             }
1278         });
1279     }
1280 
1281     /**
1282      * Maps {@code Component.addInputMethodListener(InputMethodListener)}
1283      * through queue
1284      */
1285     public void addInputMethodListener(final InputMethodListener inputMethodListener) {
1286         runMapping(new MapVoidAction("addInputMethodListener") {
1287             @Override
1288             public void map() {
1289                 getSource().addInputMethodListener(inputMethodListener);
1290             }
1291         });
1292     }
1293 
1294     /**
1295      * Maps {@code Component.addKeyListener(KeyListener)} through queue
1296      */
1297     public void addKeyListener(final KeyListener keyListener) {
1298         runMapping(new MapVoidAction("addKeyListener") {
1299             @Override
1300             public void map() {
1301                 getSource().addKeyListener(keyListener);
1302             }
1303         });
1304     }
1305 
1306     /**
1307      * Maps {@code Component.addMouseListener(MouseListener)} through queue
1308      */
1309     public void addMouseListener(final MouseListener mouseListener) {
1310         runMapping(new MapVoidAction("addMouseListener") {
1311             @Override
1312             public void map() {
1313                 getSource().addMouseListener(mouseListener);
1314             }
1315         });
1316     }
1317 
1318     /**
1319      * Maps {@code Component.addMouseMotionListener(MouseMotionListener)}
1320      * through queue
1321      */
1322     public void addMouseMotionListener(final MouseMotionListener mouseMotionListener) {
1323         runMapping(new MapVoidAction("addMouseMotionListener") {
1324             @Override
1325             public void map() {
1326                 getSource().addMouseMotionListener(mouseMotionListener);
1327             }
1328         });
1329     }
1330 
1331     /**
1332      * Maps {@code Component.addNotify()} through queue
1333      */
1334     public void addNotify() {
1335         runMapping(new MapVoidAction("addNotify") {
1336             @Override
1337             public void map() {
1338                 getSource().addNotify();
1339             }
1340         });
1341     }
1342 
1343     /**
1344      * Maps
1345      * {@code Component.addPropertyChangeListener(PropertyChangeListener)}
1346      * through queue
1347      */
1348     public void addPropertyChangeListener(final PropertyChangeListener propertyChangeListener) {
1349         runMapping(new MapVoidAction("addPropertyChangeListener") {
1350             @Override
1351             public void map() {
1352                 getSource().addPropertyChangeListener(propertyChangeListener);
1353             }
1354         });
1355     }
1356 
1357     /**
1358      * Maps
1359      * {@code Component.addPropertyChangeListener(String, PropertyChangeListener)}
1360      * through queue
1361      */
1362     public void addPropertyChangeListener(final String string, final PropertyChangeListener propertyChangeListener) {
1363         runMapping(new MapVoidAction("addPropertyChangeListener") {
1364             @Override
1365             public void map() {
1366                 getSource().addPropertyChangeListener(string, propertyChangeListener);
1367             }
1368         });
1369     }
1370 
1371     /**
1372      * Maps {@code Component.checkImage(Image, int, int, ImageObserver)}
1373      * through queue
1374      */
1375     public int checkImage(final Image image, final int i, final int i1, final ImageObserver imageObserver) {
1376         return (runMapping(new MapIntegerAction("checkImage") {
1377             @Override
1378             public int map() {
1379                 return getSource().checkImage(image, i, i1, imageObserver);
1380             }
1381         }));
1382     }
1383 
1384     /**
1385      * Maps {@code Component.checkImage(Image, ImageObserver)} through queue
1386      */
1387     public int checkImage(final Image image, final ImageObserver imageObserver) {
1388         return (runMapping(new MapIntegerAction("checkImage") {
1389             @Override
1390             public int map() {
1391                 return getSource().checkImage(image, imageObserver);
1392             }
1393         }));
1394     }
1395 
1396     /**
1397      * Maps {@code Component.contains(int, int)} through queue
1398      */
1399     public boolean contains(final int i, final int i1) {
1400         return (runMapping(new MapBooleanAction("contains") {
1401             @Override
1402             public boolean map() {
1403                 return getSource().contains(i, i1);
1404             }
1405         }));
1406     }
1407 
1408     /**
1409      * Maps {@code Component.contains(Point)} through queue
1410      */
1411     public boolean contains(final Point point) {
1412         return (runMapping(new MapBooleanAction("contains") {
1413             @Override
1414             public boolean map() {
1415                 return getSource().contains(point);
1416             }
1417         }));
1418     }
1419 
1420     /**
1421      * Maps {@code Component.createImage(int, int)} through queue
1422      */
1423     public Image createImage(final int i, final int i1) {
1424         return (runMapping(new MapAction<Image>("createImage") {
1425             @Override
1426             public Image map() {
1427                 return getSource().createImage(i, i1);
1428             }
1429         }));
1430     }
1431 
1432     /**
1433      * Maps {@code Component.createImage(ImageProducer)} through queue
1434      */
1435     public Image createImage(final ImageProducer imageProducer) {
1436         return (runMapping(new MapAction<Image>("createImage") {
1437             @Override
1438             public Image map() {
1439                 return getSource().createImage(imageProducer);
1440             }
1441         }));
1442     }
1443 
1444     /**
1445      * Maps {@code Component.dispatchEvent(AWTEvent)} through queue
1446      */
1447     public void dispatchEvent(final AWTEvent aWTEvent) {
1448         runMapping(new MapVoidAction("dispatchEvent") {
1449             @Override
1450             public void map() {
1451                 getSource().dispatchEvent(aWTEvent);
1452             }
1453         });
1454     }
1455 
1456     /**
1457      * Maps {@code Component.doLayout()} through queue
1458      */
1459     public void doLayout() {
1460         runMapping(new MapVoidAction("doLayout") {
1461             @Override
1462             public void map() {
1463                 getSource().doLayout();
1464             }
1465         });
1466     }
1467 
1468     /**
1469      * Maps {@code Component.enableInputMethods(boolean)} through queue
1470      */
1471     public void enableInputMethods(final boolean b) {
1472         runMapping(new MapVoidAction("enableInputMethods") {
1473             @Override
1474             public void map() {
1475                 getSource().enableInputMethods(b);
1476             }
1477         });
1478     }
1479 
1480     /**
1481      * Maps {@code Component.getAlignmentX()} through queue
1482      */
1483     public float getAlignmentX() {
1484         return (runMapping(new MapFloatAction("getAlignmentX") {
1485             @Override
1486             public float map() {
1487                 return getSource().getAlignmentX();
1488             }
1489         }));
1490     }
1491 
1492     /**
1493      * Maps {@code Component.getAlignmentY()} through queue
1494      */
1495     public float getAlignmentY() {
1496         return (runMapping(new MapFloatAction("getAlignmentY") {
1497             @Override
1498             public float map() {
1499                 return getSource().getAlignmentY();
1500             }
1501         }));
1502     }
1503 
1504     /**
1505      * Maps {@code Component.getBackground()} through queue
1506      */
1507     public Color getBackground() {
1508         return (runMapping(new MapAction<Color>("getBackground") {
1509             @Override
1510             public Color map() {
1511                 return getSource().getBackground();
1512             }
1513         }));
1514     }
1515 
1516     /**
1517      * Maps {@code Component.getBounds()} through queue
1518      */
1519     public Rectangle getBounds() {
1520         return (runMapping(new MapAction<Rectangle>("getBounds") {
1521             @Override
1522             public Rectangle map() {
1523                 return getSource().getBounds();
1524             }
1525         }));
1526     }
1527 
1528     /**
1529      * Maps {@code Component.getBounds(Rectangle)} through queue
1530      */
1531     public Rectangle getBounds(final Rectangle rectangle) {
1532         return (runMapping(new MapAction<Rectangle>("getBounds") {
1533             @Override
1534             public Rectangle map() {
1535                 return getSource().getBounds(rectangle);
1536             }
1537         }));
1538     }
1539 
1540     /**
1541      * Maps {@code Component.getColorModel()} through queue
1542      */
1543     public ColorModel getColorModel() {
1544         return (runMapping(new MapAction<ColorModel>("getColorModel") {
1545             @Override
1546             public ColorModel map() {
1547                 return getSource().getColorModel();
1548             }
1549         }));
1550     }
1551 
1552     /**
1553      * Maps {@code Component.getComponentAt(int, int)} through queue
1554      */
1555     public Component getComponentAt(final int i, final int i1) {
1556         return (runMapping(new MapAction<Component>("getComponentAt") {
1557             @Override
1558             public Component map() {
1559                 return getSource().getComponentAt(i, i1);
1560             }
1561         }));
1562     }
1563 
1564     /**
1565      * Maps {@code Component.getComponentAt(Point)} through queue
1566      */
1567     public Component getComponentAt(final Point point) {
1568         return (runMapping(new MapAction<Component>("getComponentAt") {
1569             @Override
1570             public Component map() {
1571                 return getSource().getComponentAt(point);
1572             }
1573         }));
1574     }
1575 
1576     /**
1577      * Maps {@code Component.getComponentOrientation()} through queue
1578      */
1579     public ComponentOrientation getComponentOrientation() {
1580         return (runMapping(new MapAction<ComponentOrientation>("getComponentOrientation") {
1581             @Override
1582             public ComponentOrientation map() {
1583                 return getSource().getComponentOrientation();
1584             }
1585         }));
1586     }
1587 
1588     /**
1589      * Maps {@code Component.getCursor()} through queue
1590      */
1591     public Cursor getCursor() {
1592         return (runMapping(new MapAction<Cursor>("getCursor") {
1593             @Override
1594             public Cursor map() {
1595                 return getSource().getCursor();
1596             }
1597         }));
1598     }
1599 
1600     /**
1601      * Maps {@code Component.getDropTarget()} through queue
1602      */
1603     public DropTarget getDropTarget() {
1604         return (runMapping(new MapAction<DropTarget>("getDropTarget") {
1605             @Override
1606             public DropTarget map() {
1607                 return getSource().getDropTarget();
1608             }
1609         }));
1610     }
1611 
1612     /**
1613      * Maps {@code Component.getFont()} through queue
1614      */
1615     public Font getFont() {
1616         return (runMapping(new MapAction<Font>("getFont") {
1617             @Override
1618             public Font map() {
1619                 return getSource().getFont();
1620             }
1621         }));
1622     }
1623 
1624     /**
1625      * Maps {@code Component.getFontMetrics(Font)} through queue
1626      */
1627     public FontMetrics getFontMetrics(final Font font) {
1628         return (runMapping(new MapAction<FontMetrics>("getFontMetrics") {
1629             @Override
1630             public FontMetrics map() {
1631                 return getSource().getFontMetrics(font);
1632             }
1633         }));
1634     }
1635 
1636     /**
1637      * Maps {@code Component.getForeground()} through queue
1638      */
1639     public Color getForeground() {
1640         return (runMapping(new MapAction<Color>("getForeground") {
1641             @Override
1642             public Color map() {
1643                 return getSource().getForeground();
1644             }
1645         }));
1646     }
1647 
1648     /**
1649      * Maps {@code Component.getGraphics()} through queue
1650      */
1651     public Graphics getGraphics() {
1652         return (runMapping(new MapAction<Graphics>("getGraphics") {
1653             @Override
1654             public Graphics map() {
1655                 return getSource().getGraphics();
1656             }
1657         }));
1658     }
1659 
1660     /**
1661      * Maps {@code Component.getHeight()} through queue
1662      */
1663     public int getHeight() {
1664         return (runMapping(new MapIntegerAction("getHeight") {
1665             @Override
1666             public int map() {
1667                 return getSource().getHeight();
1668             }
1669         }));
1670     }
1671 
1672     /**
1673      * Maps {@code Component.getInputContext()} through queue
1674      */
1675     public InputContext getInputContext() {
1676         return (runMapping(new MapAction<InputContext>("getInputContext") {
1677             @Override
1678             public InputContext map() {
1679                 return getSource().getInputContext();
1680             }
1681         }));
1682     }
1683 
1684     /**
1685      * Maps {@code Component.getInputMethodRequests()} through queue
1686      */
1687     public InputMethodRequests getInputMethodRequests() {
1688         return (runMapping(new MapAction<InputMethodRequests>("getInputMethodRequests") {
1689             @Override
1690             public InputMethodRequests map() {
1691                 return getSource().getInputMethodRequests();
1692             }
1693         }));
1694     }
1695 
1696     /**
1697      * Maps {@code Component.getLocale()} through queue
1698      */
1699     public Locale getLocale() {
1700         return (runMapping(new MapAction<Locale>("getLocale") {
1701             @Override
1702             public Locale map() {
1703                 return getSource().getLocale();
1704             }
1705         }));
1706     }
1707 
1708     /**
1709      * Maps {@code Component.getLocation()} through queue
1710      */
1711     public Point getLocation() {
1712         return (runMapping(new MapAction<Point>("getLocation") {
1713             @Override
1714             public Point map() {
1715                 return getSource().getLocation();
1716             }
1717         }));
1718     }
1719 
1720     /**
1721      * Maps {@code Component.getLocation(Point)} through queue
1722      */
1723     public Point getLocation(final Point point) {
1724         return (runMapping(new MapAction<Point>("getLocation") {
1725             @Override
1726             public Point map() {
1727                 return getSource().getLocation(point);
1728             }
1729         }));
1730     }
1731 
1732     /**
1733      * Maps {@code Component.getLocationOnScreen()} through queue
1734      */
1735     public Point getLocationOnScreen() {
1736         return (runMapping(new MapAction<Point>("getLocationOnScreen") {
1737             @Override
1738             public Point map() {
1739                 return getSource().getLocationOnScreen();
1740             }
1741         }));
1742     }
1743 
1744     /**
1745      * Maps {@code Component.getMaximumSize()} through queue
1746      */
1747     public Dimension getMaximumSize() {
1748         return (runMapping(new MapAction<Dimension>("getMaximumSize") {
1749             @Override
1750             public Dimension map() {
1751                 return getSource().getMaximumSize();
1752             }
1753         }));
1754     }
1755 
1756     /**
1757      * Maps {@code Component.getMinimumSize()} through queue
1758      */
1759     public Dimension getMinimumSize() {
1760         return (runMapping(new MapAction<Dimension>("getMinimumSize") {
1761             @Override
1762             public Dimension map() {
1763                 return getSource().getMinimumSize();
1764             }
1765         }));
1766     }
1767 
1768     /**
1769      * Maps {@code Component.getName()} through queue
1770      */
1771     public String getName() {
1772         return (runMapping(new MapAction<String>("getName") {
1773             @Override
1774             public String map() {
1775                 return getSource().getName();
1776             }
1777         }));
1778     }
1779 
1780     /**
1781      * Maps {@code Component.getParent()} through queue
1782      */
1783     public Container getParent() {
1784         return (runMapping(new MapAction<Container>("getParent") {
1785             @Override
1786             public Container map() {
1787                 return getSource().getParent();
1788             }
1789         }));
1790     }
1791 
1792     /**
1793      * Maps {@code Component.getPreferredSize()} through queue
1794      */
1795     public Dimension getPreferredSize() {
1796         return (runMapping(new MapAction<Dimension>("getPreferredSize") {
1797             @Override
1798             public Dimension map() {
1799                 return getSource().getPreferredSize();
1800             }
1801         }));
1802     }
1803 
1804     /**
1805      * Maps {@code Component.getSize()} through queue
1806      */
1807     public Dimension getSize() {
1808         return (runMapping(new MapAction<Dimension>("getSize") {
1809             @Override
1810             public Dimension map() {
1811                 return getSource().getSize();
1812             }
1813         }));
1814     }
1815 
1816     /**
1817      * Maps {@code Component.getSize(Dimension)} through queue
1818      */
1819     public Dimension getSize(final Dimension dimension) {
1820         return (runMapping(new MapAction<Dimension>("getSize") {
1821             @Override
1822             public Dimension map() {
1823                 return getSource().getSize(dimension);
1824             }
1825         }));
1826     }
1827 
1828     /**
1829      * Maps {@code Component.getToolkit()} through queue
1830      */
1831     public Toolkit getToolkit() {
1832         return (runMapping(new MapAction<Toolkit>("getToolkit") {
1833             @Override
1834             public Toolkit map() {
1835                 return getSource().getToolkit();
1836             }
1837         }));
1838     }
1839 
1840     /**
1841      * Maps {@code Component.getTreeLock()} through queue
1842      */
1843     public Object getTreeLock() {
1844         return (runMapping(new MapAction<Object>("getTreeLock") {
1845             @Override
1846             public Object map() {
1847                 return getSource().getTreeLock();
1848             }
1849         }));
1850     }
1851 
1852     /**
1853      * Maps {@code Component.getWidth()} through queue
1854      */
1855     public int getWidth() {
1856         return (runMapping(new MapIntegerAction("getWidth") {
1857             @Override
1858             public int map() {
1859                 return getSource().getWidth();
1860             }
1861         }));
1862     }
1863 
1864     /**
1865      * Maps {@code Component.getX()} through queue
1866      */
1867     public int getX() {
1868         return (runMapping(new MapIntegerAction("getX") {
1869             @Override
1870             public int map() {
1871                 return getSource().getX();
1872             }
1873         }));
1874     }
1875 
1876     /**
1877      * Maps {@code Component.getY()} through queue
1878      */
1879     public int getY() {
1880         return (runMapping(new MapIntegerAction("getY") {
1881             @Override
1882             public int map() {
1883                 return getSource().getY();
1884             }
1885         }));
1886     }
1887 
1888     /**
1889      * Maps {@code Component.hasFocus()} through queue
1890      */
1891     public boolean hasFocus() {
1892         return (runMapping(new MapBooleanAction("hasFocus") {
1893             @Override
1894             public boolean map() {
1895                 return getSource().hasFocus();
1896             }
1897         }));
1898     }
1899 
1900     /**
1901      * Maps {@code Component.imageUpdate(Image, int, int, int, int, int)}
1902      * through queue
1903      */
1904     public boolean imageUpdate(final Image image, final int i, final int i1, final int i2, final int i3, final int i4) {
1905         return (runMapping(new MapBooleanAction("imageUpdate") {
1906             @Override
1907             public boolean map() {
1908                 return getSource().imageUpdate(image, i, i1, i2, i3, i4);
1909             }
1910         }));
1911     }
1912 
1913     /**
1914      * Maps {@code Component.invalidate()} through queue
1915      */
1916     public void invalidate() {
1917         runMapping(new MapVoidAction("invalidate") {
1918             @Override
1919             public void map() {
1920                 getSource().invalidate();
1921             }
1922         });
1923     }
1924 
1925     /**
1926      * Maps {@code Component.isDisplayable()} through queue
1927      */
1928     public boolean isDisplayable() {
1929         return (runMapping(new MapBooleanAction("isDisplayable") {
1930             @Override
1931             public boolean map() {
1932                 return getSource().isDisplayable();
1933             }
1934         }));
1935     }
1936 
1937     /**
1938      * Maps {@code Component.isDoubleBuffered()} through queue
1939      */
1940     public boolean isDoubleBuffered() {
1941         return (runMapping(new MapBooleanAction("isDoubleBuffered") {
1942             @Override
1943             public boolean map() {
1944                 return getSource().isDoubleBuffered();
1945             }
1946         }));
1947     }
1948 
1949     /**
1950      * Maps {@code Component.isEnabled()} through queue
1951      */
1952     public boolean isEnabled() {
1953         return (runMapping(new MapBooleanAction("isEnabled") {
1954             @Override
1955             public boolean map() {
1956                 return getSource().isEnabled();
1957             }
1958         }));
1959     }
1960 
1961     /**
1962      * Maps {@code Component.isFocusTraversable()} through queue
1963      */
1964     @Deprecated
1965     public boolean isFocusTraversable() {
1966         return (runMapping(new MapBooleanAction("isFocusTraversable") {
1967             @Override
1968             public boolean map() {
1969                 return getSource().isFocusTraversable();
1970             }
1971         }));
1972     }
1973 
1974     /**
1975      * Maps {@code Component.isLightweight()} through queue
1976      */
1977     public boolean isLightweight() {
1978         return (runMapping(new MapBooleanAction("isLightweight") {
1979             @Override
1980             public boolean map() {
1981                 return getSource().isLightweight();
1982             }
1983         }));
1984     }
1985 
1986     /**
1987      * Maps {@code Component.isOpaque()} through queue
1988      */
1989     public boolean isOpaque() {
1990         return (runMapping(new MapBooleanAction("isOpaque") {
1991             @Override
1992             public boolean map() {
1993                 return getSource().isOpaque();
1994             }
1995         }));
1996     }
1997 
1998     /**
1999      * Maps {@code Component.isShowing()} through queue
2000      */
2001     public boolean isShowing() {
2002         return (runMapping(new MapBooleanAction("isShowing") {
2003             @Override
2004             public boolean map() {
2005                 return getSource().isShowing();
2006             }
2007         }));
2008     }
2009 
2010     /**
2011      * Maps {@code Component.isValid()} through queue
2012      */
2013     public boolean isValid() {
2014         return (runMapping(new MapBooleanAction("isValid") {
2015             @Override
2016             public boolean map() {
2017                 return getSource().isValid();
2018             }
2019         }));
2020     }
2021 
2022     /**
2023      * Maps {@code Component.isVisible()} through queue
2024      */
2025     public boolean isVisible() {
2026         return (runMapping(new MapBooleanAction("isVisible") {
2027             @Override
2028             public boolean map() {
2029                 return getSource().isVisible();
2030             }
2031         }));
2032     }
2033 
2034     /**
2035      * Maps {@code Component.list()} through queue
2036      */
2037     public void list() {
2038         runMapping(new MapVoidAction("list") {
2039             @Override
2040             public void map() {
2041                 getSource().list();
2042             }
2043         });
2044     }
2045 
2046     /**
2047      * Maps {@code Component.list(PrintStream)} through queue
2048      */
2049     public void list(final PrintStream printStream) {
2050         runMapping(new MapVoidAction("list") {
2051             @Override
2052             public void map() {
2053                 getSource().list(printStream);
2054             }
2055         });
2056     }
2057 
2058     /**
2059      * Maps {@code Component.list(PrintStream, int)} through queue
2060      */
2061     public void list(final PrintStream printStream, final int i) {
2062         runMapping(new MapVoidAction("list") {
2063             @Override
2064             public void map() {
2065                 getSource().list(printStream, i);
2066             }
2067         });
2068     }
2069 
2070     /**
2071      * Maps {@code Component.list(PrintWriter)} through queue
2072      */
2073     public void list(final PrintWriter printWriter) {
2074         runMapping(new MapVoidAction("list") {
2075             @Override
2076             public void map() {
2077                 getSource().list(printWriter);
2078             }
2079         });
2080     }
2081 
2082     /**
2083      * Maps {@code Component.list(PrintWriter, int)} through queue
2084      */
2085     public void list(final PrintWriter printWriter, final int i) {
2086         runMapping(new MapVoidAction("list") {
2087             @Override
2088             public void map() {
2089                 getSource().list(printWriter, i);
2090             }
2091         });
2092     }
2093 
2094     /**
2095      * Maps {@code Component.paint(Graphics)} through queue
2096      */
2097     public void paint(final Graphics graphics) {
2098         runMapping(new MapVoidAction("paint") {
2099             @Override
2100             public void map() {
2101                 getSource().paint(graphics);
2102             }
2103         });
2104     }
2105 
2106     /**
2107      * Maps {@code Component.paintAll(Graphics)} through queue
2108      */
2109     public void paintAll(final Graphics graphics) {
2110         runMapping(new MapVoidAction("paintAll") {
2111             @Override
2112             public void map() {
2113                 getSource().paintAll(graphics);
2114             }
2115         });
2116     }
2117 
2118     /**
2119      * Maps {@code Component.prepareImage(Image, int, int, ImageObserver)}
2120      * through queue
2121      */
2122     public boolean prepareImage(final Image image, final int i, final int i1, final ImageObserver imageObserver) {
2123         return (runMapping(new MapBooleanAction("prepareImage") {
2124             @Override
2125             public boolean map() {
2126                 return getSource().prepareImage(image, i, i1, imageObserver);
2127             }
2128         }));
2129     }
2130 
2131     /**
2132      * Maps {@code Component.prepareImage(Image, ImageObserver)} through queue
2133      */
2134     public boolean prepareImage(final Image image, final ImageObserver imageObserver) {
2135         return (runMapping(new MapBooleanAction("prepareImage") {
2136             @Override
2137             public boolean map() {
2138                 return getSource().prepareImage(image, imageObserver);
2139             }
2140         }));
2141     }
2142 
2143     /**
2144      * Maps {@code Component.print(Graphics)} through queue
2145      */
2146     public void print(final Graphics graphics) {
2147         runMapping(new MapVoidAction("print") {
2148             @Override
2149             public void map() {
2150                 getSource().print(graphics);
2151             }
2152         });
2153     }
2154 
2155     /**
2156      * Maps {@code Component.printAll(Graphics)} through queue
2157      */
2158     public void printAll(final Graphics graphics) {
2159         runMapping(new MapVoidAction("printAll") {
2160             @Override
2161             public void map() {
2162                 getSource().printAll(graphics);
2163             }
2164         });
2165     }
2166 
2167     /**
2168      * Maps {@code Component.remove(MenuComponent)} through queue
2169      */
2170     public void remove(final MenuComponent menuComponent) {
2171         runMapping(new MapVoidAction("remove") {
2172             @Override
2173             public void map() {
2174                 getSource().remove(menuComponent);
2175             }
2176         });
2177     }
2178 
2179     /**
2180      * Maps {@code Component.removeComponentListener(ComponentListener)}
2181      * through queue
2182      */
2183     public void removeComponentListener(final ComponentListener componentListener) {
2184         runMapping(new MapVoidAction("removeComponentListener") {
2185             @Override
2186             public void map() {
2187                 getSource().removeComponentListener(componentListener);
2188             }
2189         });
2190     }
2191 
2192     /**
2193      * Maps {@code Component.removeFocusListener(FocusListener)} through queue
2194      */
2195     public void removeFocusListener(final FocusListener focusListener) {
2196         runMapping(new MapVoidAction("removeFocusListener") {
2197             @Override
2198             public void map() {
2199                 getSource().removeFocusListener(focusListener);
2200             }
2201         });
2202     }
2203 
2204     /**
2205      * Maps
2206      * {@code Component.removeInputMethodListener(InputMethodListener)}
2207      * through queue
2208      */
2209     public void removeInputMethodListener(final InputMethodListener inputMethodListener) {
2210         runMapping(new MapVoidAction("removeInputMethodListener") {
2211             @Override
2212             public void map() {
2213                 getSource().removeInputMethodListener(inputMethodListener);
2214             }
2215         });
2216     }
2217 
2218     /**
2219      * Maps {@code Component.removeKeyListener(KeyListener)} through queue
2220      */
2221     public void removeKeyListener(final KeyListener keyListener) {
2222         runMapping(new MapVoidAction("removeKeyListener") {
2223             @Override
2224             public void map() {
2225                 getSource().removeKeyListener(keyListener);
2226             }
2227         });
2228     }
2229 
2230     /**
2231      * Maps {@code Component.removeMouseListener(MouseListener)} through queue
2232      */
2233     public void removeMouseListener(final MouseListener mouseListener) {
2234         runMapping(new MapVoidAction("removeMouseListener") {
2235             @Override
2236             public void map() {
2237                 getSource().removeMouseListener(mouseListener);
2238             }
2239         });
2240     }
2241 
2242     /**
2243      * Maps
2244      * {@code Component.removeMouseMotionListener(MouseMotionListener)}
2245      * through queue
2246      */
2247     public void removeMouseMotionListener(final MouseMotionListener mouseMotionListener) {
2248         runMapping(new MapVoidAction("removeMouseMotionListener") {
2249             @Override
2250             public void map() {
2251                 getSource().removeMouseMotionListener(mouseMotionListener);
2252             }
2253         });
2254     }
2255 
2256     /**
2257      * Maps {@code Component.removeNotify()} through queue
2258      */
2259     public void removeNotify() {
2260         runMapping(new MapVoidAction("removeNotify") {
2261             @Override
2262             public void map() {
2263                 getSource().removeNotify();
2264             }
2265         });
2266     }
2267 
2268     /**
2269      * Maps
2270      * {@code Component.removePropertyChangeListener(PropertyChangeListener)}
2271      * through queue
2272      */
2273     public void removePropertyChangeListener(final PropertyChangeListener propertyChangeListener) {
2274         runMapping(new MapVoidAction("removePropertyChangeListener") {
2275             @Override
2276             public void map() {
2277                 getSource().removePropertyChangeListener(propertyChangeListener);
2278             }
2279         });
2280     }
2281 
2282     /**
2283      * Maps
2284      * {@code Component.removePropertyChangeListener(String, PropertyChangeListener)}
2285      * through queue
2286      */
2287     public void removePropertyChangeListener(final String string, final PropertyChangeListener propertyChangeListener) {
2288         runMapping(new MapVoidAction("removePropertyChangeListener") {
2289             @Override
2290             public void map() {
2291                 getSource().removePropertyChangeListener(string, propertyChangeListener);
2292             }
2293         });
2294     }
2295 
2296     /**
2297      * Maps {@code Component.repaint()} through queue
2298      */
2299     public void repaint() {
2300         runMapping(new MapVoidAction("repaint") {
2301             @Override
2302             public void map() {
2303                 getSource().repaint();
2304             }
2305         });
2306     }
2307 
2308     /**
2309      * Maps {@code Component.repaint(int, int, int, int)} through queue
2310      */
2311     public void repaint(final int i, final int i1, final int i2, final int i3) {
2312         runMapping(new MapVoidAction("repaint") {
2313             @Override
2314             public void map() {
2315                 getSource().repaint(i, i1, i2, i3);
2316             }
2317         });
2318     }
2319 
2320     /**
2321      * Maps {@code Component.repaint(long)} through queue
2322      */
2323     public void repaint(final long l) {
2324         runMapping(new MapVoidAction("repaint") {
2325             @Override
2326             public void map() {
2327                 getSource().repaint(l);
2328             }
2329         });
2330     }
2331 
2332     /**
2333      * Maps {@code Component.repaint(long, int, int, int, int)} through queue
2334      */
2335     public void repaint(final long l, final int i, final int i1, final int i2, final int i3) {
2336         runMapping(new MapVoidAction("repaint") {
2337             @Override
2338             public void map() {
2339                 getSource().repaint(l, i, i1, i2, i3);
2340             }
2341         });
2342     }
2343 
2344     /**
2345      * Maps {@code Component.requestFocus()} through queue
2346      */
2347     public void requestFocus() {
2348         runMapping(new MapVoidAction("requestFocus") {
2349             @Override
2350             public void map() {
2351                 getSource().requestFocus();
2352             }
2353         });
2354     }
2355 
2356     /**
2357      * Maps {@code Component.setBackground(Color)} through queue
2358      */
2359     public void setBackground(final Color color) {
2360         runMapping(new MapVoidAction("setBackground") {
2361             @Override
2362             public void map() {
2363                 getSource().setBackground(color);
2364             }
2365         });
2366     }
2367 
2368     /**
2369      * Maps {@code Component.setBounds(int, int, int, int)} through queue
2370      */
2371     public void setBounds(final int i, final int i1, final int i2, final int i3) {
2372         runMapping(new MapVoidAction("setBounds") {
2373             @Override
2374             public void map() {
2375                 getSource().setBounds(i, i1, i2, i3);
2376             }
2377         });
2378     }
2379 
2380     /**
2381      * Maps {@code Component.setBounds(Rectangle)} through queue
2382      */
2383     public void setBounds(final Rectangle rectangle) {
2384         runMapping(new MapVoidAction("setBounds") {
2385             @Override
2386             public void map() {
2387                 getSource().setBounds(rectangle);
2388             }
2389         });
2390     }
2391 
2392     /**
2393      * Maps {@code Component.setComponentOrientation(ComponentOrientation)}
2394      * through queue
2395      */
2396     public void setComponentOrientation(final ComponentOrientation componentOrientation) {
2397         runMapping(new MapVoidAction("setComponentOrientation") {
2398             @Override
2399             public void map() {
2400                 getSource().setComponentOrientation(componentOrientation);
2401             }
2402         });
2403     }
2404 
2405     /**
2406      * Maps {@code Component.setCursor(Cursor)} through queue
2407      */
2408     public void setCursor(final Cursor cursor) {
2409         runMapping(new MapVoidAction("setCursor") {
2410             @Override
2411             public void map() {
2412                 getSource().setCursor(cursor);
2413             }
2414         });
2415     }
2416 
2417     /**
2418      * Maps {@code Component.setDropTarget(DropTarget)} through queue
2419      */
2420     public void setDropTarget(final DropTarget dropTarget) {
2421         runMapping(new MapVoidAction("setDropTarget") {
2422             @Override
2423             public void map() {
2424                 getSource().setDropTarget(dropTarget);
2425             }
2426         });
2427     }
2428 
2429     /**
2430      * Maps {@code Component.setEnabled(boolean)} through queue
2431      */
2432     public void setEnabled(final boolean b) {
2433         runMapping(new MapVoidAction("setEnabled") {
2434             @Override
2435             public void map() {
2436                 getSource().setEnabled(b);
2437             }
2438         });
2439     }
2440 
2441     /**
2442      * Maps {@code Component.setFont(Font)} through queue
2443      */
2444     public void setFont(final Font font) {
2445         runMapping(new MapVoidAction("setFont") {
2446             @Override
2447             public void map() {
2448                 getSource().setFont(font);
2449             }
2450         });
2451     }
2452 
2453     /**
2454      * Maps {@code Component.setForeground(Color)} through queue
2455      */
2456     public void setForeground(final Color color) {
2457         runMapping(new MapVoidAction("setForeground") {
2458             @Override
2459             public void map() {
2460                 getSource().setForeground(color);
2461             }
2462         });
2463     }
2464 
2465     /**
2466      * Maps {@code Component.setLocale(Locale)} through queue
2467      */
2468     public void setLocale(final Locale locale) {
2469         runMapping(new MapVoidAction("setLocale") {
2470             @Override
2471             public void map() {
2472                 getSource().setLocale(locale);
2473             }
2474         });
2475     }
2476 
2477     /**
2478      * Maps {@code Component.setLocation(int, int)} through queue
2479      */
2480     public void setLocation(final int i, final int i1) {
2481         runMapping(new MapVoidAction("setLocation") {
2482             @Override
2483             public void map() {
2484                 getSource().setLocation(i, i1);
2485             }
2486         });
2487     }
2488 
2489     /**
2490      * Maps {@code Component.setLocation(Point)} through queue
2491      */
2492     public void setLocation(final Point point) {
2493         runMapping(new MapVoidAction("setLocation") {
2494             @Override
2495             public void map() {
2496                 getSource().setLocation(point);
2497             }
2498         });
2499     }
2500 
2501     /**
2502      * Maps {@code Component.setName(String)} through queue
2503      */
2504     public void setName(final String string) {
2505         runMapping(new MapVoidAction("setName") {
2506             @Override
2507             public void map() {
2508                 getSource().setName(string);
2509             }
2510         });
2511     }
2512 
2513     /**
2514      * Maps {@code Component.setSize(int, int)} through queue
2515      */
2516     public void setSize(final int i, final int i1) {
2517         runMapping(new MapVoidAction("setSize") {
2518             @Override
2519             public void map() {
2520                 getSource().setSize(i, i1);
2521             }
2522         });
2523     }
2524 
2525     /**
2526      * Maps {@code Component.setSize(Dimension)} through queue
2527      */
2528     public void setSize(final Dimension dimension) {
2529         runMapping(new MapVoidAction("setSize") {
2530             @Override
2531             public void map() {
2532                 getSource().setSize(dimension);
2533             }
2534         });
2535     }
2536 
2537     /**
2538      * Maps {@code Component.setVisible(boolean)} through queue
2539      */
2540     public void setVisible(final boolean b) {
2541         runMapping(new MapVoidAction("setVisible") {
2542             @Override
2543             public void map() {
2544                 getSource().setVisible(b);
2545             }
2546         });
2547     }
2548 
2549     /**
2550      * Maps {@code Component.transferFocus()} through queue
2551      */
2552     public void transferFocus() {
2553         runMapping(new MapVoidAction("transferFocus") {
2554             @Override
2555             public void map() {
2556                 getSource().transferFocus();
2557             }
2558         });
2559     }
2560 
2561     /**
2562      * Maps {@code Component.update(Graphics)} through queue
2563      */
2564     public void update(final Graphics graphics) {
2565         runMapping(new MapVoidAction("update") {
2566             @Override
2567             public void map() {
2568                 getSource().update(graphics);
2569             }
2570         });
2571     }
2572 
2573     /**
2574      * Maps {@code Component.validate()} through queue
2575      */
2576     public void validate() {
2577         runMapping(new MapVoidAction("validate") {
2578             @Override
2579             public void map() {
2580                 getSource().validate();
2581             }
2582         });
2583     }
2584 
2585     //End of mapping                                      //
2586     ////////////////////////////////////////////////////////
2587     private void setEventDispatcher(EventDispatcher dispatcher) {
2588         dispatcher.setOutput(getOutput().createErrorOutput());
2589         dispatcher.setTimeouts(getTimeouts());
2590         this.dispatcher = dispatcher;
2591     }
2592 
2593     static class VisibleComponentFinder implements ComponentChooser {
2594 
2595         ComponentChooser subFinder;
2596 
2597         public VisibleComponentFinder(ComponentChooser sf) {
2598             subFinder = sf;
2599         }
2600 
2601         @Override
2602         public boolean checkComponent(Component comp) {
2603             if (comp.isShowing()) {
2604                 return subFinder.checkComponent(comp);
2605             }
2606             return false;
2607         }
2608 
2609         @Override
2610         public String getDescription() {
2611             return subFinder.getDescription();
2612         }
2613 
2614         @Override
2615         public String toString() {
2616             return "VisibleComponentFinder{" + "subFinder=" + subFinder + '}';
2617         }
2618     }
2619 
2620 }