Class RobotDriver

    • Constructor Summary

      Constructors 
      Constructor Description
      RobotDriver​(Timeout autoDelay)
      Constructs a RobotDriver object.
      RobotDriver​(Timeout autoDelay, boolean smooth)  
      RobotDriver​(Timeout autoDelay, java.lang.String[] supported)
      Constructs a RobotDriver object.
      RobotDriver​(Timeout autoDelay, java.lang.String[] supported, boolean smooth)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clickMouse​(int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick)  
      void dragMouse​(int x, int y, int mouseButton, int modifiers)  
      void dragNDrop​(int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after)  
      protected void makeAnOperation​(java.lang.String method, java.lang.Object[] params, java.lang.Class[] paramClasses)
      Performs a single operation.
      void moveMouse​(int x, int y)  
      void pressKey​(int keyCode, int modifiers)
      Presses a key.
      protected void pressModifiers​(int modifiers)
      Presses modifiers keys by robot.
      void pressMouse​(int mouseButton, int modifiers)  
      void releaseKey​(int keyCode, int modifiers)
      Releases a key.
      protected void releaseModifiers​(int modifiers)
      Releases modifiers keys by robot.
      void releaseMouse​(int mouseButton, int modifiers)  
      protected void synchronizeRobot()
      Calls java.awt.Robot.waitForIdle() method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • robotReference

        protected ClassReference robotReference
        A reference to the robot instance.
      • qtool

        protected QueueTool qtool
        A QueueTool instance.
      • autoDelay

        protected Timeout autoDelay
    • Constructor Detail

      • RobotDriver

        public RobotDriver​(Timeout autoDelay,
                           java.lang.String[] supported)
        Constructs a RobotDriver object.
        Parameters:
        autoDelay - Time for Robot.setAutoDelay(long) method.
        supported - an array of supported class names
      • RobotDriver

        public RobotDriver​(Timeout autoDelay,
                           java.lang.String[] supported,
                           boolean smooth)
      • RobotDriver

        public RobotDriver​(Timeout autoDelay)
        Constructs a RobotDriver object.
        Parameters:
        autoDelay - Time for Robot.setAutoDelay(long) method.
      • RobotDriver

        public RobotDriver​(Timeout autoDelay,
                           boolean smooth)
    • Method Detail

      • pressMouse

        public void pressMouse​(int mouseButton,
                               int modifiers)
      • releaseMouse

        public void releaseMouse​(int mouseButton,
                                 int modifiers)
      • moveMouse

        public void moveMouse​(int x,
                              int y)
      • clickMouse

        public void clickMouse​(int x,
                               int y,
                               int clickCount,
                               int mouseButton,
                               int modifiers,
                               Timeout mouseClick)
      • dragMouse

        public void dragMouse​(int x,
                              int y,
                              int mouseButton,
                              int modifiers)
      • dragNDrop

        public void dragNDrop​(int start_x,
                              int start_y,
                              int end_x,
                              int end_y,
                              int mouseButton,
                              int modifiers,
                              Timeout before,
                              Timeout after)
      • pressKey

        public void pressKey​(int keyCode,
                             int modifiers)
        Presses a key.
        Parameters:
        oper - Operator to press a key on.
        keyCode - Key code (KeyEventVK_* field.
        modifiers - a combination of InputEvent.*_MASK fields.
      • releaseKey

        public void releaseKey​(int keyCode,
                               int modifiers)
        Releases a key.
        Parameters:
        oper - Operator to release a key on.
        keyCode - Key code (KeyEventVK_* field.
        modifiers - a combination of InputEvent.*_MASK fields.
      • makeAnOperation

        protected void makeAnOperation​(java.lang.String method,
                                       java.lang.Object[] params,
                                       java.lang.Class[] paramClasses)
        Performs a single operation.
        Parameters:
        method - a name of java.awt.Robot method.
        params - method parameters
        paramClasses - method parameters classes
      • synchronizeRobot

        protected void synchronizeRobot()
        Calls java.awt.Robot.waitForIdle() method.
      • pressModifiers

        protected void pressModifiers​(int modifiers)
        Presses modifiers keys by robot.
        Parameters:
        oper - an operator for a component to press keys on.
        modifiers - a combination of InputEvent.*_MASK fields.
      • releaseModifiers

        protected void releaseModifiers​(int modifiers)
        Releases modifiers keys by robot.
        Parameters:
        oper - an operator for a component to release keys on.
        modifiers - a combination of InputEvent.*_MASK fields.