Class MouseEventDriver

All Implemented Interfaces:
LightDriver, MouseDriver

public class MouseEventDriver extends EventDriver implements MouseDriver
MouseDriver using event dispatching.
Author:
Alexandre Iline(alexandre.iline@sun.com)
  • Constructor Details

    • MouseEventDriver

      public MouseEventDriver(String[] supported)
      Constructs a MouseEventDriver object.
      Parameters:
      supported - an array of supported class names
    • MouseEventDriver

      public MouseEventDriver()
      Constructs a MouseEventDriver object.
  • Method Details

    • pressMouse

      public void pressMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
      Description copied from interface: MouseDriver
      Presses mouse.
      Specified by:
      pressMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
      x - Relative x coordinate.
      y - Relative y coordinate.
      mouseButton - mouse button (InputEvent.BUTTON*_MASK field)
      modifiers - a combination of InputEvent.*_MASK fields.
    • releaseMouse

      public void releaseMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
      Description copied from interface: MouseDriver
      Releases mouse.
      Specified by:
      releaseMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
      x - Relative x coordinate.
      y - Relative y coordinate.
      mouseButton - mouse button (InputEvent.BUTTON*_MASK field)
      modifiers - a combination of InputEvent.*_MASK fields.
    • moveMouse

      public void moveMouse(ComponentOperator oper, int x, int y)
      Description copied from interface: MouseDriver
      Moves mouse.
      Specified by:
      moveMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
      x - Relative x coordinate.
      y - Relative y coordinate.
    • clickMouse

      public void clickMouse(ComponentOperator oper, int x, int y, int clickCount, int mouseButton, int modifiers, Timeout mouseClick)
      Description copied from interface: MouseDriver
      Clicks mouse.
      Specified by:
      clickMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
      x - Relative x coordinate.
      y - Relative y coordinate.
      clickCount - How many times to click.
      mouseButton - mouse button (InputEvent.BUTTON*_MASK field)
      modifiers - a combination of InputEvent.*_MASK fields.
      mouseClick - Time between pressing and releasing mouse.
    • dragMouse

      public void dragMouse(ComponentOperator oper, int x, int y, int mouseButton, int modifiers)
      Description copied from interface: MouseDriver
      Drags mouse.
      Specified by:
      dragMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
      x - Relative x coordinate.
      y - Relative y coordinate.
      mouseButton - mouse button (InputEvent.BUTTON*_MASK field)
      modifiers - a combination of InputEvent.*_MASK fields.
    • dragNDrop

      public void dragNDrop(ComponentOperator oper, int start_x, int start_y, int end_x, int end_y, int mouseButton, int modifiers, Timeout before, Timeout after)
      Description copied from interface: MouseDriver
      Performs drag'n'drop.
      Specified by:
      dragNDrop in interface MouseDriver
      Parameters:
      oper - Component operator.
      start_x - Relative x coordinate of start point.
      start_y - Relative y coordinate of start point.
      end_x - Relative x coordinate of end point.
      end_y - Relative y coordinate of end point.
      mouseButton - mouse button (InputEvent.BUTTON*_MASK field)
      modifiers - a combination of InputEvent.*_MASK fields.
      before - Time to sleep after taking (before dragging)
      after - Time to sleep before dropping (after dragging)
    • enterMouse

      public void enterMouse(ComponentOperator oper)
      Description copied from interface: MouseDriver
      Moves mouse inside a component.
      Specified by:
      enterMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
    • exitMouse

      public void exitMouse(ComponentOperator oper)
      Description copied from interface: MouseDriver
      Moves mouse outside a component.
      Specified by:
      exitMouse in interface MouseDriver
      Parameters:
      oper - Component operator.
    • dispatchEvent

      protected void dispatchEvent(Component comp, int id, int modifiers, int x, int y, int clickCount, int mouseButton)
      Dispatches a mouse event to the component.
      Parameters:
      comp - Component to dispatch events to.
      id - an event id.
      modifiers - a combination of InputEvent.*_MASK fields.
      x - relative x coordinate of event point
      y - relative y coordinate of event point
      clickCount - click count
      mouseButton - mouse button.