@Override public void setCursorPosition (int x, int y) { if (robot != null) { robot.mouseMove(canvas.getLocationOnScreen().x + x, canvas.getLocationOnScreen().y + y); } }
@Override public void setCursorPosition (int x, int y) { if (robot != null) { robot.mouseMove(canvas.getLocationOnScreen().x + x, canvas.getLocationOnScreen().y + y); } }
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }
@Override public Point getLocationOnScreen() { try { return super.getLocationOnScreen(); } catch (IllegalComponentStateException e) {} return new Point(); }
@Override public void setCursorPosition (int x, int y) { if (robot != null) { robot.mouseMove(canvas.getLocationOnScreen().x + x, canvas.getLocationOnScreen().y + y); } }
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }