Class RobotEventGenerator

java.lang.Object
org.fest.swing.core.RobotEventGenerator
All Implemented Interfaces:
InputEventGenerator

class RobotEventGenerator extends Object implements InputEventGenerator
Understands input event generation using a AWT Robot.
  • Field Details

  • Constructor Details

    • RobotEventGenerator

      RobotEventGenerator()
    • RobotEventGenerator

      RobotEventGenerator(Settings settings)
    • RobotEventGenerator

      RobotEventGenerator(RobotFactory robotFactory, Settings settings)
  • Method Details

    • robot

      Robot robot()
    • pressMouse

      public void pressMouse(Component c, Point where, int buttons)
      Simulates a user pressing the given mouse buttons on the given Component. If the given component is null, this method will delegate to InputEventGenerator.pressMouse(Point, int).
      Specified by:
      pressMouse in interface InputEventGenerator
      Parameters:
      c - the Component to click on.
      where - the given coordinates, relative to the given Component.
      buttons - the mouse buttons to press.
    • pressMouse

      public void pressMouse(Point where, int buttons)
      Simulates a user pressing the given mouse buttons on the given coordinates.
      Specified by:
      pressMouse in interface InputEventGenerator
      Parameters:
      where - the coordinates where to press the given mouse buttons.
      buttons - the mouse buttons to press.
    • pressMouse

      public void pressMouse(int buttons)
      Simulates a user pressing mouse buttons.
      Specified by:
      pressMouse in interface InputEventGenerator
      Parameters:
      buttons - the buttons to press.
    • releaseMouse

      public void releaseMouse(int buttons)
      Releases the given mouse buttons.
      Specified by:
      releaseMouse in interface InputEventGenerator
      Parameters:
      buttons - the mouse buttons to release.
    • rotateMouseWheel

      public void rotateMouseWheel(int amount)
      Rotates the scroll wheel on wheel-equipped mice.
      Specified by:
      rotateMouseWheel in interface InputEventGenerator
      Parameters:
      amount - number of "notches" to move the mouse wheel. Negative values indicate movement up/away from the user, while positive values indicate movement down/towards the user.
    • moveMouse

      public void moveMouse(Component c, int x, int y)
      Simulates a user moving the mouse pointer to the given coordinates relative to the given Component.
      Specified by:
      moveMouse in interface InputEventGenerator
      Parameters:
      c - the given Component.
      x - X coordinate, relative to the given Component.
      y - Y coordinate, relative to the given Component.
    • moveMouse

      public void moveMouse(int x, int y)
      Simulates a user moving the mouse pointer to the given coordinates.
      Specified by:
      moveMouse in interface InputEventGenerator
      Parameters:
      x - X coordinate.
      y - Y coordinate.
    • pressKey

      public void pressKey(int keyCode, char keyChar)
      Simulates a user pressing given key.
      Specified by:
      pressKey in interface InputEventGenerator
      Parameters:
      keyCode - the code of the key to press.
      keyChar - the given character.
      See Also:
    • releaseKey

      public void releaseKey(int keyCode)
      Simulates a user releasing the given key.
      Specified by:
      releaseKey in interface InputEventGenerator
      Parameters:
      keyCode - the code of the key to release.
      See Also: