private void addDraggableNode(final Node node) { node.setOnMousePressed(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent me) { if (me.getButton() != MouseButton.MIDDLE) { initialX = me.getSceneX(); initialY = me.getSceneY(); } } }); node.setOnMouseDragged(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent me) { if (me.getButton() != MouseButton.MIDDLE) { node.getScene().getWindow().setX(me.getScreenX() - initialX); node.getScene().getWindow().setY(me.getScreenY() - initialY); } } }); }
byNode.setOnMouseDragged(mouseEvent -> { stage.setX(mouseEvent.getScreenX() + dragDelta.x); stage.setY(mouseEvent.getScreenY() + dragDelta.y);
node.setOnMouseDragged(new EventHandler<MouseEvent>() { public void handle(MouseEvent e) { Point2D localPoint = sceneRoot.sceneToLocal(new Point2D(e.getSceneX(), e.getSceneY()));
byNode.setOnMouseDragged(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent mouseEvent) { stage.setX(mouseEvent.getScreenX() + dragDelta.x);
/** * {@inheritDoc} */ @Override public void dispose() { _sprite.setOnMousePressed( null ); _sprite.setOnMouseDragged( null ); _sprite.setOnMouseReleased( null ); _sprite = null; }
private void initResizeBottom() { this.resizeBottom = createBottomResize(); this.resizeBottom.setManaged(false); getChildren().add(this.resizeBottom); ResizeHandler resizeHandler = new ResizeHandler(Location.BOTTOM); this.resizeBottom.setOnMousePressed(resizeHandler); this.resizeBottom.setOnMouseDragged(resizeHandler); this.resizeBottom.setOnMouseReleased(resizeHandler); }
private void initResizeTop() { this.resizeTop = createTopResize(); this.resizeTop.setManaged(false); getChildren().add(this.resizeTop); ResizeHandler h = new ResizeHandler(Location.TOP); this.resizeTop.setOnMousePressed(h); this.resizeTop.setOnMouseDragged(h); this.resizeTop.setOnMouseReleased(h); }
private void initResizeCornerRightBottom() { this.resizeCornerRightBottom = createResizeCornerRightBottom(); this.resizeCornerRightBottom.setManaged(false); getChildren().add(this.resizeCornerRightBottom); ResizeHandler h = new ResizeHandler(Location.BOTTOM, Location.RIGHT); this.resizeCornerRightBottom.setOnMousePressed(h); this.resizeCornerRightBottom.setOnMouseDragged(h); this.resizeCornerRightBottom.setOnMouseReleased(h); }
private void initResizeCornerRightTop() { this.resizeCornerRightTop = createResizeCornerRightTop(); this.resizeCornerRightTop.setManaged(false); getChildren().add(this.resizeCornerRightTop); ResizeHandler h = new ResizeHandler(Location.TOP, Location.RIGHT); this.resizeCornerRightTop.setOnMousePressed(h); this.resizeCornerRightTop.setOnMouseDragged(h); this.resizeCornerRightTop.setOnMouseReleased(h); }
private void initResizeCornerLeftBottom() { this.resizeCornerLeftBottom = createResizeCornerLeftBottom(); this.resizeCornerLeftBottom.setManaged(false); getChildren().add(this.resizeCornerLeftBottom); ResizeHandler h = new ResizeHandler(Location.BOTTOM, Location.LEFT); this.resizeCornerLeftBottom.setOnMousePressed(h); this.resizeCornerLeftBottom.setOnMouseDragged(h); this.resizeCornerLeftBottom.setOnMouseReleased(h); }
private void initResizeLeft() { this.resizeLeft = createLeftResize(); this.resizeLeft.setManaged(false); getChildren().add(this.resizeLeft); ResizeHandler h = new ResizeHandler(Location.LEFT); this.resizeLeft.setOnMousePressed(h); this.resizeLeft.setOnMouseDragged(h); this.resizeLeft.setOnMouseReleased(h); }
private void initResizeCornerLeftTop() { this.resizeCornerLeftTop = createResizeCornerLeftTop(); this.resizeCornerLeftTop.setManaged(false); getChildren().add(this.resizeCornerLeftTop); ResizeHandler h = new ResizeHandler(Location.TOP, Location.LEFT); this.resizeCornerLeftTop.setOnMousePressed(h); this.resizeCornerLeftTop.setOnMouseDragged(h); this.resizeCornerLeftTop.setOnMouseReleased(h); }
private void initResizeCornerRightBottom() { this.resizeCornerRightBottom = createResizeCornerRightBottom(); this.resizeCornerRightBottom.setManaged(false); getChildren().add(this.resizeCornerRightBottom); ResizeHandler h = new ResizeHandler(Location.BOTTOM, Location.RIGHT); this.resizeCornerRightBottom.setOnMousePressed(h); this.resizeCornerRightBottom.setOnMouseDragged(h); this.resizeCornerRightBottom.setOnMouseReleased(h); }
private void initResizeCornerLeftBottom() { this.resizeCornerLeftBottom = createResizeCornerLeftBottom(); this.resizeCornerLeftBottom.setManaged(false); getChildren().add(this.resizeCornerLeftBottom); ResizeHandler h = new ResizeHandler(Location.BOTTOM, Location.LEFT); this.resizeCornerLeftBottom.setOnMousePressed(h); this.resizeCornerLeftBottom.setOnMouseDragged(h); this.resizeCornerLeftBottom.setOnMouseReleased(h); }
private void initResizeCornerLeftTop() { this.resizeCornerLeftTop = createResizeCornerLeftTop(); this.resizeCornerLeftTop.setManaged(false); getChildren().add(this.resizeCornerLeftTop); ResizeHandler h = new ResizeHandler(Location.TOP, Location.LEFT); this.resizeCornerLeftTop.setOnMousePressed(h); this.resizeCornerLeftTop.setOnMouseDragged(h); this.resizeCornerLeftTop.setOnMouseReleased(h); }
private void initResizeTop() { this.resizeTop = createTopResize(); this.resizeTop.setManaged(false); getChildren().add(this.resizeTop); ResizeHandler h = new ResizeHandler(Location.TOP); this.resizeTop.setOnMousePressed(h); this.resizeTop.setOnMouseDragged(h); this.resizeTop.setOnMouseReleased(h); }
private void initResizeRight() { this.resizeRight = createRightResize(); this.resizeRight.setManaged(false); getChildren().add(this.resizeRight); ResizeHandler h = new ResizeHandler(Location.RIGHT); this.resizeRight.setOnMousePressed(h); this.resizeRight.setOnMouseDragged(h); this.resizeRight.setOnMouseReleased(h); }
private void initResizeLeft() { this.resizeLeft = createLeftResize(); this.resizeLeft.setManaged(false); getChildren().add(this.resizeLeft); ResizeHandler h = new ResizeHandler(Location.LEFT); this.resizeLeft.setOnMousePressed(h); this.resizeLeft.setOnMouseDragged(h); this.resizeLeft.setOnMouseReleased(h); }
private void initResizeRight() { this.resizeRight = createRightResize(); this.resizeRight.setManaged(false); getChildren().add(this.resizeRight); ResizeHandler h = new ResizeHandler(Location.RIGHT); this.resizeRight.setOnMousePressed(h); this.resizeRight.setOnMouseDragged(h); this.resizeRight.setOnMouseReleased(h); }
private void initResizeCornerRightTop() { this.resizeCornerRightTop = createResizeCornerRightTop(); this.resizeCornerRightTop.setManaged(false); getChildren().add(this.resizeCornerRightTop); ResizeHandler h = new ResizeHandler(Location.TOP, Location.RIGHT); this.resizeCornerRightTop.setOnMousePressed(h); this.resizeCornerRightTop.setOnMouseDragged(h); this.resizeCornerRightTop.setOnMouseReleased(h); }