@Override public void init() { nextPage.setOpacity(0); wizard.getChildren().add(tempPage); wizard.getChildren().add(nextPage); newX = colorPane1.localToScene(colorPane1.getBoundsInLocal()).getMinX(); newY = colorPane1.localToScene(colorPane1.getBoundsInLocal()).getMinY(); tempPage.getChildren().add(colorPane1); colorPane1.setTranslateX(newX); colorPane1.setTranslateY(newY); }
OverLayRipple() { super(); setOverLayBounds(this); this.getStyleClass().add("jfx-rippler-overlay"); // update initial position if(JFXRippler.this.getChildrenUnmodifiable().contains(control)) { double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX()); double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY()); Bounds bounds = control.getBoundsInParent(); this.setX(bounds.getMinX() + diffMinX - snappedLeftInset()); this.setY(bounds.getMinY() + diffMinY - snappedTopInset()); } // set initial attributes setOpacity(0); setCache(true); setCacheHint(CacheHint.SPEED); setCacheShape(true); setManaged(false); } }
textBounds.getMinY() + startY, width, temp.getLayoutBounds().getHeight()));
rect.setManaged(false); rect.setX(boundingBox.getMinX()); rect.setY(boundingBox.getMinY()); rect.setWidth(boundingBox.getWidth()); rect.setHeight(boundingBox.getHeight());
private void showError(ValidatorBase validator) { // set text in error label errorLabel.setText(validator.getMessage()); // show error icon Node awsomeIcon = validator.getIcon(); errorIcon.getChildren().clear(); if (awsomeIcon != null) { errorIcon.getChildren().add(awsomeIcon); StackPane.setAlignment(awsomeIcon, Pos.TOP_RIGHT); } // init only once, to fix the text pane from resizing if (initYlayout == -1) { initYlayout = getBoundsInParent().getMinY(); initHeight = getHeight(); currentFieldHeight = initHeight; } errorContainer.setVisible(true); errorShown = true; }
double height = control.getLayoutBounds().getHeight(); double diffMinX = Math.abs(control.getBoundsInLocal().getMinX() - control.getLayoutBounds().getMinX()); double diffMinY = Math.abs(control.getBoundsInLocal().getMinY() - control.getLayoutBounds().getMinY()); double diffMaxX = Math.abs(control.getBoundsInLocal().getMaxX() - control.getLayoutBounds().getMaxX()); double diffMaxY = Math.abs(control.getBoundsInLocal().getMaxY() - control.getLayoutBounds().getMaxY()); case RECT: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth, height - 2 * borderWidth); // -0.1 to prevent resizing the anchor pane double radius = Math.min((width / 2) - 2 * borderWidth, (height / 2) - 2 * borderWidth); mask = new Circle((bounds.getMinX() + diffMinX + bounds.getMaxX() - diffMaxX) / 2 - snappedLeftInset(), (bounds.getMinY() + diffMinY + bounds.getMaxY() - diffMaxY) / 2 - snappedTopInset(), radius, Color.BLUE); mask.relocate(bounds.getMinX() + diffMinX, bounds.getMinY() + diffMinY); break; default: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth, height - 2 * borderWidth); // -0.1 to prevent resizing the anchor pane
@Override protected void layoutChildren(final double x, final double y, final double w, final double h) { super.layoutChildren(x, y, w, h); if (invalid) { updateSelectionBackground(); invalid = false; } rippler.resizeRelocate( getSkinnable().getLayoutBounds().getMinX(), getSkinnable().getLayoutBounds().getMinY(), getSkinnable().getWidth(), getSkinnable().getHeight()); }
zoomPane.setClip(new Rectangle(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(), bounds.getHeight()));
private void setFocusedSquare(ColorSquare square) { hoverSquare.setVisible(square != null); if (square == focusedSquare) { return; } focusedSquare = square; hoverSquare.setVisible(focusedSquare != null); if (focusedSquare == null) { return; } if (!focusedSquare.isFocused()) { focusedSquare.requestFocus(); } hoverSquare.rectangle.setFill(focusedSquare.rectangle.getFill()); Bounds b = square.localToScene(square.getLayoutBounds()); double x = b.getMinX(); double y = b.getMinY(); double xAdjust; double scaleAdjust = hoverSquare.getScaleX() == 1.0 ? 0 : hoverSquare.getWidth() / 4.0; if (colorPicker.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) { x = focusedSquare.getLayoutX(); xAdjust = -focusedSquare.getWidth() + scaleAdjust; } else { xAdjust = focusedSquare.getWidth() / 2.0 + scaleAdjust; } hoverSquare.setLayoutX(snapPosition(x) - xAdjust); hoverSquare.setLayoutY(snapPosition(y) - focusedSquare.getHeight() / 2.0 + (hoverSquare.getScaleY() == 1.0 ? 0 : focusedSquare .getHeight() / 4.0)); }
.get(0) .getBoundsInParent() .getMinY();
.get(0) .getBoundsInParent() .getMinY();
scrollPane.vvalueProperty().addListener((o, oldVal, newVal) -> { if (minHeight == -1) { minHeight = bottomBar.getBoundsInParent().getMinY(); maxHeight = header.getHeight();
.get(0) .getBoundsInParent() .getMinY();
private void displayLabelForData(XYChart.Data<String, Number> data) { final Node node = data.getNode(); final Text dataText = new Text(data.getYValue() + ""); node.parentProperty().addListener(new ChangeListener<Parent>() { @Override public void changed(ObservableValue<? extends Parent> ov, Parent oldParent, Parent parent) { Group parentGroup = (Group) parent; parentGroup.getChildren().add(dataText); } }); node.boundsInParentProperty().addListener(new ChangeListener<Bounds>() { @Override public void changed(ObservableValue<? extends Bounds> ov, Bounds oldBounds, Bounds bounds) { dataText.setLayoutX( Math.round( bounds.getMinX() + bounds.getWidth() / 2 - dataText.prefWidth(-1) / 2 ) ); dataText.setLayoutY( Math.round( bounds.getMinY() - dataText.prefHeight(-1) * 0.5 ) ); } }); }
.get(0) .getBoundsInParent() .getMinY();
getSkinnable().getLayoutBounds().getMinY(), getSkinnable().getWidth(), getSkinnable().getHeight()); layoutLabelInArea(x, y, w, h);
Bounds bounds = node.localToScene(node.getBoundsInLocal()); double dx = (x - (bounds.getWidth()/2 + bounds.getMinX())); double dy = (y - (bounds.getHeight()/2 + bounds.getMinY()));
Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal()); yShift = chartAreaBounds.getMinY();
pause.setOnFinished(e -> { Node theTab = tabPane.lookup("#myTab"); // contextMenu.show(theTab, Side.RIGHT, 0, 0); Bounds tabBounds = theTab.getBoundsInLocal(); double centerX = tabBounds.getMinX() + tabBounds.getWidth()/2; double centerY = tabBounds.getMinY()+tabBounds.getHeight()/2; Point2D location = theTab.localToScreen(centerX, centerY); double x = location.getX(); double y = location.getY(); Event event = new ContextMenuEvent(ContextMenuEvent.CONTEXT_MENU_REQUESTED, centerX, centerY, x, y, false, new PickResult(theTab, x, y)); Event.fireEvent(theTab, event); });
Bounds locBounds = cuboid.getBoundsInLocal(); List<Point3D> normals=Arrays.asList(new Point3D(-1,0,0),new Point3D(1,0,0), new Point3D(0,-1,0), new Point3D(0,1,0), new Point3D(0,0,-1), new Point3D(0,0,1)); List<Point3D> positions=Arrays.asList(new Point3D(locBounds.getMinX(),0,0), new Point3D(locBounds.getMaxX(),0,0), new Point3D(0,locBounds.getMinY(),0), new Point3D(0,locBounds.getMaxY(),0), new Point3D(0,0,locBounds.getMinZ()), new Point3D(0,0,locBounds.getMaxZ()));