/[classpath]/classpath/java/awt/Robot.java
ViewVC logotype

Diff of /classpath/java/awt/Robot.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by mkoch, Tue Jan 11 09:50:14 2005 UTC revision 1.6 by mkoch, Tue Feb 22 07:07:46 2005 UTC
# Line 40  package java.awt; Line 40  package java.awt;
40    
41  import gnu.java.awt.ClasspathToolkit;  import gnu.java.awt.ClasspathToolkit;
42    
43    import java.lang.reflect.InvocationTargetException;
44  import java.awt.event.InputEvent;  import java.awt.event.InputEvent;
45  import java.awt.image.BufferedImage;  import java.awt.image.BufferedImage;
46  import java.awt.peer.RobotPeer;  import java.awt.peer.RobotPeer;
# Line 53  import java.awt.peer.RobotPeer; Line 54  import java.awt.peer.RobotPeer;
54   *   *
55   * Since Robot generates native windowing system events, rather than   * Since Robot generates native windowing system events, rather than
56   * simply inserting {@link AWTEvents} on the AWT event queue, its use   * simply inserting {@link AWTEvents} on the AWT event queue, its use
57   * is not restricted to Java programs.  It can be to programatically   * is not restricted to Java programs.  It can be used to
58   * drive any graphical application.   * programatically drive any graphical application.
59   *   *
60   * This implementation requires an X server that supports the XTest   * This implementation requires an X server that supports the XTest
61   * extension.   * extension.
# Line 384  public class Robot Line 385  public class Robot
385    }    }
386    
387    /**    /**
388     * Wait until the event dispatch thread is idle.     * Wait until all events currently on the event queue have been
389       * dispatched.
390     */     */
391    public void waitForIdle ()    public void waitForIdle ()
392    {    {
# Line 393  public class Robot Line 395  public class Robot
395                                               + "the event dispatch thread");                                               + "the event dispatch thread");
396    
397      EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();      EventQueue q = Toolkit.getDefaultToolkit ().getSystemEventQueue ();
398        try
399      while (q.peekEvent () != null)        {
400            q.invokeAndWait (new Runnable () { public void run () { } });
401          }
402        catch (InterruptedException e)
403          {
404            System.err.println ("Robot: waitForIdle interrupted");
405          }
406        catch (InvocationTargetException e)
407        {        {
408          try          System.err.println ("Robot: waitForIdle cannot invoke target");
           {  
             wait ();  
           }  
         catch (InterruptedException e)  
           {  
             System.err.println ("Robot: waitForIdle interrupted");  
           }  
409        }        }
410    }    }
411    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26