@Override public void onMove(double x, double y) { controlPoint2.setX(controlPoint4.getX()); controlPoint3.setY(controlPoint4.getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint2.setX(controlPoint4.getX()); controlPoint3.setY(controlPoint4.getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint1.setY(controlPoint2.getY()); controlPoint4.setX(controlPoint2.getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint1.setX(controlPoint3.getX()); controlPoint4.setY(controlPoint3.getY()); rectangle.setX(x - getX()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint1.setX(controlPoint3.getX()); controlPoint4.setY(controlPoint3.getY()); rectangle.setX(x - getX()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint1.setY(controlPoint2.getY()); controlPoint4.setX(controlPoint2.getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(final double x, final double y) { controlPoint2.setY(controlPoint1.getY()); controlPoint3.setX(controlPoint1.getX()); rectangle.setX(x - getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2)); bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(final double x, final double y) { controlPoint2.setY(controlPoint1.getY()); controlPoint3.setX(controlPoint1.getX()); rectangle.setX(x - getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(rectangle.getX() - (BOUNDARY_SIZE / 2)); bounding.setY(rectangle.getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); } }
@Override public void onMove(double x, double y) { controlPoint2.setX(controlPoint4.getX()); controlPoint3.setY(controlPoint4.getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setY(y - (rectangle.getHeight() / 2)); magnet2.setX(x); magnet2.setY(y - (rectangle.getHeight() / 2)); magnet3.setX(x - (rectangle.getWidth() / 2)); magnet4.setX(x - (rectangle.getWidth() / 2)); magnet4.setY(y); } }
@Override public void onMove(double x, double y) { controlPoint2.setX(controlPoint4.getX()); controlPoint3.setY(controlPoint4.getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setY(y - (rectangle.getHeight() / 2)); magnet2.setX(x); magnet2.setY(y - (rectangle.getHeight() / 2)); magnet3.setX(x - (rectangle.getWidth() / 2)); magnet4.setX(x - (rectangle.getWidth() / 2)); magnet4.setY(y); } }
@Override public void onMove(double x, double y) { controlPoint1.setX(controlPoint3.getX()); controlPoint4.setY(controlPoint3.getY()); rectangle.setX(x - getX()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(x - getX() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setX(x); magnet1.setY(y - (rectangle.getHeight() / 2)); magnet2.setY(y - (rectangle.getHeight() / 2)); magnet3.setX(x + (rectangle.getWidth() / 2)); magnet4.setX(x + (rectangle.getWidth() / 2)); magnet4.setY(y); } }
@Override public void onMove(double x, double y) { controlPoint1.setY(controlPoint2.getY()); controlPoint4.setX(controlPoint2.getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setY(y - getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setY(y + (rectangle.getHeight() / 2)); magnet2.setX(x); magnet2.setY(y + (rectangle.getHeight() / 2)); magnet3.setX(x - (rectangle.getWidth() / 2)); magnet3.setY(y); magnet4.setX(x - (rectangle.getWidth() / 2)); } }
@Override public void onMove(double x, double y) { controlPoint1.setY(controlPoint2.getY()); controlPoint4.setX(controlPoint2.getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setY(y - getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setY(y + (rectangle.getHeight() / 2)); magnet2.setX(x); magnet2.setY(y + (rectangle.getHeight() / 2)); magnet3.setX(x - (rectangle.getWidth() / 2)); magnet3.setY(y); magnet4.setX(x - (rectangle.getWidth() / 2)); } }
@Override public void onMove(double x, double y) { controlPoint1.setX(controlPoint3.getX()); controlPoint4.setY(controlPoint3.getY()); rectangle.setX(x - getX()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(x - getX() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setX(x); magnet1.setY(y - (rectangle.getHeight() / 2)); magnet2.setY(y - (rectangle.getHeight() / 2)); magnet3.setX(x + (rectangle.getWidth() / 2)); magnet4.setX(x + (rectangle.getWidth() / 2)); magnet4.setY(y); } }
public void setRadius(final double radius) { circle.setRadius(radius); bounding.setRadius(radius + (BOUNDARY_SIZE / 2)); final double theta = Math.atan(controlPoint1.getY() / controlPoint1.getX()); controlPoint1.setLocation(new Point2D(getX() + (radius * Math.cos(theta)), getY() + (radius * Math.sin(theta)))); magnet1.setLocation(new Point2D(getX() - radius, getY())); magnet2.setLocation(new Point2D(getX() + radius, getY())); magnet3.setLocation(new Point2D(getX(), getY() - radius)); magnet4.setLocation(new Point2D(getX(), getY() + radius)); } }
public void setRadius(final double radius) { circle.setRadius(radius); bounding.setRadius(radius + (BOUNDARY_SIZE / 2)); final double theta = Math.atan(controlPoint1.getY() / controlPoint1.getX()); controlPoint1.setLocation(new Point2D(getX() + (radius * Math.cos(theta)), getY() + (radius * Math.sin(theta)))); magnet1.setLocation(new Point2D(getX() - radius, getY())); magnet2.setLocation(new Point2D(getX() + radius, getY())); magnet3.setLocation(new Point2D(getX(), getY() - radius)); magnet4.setLocation(new Point2D(getX(), getY() + radius)); } }
@Override public void onMove(final double x, final double y) { controlPoint2.setY(controlPoint1.getY()); controlPoint3.setX(controlPoint1.getX()); rectangle.setX(x - getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(x - getX() - (BOUNDARY_SIZE / 2)); bounding.setY(y - getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setX(x); magnet1.setY(y + (rectangle.getHeight() / 2)); magnet2.setY(y + (rectangle.getHeight() / 2)); magnet3.setX(x + (rectangle.getWidth() / 2)); magnet3.setY(y); magnet4.setX(x + (rectangle.getWidth() / 2)); } }
@Override public void onMove(final double x, final double y) { controlPoint2.setY(controlPoint1.getY()); controlPoint3.setX(controlPoint1.getX()); rectangle.setX(x - getX()); rectangle.setY(y - getY()); rectangle.setWidth(controlPoint2.getX() - controlPoint1.getX()); rectangle.setHeight(controlPoint3.getY() - controlPoint1.getY()); bounding.setX(x - getX() - (BOUNDARY_SIZE / 2)); bounding.setY(y - getY() - (BOUNDARY_SIZE / 2)); bounding.setWidth(rectangle.getWidth() + BOUNDARY_SIZE); bounding.setHeight(rectangle.getHeight() + BOUNDARY_SIZE); magnet1.setX(x); magnet1.setY(y + (rectangle.getHeight() / 2)); magnet2.setY(y + (rectangle.getHeight() / 2)); magnet3.setX(x + (rectangle.getWidth() / 2)); magnet3.setY(y); magnet4.setX(x + (rectangle.getWidth() / 2)); } }