protected void updateControlPointLocations(final double dx, final double dy) { if (controlPoints == null) { return; } for (ControlPoint cp : controlPoints) { cp.move(dx, dy); } } }
@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); } }
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 setWidth(final double width) { rectangle.setWidth(width); bounding.setWidth(width + BOUNDARY_SIZE); controlPoint2.setX(getX() + rectangle.getX() + width); controlPoint4.setX(getX() + rectangle.getX() + width); magnet2.setX(getX() + rectangle.getX() + width); magnet3.setX(getX() + rectangle.getX() + width / 2); magnet4.setX(getX() + rectangle.getX() + width / 2); }
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 onNodeDragMove(final NodeDragMoveEvent nodeDragMoveEvent) { moveHandler.onMove(DefaultControlPoint.this.getX(), DefaultControlPoint.this.getY()); getLayer().batch(); } });
@Override public void deselectShape(final WiresBaseShape shape) { if (shape == null) { return; } selectedShape = null; if (shape instanceof HasControlPoints) { ((HasControlPoints) shape).hideControlPoints(); } if (shape instanceof HasMagnets) { ((HasMagnets) shape).hideMagnetPoints(); } canvasLayer.batch(); }
@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); } }
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 setWidth(final double width) { rectangle.setWidth(width); bounding.setWidth(width + BOUNDARY_SIZE); controlPoint2.setX(getX() + rectangle.getX() + width); controlPoint4.setX(getX() + rectangle.getX() + width); magnet2.setX(getX() + rectangle.getX() + width); magnet3.setX(getX() + rectangle.getX() + width / 2); magnet4.setX(getX() + rectangle.getX() + width / 2); }
protected void updateControlPointLocations(final double dx, final double dy) { if (controlPoints == null) { return; } for (ControlPoint cp : controlPoints) { cp.move(dx, dy); } } }
@Override public void onNodeDragMove(final NodeDragMoveEvent nodeDragMoveEvent) { moveHandler.onMove(DefaultControlPoint.this.getX(), DefaultControlPoint.this.getY()); getLayer().batch(); } });
@Override public void deselectShape(final WiresBaseShape shape) { if (shape == null) { return; } selectedShape = null; if (shape instanceof HasControlPoints) { ((HasControlPoints) shape).hideControlPoints(); } if (shape instanceof HasMagnets) { ((HasMagnets) shape).hideMagnetPoints(); } canvasLayer.batch(); }
@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); } }