protected void moveAttachedControlPoints() { final List<ControlPoint> controlPoints = getAttachedControlPoints(); if (controlPoints == null || controlPoints.isEmpty()) { return; } for (ControlPoint cp : controlPoints) { final double dx = getX(); final double dy = getY(); cp.setX(dx); cp.setY(dy); cp.getHandler().onMove(dx, dy); } }
protected void moveAttachedControlPoints() { final List<ControlPoint> controlPoints = getAttachedControlPoints(); if (controlPoints == null || controlPoints.isEmpty()) { return; } for (ControlPoint cp : controlPoints) { final double dx = getX(); final double dy = getY(); cp.setX(dx); cp.setY(dy); cp.getHandler().onMove(dx, dy); } }
public void setHeight(final double height) { rectangle.setHeight(height); bounding.setHeight(height + BOUNDARY_SIZE); controlPoint3.setY(getY() + rectangle.getY() + height); controlPoint4.setY(getY() + rectangle.getY() + height); magnet1.setY(getY() + rectangle.getY() + height / 2); magnet2.setY(getY() + rectangle.getY() + height / 2); magnet4.setY(getY() + rectangle.getY() + height); }
public void setHeight(final double height) { rectangle.setHeight(height); bounding.setHeight(height + BOUNDARY_SIZE); controlPoint3.setY(getY() + rectangle.getY() + height); controlPoint4.setY(getY() + rectangle.getY() + height); magnet1.setY(getY() + rectangle.getY() + height / 2); magnet2.setY(getY() + rectangle.getY() + height / 2); magnet4.setY(getY() + rectangle.getY() + height); }
@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.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(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(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.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(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)); } }