@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(-(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())); }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()); }
temp.setText(lineText.substring(0, beginIndex + queryLength)); temp.applyCss(); double maxX = temp.getLayoutBounds().getMaxX(); double startX = maxX - width;
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()); Node mask; case CIRCLE: 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,
public HorizontalTransition(boolean leftDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateXProperty(), (contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()) * (leftDirection? -1 : 1), Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(contentContainer.translateXProperty(), 0, Interpolator.EASE_OUT) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); } }
/** * @return maxX of internal bounds (x + width) */ public double getMaxX() { return bounds.getMaxX(); }
private static Text helpIcon(HelpPopup popup) { Text icon = MaterialDesignIconFactory.get().createIcon(MaterialDesignIcon.HELP_CIRCLE, "1.1em"); icon.setOnMouseEntered(e -> { Point2D p = icon.localToScreen(icon.getLayoutBounds().getMaxX(), icon.getLayoutBounds().getMaxY()); popup.show(icon, p.getX(), p.getY()); }); icon.setOnMouseExited(e -> popup.hide()); return icon; } }
valueMarker.setEndX(chartAreaBounds.getMaxX()); updateMarker();
Bounds userTextFieldBounds = userTextField.getBoundsInLocal(); Point2D popupLocation = userTextField.localToScene(userTextFieldBounds.getMaxX(), userTextFieldBounds.getMinY()); popup.show(userTextField, popupLocation.getX()+scene.getX()+primaryStage.getX(), popupLocation.getY()+scene.getY()+primaryStage.getY());
@Override protected double computeMinWidth(double h) { double minX = Double.MAX_VALUE; double maxX = Double.MIN_VALUE; for (Node n : getManagedChildren()) { minX = Math.min(minX, n.getBoundsInParent().getMinX()); maxX = Math.max(maxX, n.getBoundsInParent().getMaxX()); } return maxX; }
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()));
public <T extends Node & Caret> double getCaretOffsetX(T caret) { layout(); // ensure layout, is a no-op if not dirty checkWithinParagraph(caret); Bounds bounds = caret.getLayoutBounds(); return (bounds.getMinX() + bounds.getMaxX()) / 2; }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(-(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX())); }
/** * @return center point of this hit box, local to 0,0 (top,left) of the entity */ public Point2D centerLocal() { return new Point2D((bounds.getMinX() + bounds.getMaxX()) / 2, (bounds.getMinY() + bounds.getMaxY()) / 2); }
/** * @return center point of this hit box, local to 0,0 (top,left) of the entity */ public Point2D centerLocal() { return new Point2D((bounds.getMinX() + bounds.getMaxX()) / 2, (bounds.getMinY() + bounds.getMaxY()) / 2); }
@Override public void initAnimation(Node contentContainer, Node overlay) { overlay.setOpacity(0); contentContainer.setTranslateX(contentContainer.getLayoutX() + contentContainer.getLayoutBounds().getMaxX()); }
/** * Indicates whether the specified selection is inside the specified bounds. * * @param selection * the selection as a {@link Rectangle2D} * @param bounds * the {@link Bounds} to check the selection against * @return {@code true} if the selection is fully contained in the bounds; otherwise {@code false} */ private static boolean inBounds(Rectangle2D selection, Bounds bounds) { return bounds.getMinX() <= selection.getMinX() && bounds.getMinY() <= selection.getMinY() && selection.getMaxX() <= bounds.getMaxX() && selection.getMaxY() <= bounds.getMaxY(); }
private static Point2D project(Point2D p, Bounds bounds) { double x = clamp(p.getX(), bounds.getMinX(), bounds.getMaxX()); double y = clamp(p.getY(), bounds.getMinY(), bounds.getMaxY()); return new Point2D(x, y); }
public void setPosition(Point3DReadOnly position) { positionDecoupled.set(position); Bounds boundsInLocal = text3dMesh.getBoundsInLocal(); text3dMesh.setTranslateX(((boundsInLocal.getMinX() - boundsInLocal.getMaxX()) / 2.0) - boundsInLocal.getMinX() + positionDecoupled.getX()); text3dMesh.setTranslateY(((boundsInLocal.getMaxY() - boundsInLocal.getMinY()) / 2.0) - boundsInLocal.getMaxY() + positionDecoupled.getY()); text3dMesh.setTranslateZ(((boundsInLocal.getMinZ() - boundsInLocal.getMaxZ()) / 2.0) - boundsInLocal.getMinZ() + positionDecoupled.getZ()); }
public void setPosition(TransformablePoint3d position) { positionDecoupled.set(position); Bounds boundsInLocal = text3dMesh.getBoundsInLocal(); text3dMesh.setTranslateX(((boundsInLocal.getMinX() - boundsInLocal.getMaxX()) / 2.0) - boundsInLocal.getMinX() + positionDecoupled.getX()); text3dMesh.setTranslateY(((boundsInLocal.getMaxY() - boundsInLocal.getMinY()) / 2.0) - boundsInLocal.getMaxY() + positionDecoupled.getY()); text3dMesh.setTranslateZ(((boundsInLocal.getMinZ() - boundsInLocal.getMaxZ()) / 2.0) - boundsInLocal.getMinZ() + positionDecoupled.getZ()); }