} else if (shape instanceof Rectangle) {
Rectangle rectangle = (Rectangle) shape;
rectangle.setX(rectangle.getX() + x);
rectangle.setY(rectangle.getY() + y);
} else if (shape instanceof Circle) {
Circle circle = (Circle) shape;
circle.setX(circle.getX() + x);
circle.setY(circle.getY() + y);
} else if (shape instanceof Polygon) {
Polygon polygon = (Polygon) shape;
final int size = polygon.getSize();
for (int i = 0; i < size; i++) {
polygon.setVertex(i, polygon.getX(i) + x, polygon.getY(i) + y);