コード例 #1
0
  public static void sikuliDragAndDrop(
      LiferaySelenium liferaySelenium, String image, String coordString) throws Exception {

    ScreenRegion screenRegion = new DesktopScreenRegion();

    ImageTarget imageTarget = getImageTarget(liferaySelenium, image);

    screenRegion = screenRegion.find(imageTarget);

    Mouse mouse = new DesktopMouse();

    mouse.move(screenRegion.getCenter());

    Robot robot = new Robot();

    robot.delay(1000);

    mouse.press();

    robot.delay(2000);

    String[] coords = coordString.split(",");

    Location location = screenRegion.getCenter();

    int x = location.getX() + GetterUtil.getInteger(coords[0]);
    int y = location.getY() + GetterUtil.getInteger(coords[1]);

    robot.mouseMove(x, y);

    robot.delay(1000);

    mouse.release();
  }
コード例 #2
0
  public static void sikuliLeftMouseUp(LiferaySelenium liferaySelenium) throws Exception {

    liferaySelenium.pause("1000");

    Mouse mouse = new DesktopMouse();

    mouse.release();
  }