Example #1
0
  public void move() {

    if (face.equals(Direction.NORTH)) {
      point.move((int) point.getX(), (int) point.getY() + 1);
      // robot.getPoint().getY() < tableTop.getMaxY() - 1
    } else if (face.equals(Direction.EAST)) {
      point.move((int) point.getX() + 1, (int) point.getY());
      // robot.getPoint().getX() < tableTop.getMaxX() - 1
    } else if (face.equals(Direction.SOUTH)) {
      point.move((int) point.getX(), (int) point.getY() - 1);
      // robot.getPoint().getY() > 0
    } else if (face.equals(Direction.WEST)) {
      point.move((int) point.getX() - 1, (int) point.getY());
      // robot.getPoint().getX() > 0
    }
  }
Example #2
0
 /**
  * Hops to specified location.
  *
  * @param x x
  * @param y y
  */
 public static void hop(int x, int y) {
   last.move(x, y);
   com.infibot.client.accessors.Mouse m = Game.getClient().getMouse();
   m.mouseMoved(
       new MouseEvent(
           Game.getCanvas(),
           MouseEvent.MOUSE_MOVED,
           System.currentTimeMillis(),
           0,
           x,
           y,
           0,
           false));
 }
Example #3
0
 public void move(int x, int y, int z) {
   this.z = z;
   super.move(x, y);
 }
 public void setTopLeft(Point p) {
   topLeft.move((int) p.getX(), (int) p.getY());
   bottomRight.move((int) p.getX() + this.xLength, (int) p.getY() + this.yLength);
 }
Example #5
0
 private void drag(
     RenderedWebElement elem, Point expectedLocation, int moveRightBy, int moveDownBy) {
   elem.dragAndDropBy(moveRightBy, moveDownBy);
   expectedLocation.move(expectedLocation.x + moveRightBy, expectedLocation.y + moveDownBy);
 }