notification.setLayoutX(area.getWidth()); notification.setLayoutY(area.getHeight());
newNode.setLayoutX(100d); newNode.setLayoutY(100d); FadeTransition ft = new FadeTransition(Duration.millis(350), newNode);
@Override public void layoutChildren() { double caretOffset = getCharLocation(this.insertionIndex); this.insertionMarker.setLayoutX(caretOffset); this.insertionMarker.setLayoutY(0); this.insertionMarker.toFront(); } }
public void relocate(Node node, double x, double y, double z) { node.setLayoutX(x - node.getLayoutBounds().getMinX()); node.setLayoutY(y - node.getLayoutBounds().getMinY()); } }
System.out.print("D"); if (intersectedNode != null) { intersectedNode.setLayoutX(event.getX() + dragStart.getX()); intersectedNode.setLayoutY(event.getY() + dragStart.getY());
connectorShape.getNode().setLayoutX(computeConnectorXValue(c) - connectorShape.getRadius()); connectorShape.getNode().setLayoutY(computeConnectorYValue(c) - connectorShape.getRadius()); connectorShape.getNode().setLayoutX(computeConnectorXValue(c)- connectorShape.getRadius()); connectorShape.getNode().setLayoutY(computeConnectorYValue(c)- connectorShape.getRadius()); connectorShape.getNode().setLayoutX(computeConnectorXValue(c) - connectorShape.getRadius()); connectorShape.getNode().setLayoutY(computeConnectorYValue(c)
theSprite.setLayoutX( -(thePoint.getX()) ); theSprite.setLayoutY( -(thePoint.getY()) ); theSprite.setTranslateX( toPixelPositionX( aPlayer ) );
theSprite.setLayoutX( -(thePoint.getX()) ); theSprite.setLayoutY( -(thePoint.getY()) ); theSprite.setTranslateX( toPixelPositionX( aPlayer ) );
/** * Fx scale player. * * @param aPlayer the player * @param aFieldDimension the field dimension * @param aPrecedingFieldDimension the preceding field dimension */ private void fxScalePlayer( P aPlayer, FieldDimension aFieldDimension, FieldDimension aPrecedingFieldDimension ) { Node theSprite; synchronized ( _playerToSprite ) { theSprite = _playerToSprite.get( aPlayer ); } theSprite.setScaleX( aFieldDimension.getFieldWidth() / theSprite.getBoundsInLocal().getWidth() ); theSprite.setScaleY( aFieldDimension.getFieldHeight() / theSprite.getBoundsInLocal().getHeight() ); double theLayoutX = (aFieldDimension.getFieldWidth() - theSprite.getBoundsInLocal().getWidth()) / 2; double theLayoutY = (aFieldDimension.getFieldHeight() - theSprite.getBoundsInLocal().getHeight()) / 2; theSprite.setLayoutX( theLayoutX ); theSprite.setLayoutY( theLayoutY ); theSprite.setTranslateX( toPixelPositionX( aPlayer ) ); theSprite.setTranslateY( toPixelPositionY( aPlayer ) ); }
node.setLayoutX(node.getLayoutX() + me.getX() - dragDelta.x); node.setLayoutY(node.getLayoutY() + me.getY() - dragDelta.y); });
protected void initMaterialNodeDrag() { final Delta dragDelta = new Delta(); materialNode.setOnMousePressed(mouseEvent -> { AnchorPane.setTopAnchor(materialNode, null); AnchorPane.setBottomAnchor(materialNode, null); AnchorPane.setRightAnchor(materialNode, null); // record a delta distance for the drag and drop operation. dragDelta.x = materialNode.getLayoutX() - mouseEvent.getSceneX(); dragDelta.y = materialNode.getLayoutY() - mouseEvent.getSceneY(); materialNode.setCursor(Cursor.MOVE); }); materialNode.setOnMouseReleased(mouseEvent -> materialNode.setCursor(Cursor.HAND)); materialNode.setOnMouseDragged(mouseEvent -> { materialNode.setLayoutX(mouseEvent.getSceneX() + dragDelta.x); materialNode.setLayoutY(mouseEvent.getSceneY() + dragDelta.y); }); materialNode.setOnMouseEntered(mouseEvent -> materialNode.setCursor(Cursor.HAND)); }
public void performDrag( Node n, MouseEvent event) { final double parentScaleX = n.getParent(). localToSceneTransformProperty().getValue().getMxx(); final double parentScaleY = n.getParent(). localToSceneTransformProperty().getValue().getMyy(); // Get the exact moved X and Y double offsetX = event.getSceneX() - mouseX; double offsetY = event.getSceneY() - mouseY; nodeX += offsetX; nodeY += offsetY; double scaledX; double scaledY; if (centerNode) { Point2D p2d = n.getParent().sceneToLocal(mouseX, mouseY); scaledX = p2d.getX(); scaledY = p2d.getY(); } else { scaledX = nodeX * 1 / (parentScaleX); scaledY = nodeY * 1 / (parentScaleY); } n.setLayoutX(scaledX); n.setLayoutY(scaledY); // again set current Mouse x AND y position mouseX = event.getSceneX(); mouseY = event.getSceneY(); }
node.setLayoutX(SHADOW_WIDTH + ROUNDED_DELTA); node.setLayoutY(SHADOW_WIDTH + ROUNDED_DELTA);
decorationNode.setLayoutX(x + xOffset); decorationNode.setLayoutY(y + yOffset);
double offsetForAllY = scaledY - n.getLayoutY(); n.setLayoutX(scaledX); n.setLayoutY(scaledY);
double offsetForAllY = scaledY - n.getLayoutY(); n.setLayoutX(scaledX); n.setLayoutY(scaledY);
double offsetForAllY = scaledY - n.getLayoutY(); n.setLayoutX(scaledX); n.setLayoutY(scaledY);