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); } }
double width = control.getLayoutBounds().getWidth(); 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()); Node mask; switch (getMaskType()) {
Node chartArea = chart.lookup(".chart-plot-background"); Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());
(burgerHeight / 2) - burger.getChildren() .get(0) .getBoundsInLocal() .getHeight() / 2, Interpolator.EASE_BOTH), -((burgerHeight / 2) - burger.getChildren() .get(0) .getBoundsInLocal() .getHeight() / 2), Interpolator.EASE_BOTH),
(burgerHeight / 2) - burger.getChildren() .get(0) .getBoundsInLocal() .getHeight() / 2, Interpolator.EASE_BOTH), -((burgerHeight / 2) - burger.getChildren() .get(2) .getBoundsInLocal() .getHeight() / 2), Interpolator.EASE_BOTH),
Bounds chartAreaBounds = chartArea.localToScene(chartArea.getBoundsInLocal());
/** * Gets the scale Y. * * @param aSprite the sprite * @param aCheckerboard the checkerboard * @return the scale Y */ protected static double getScaleY( Node aSprite, FxCheckerboardViewer<?, ?> aCheckerboard ) { return aCheckerboard.getFieldHeight() / aSprite.getBoundsInLocal().getHeight(); }
@Override public RNode<T> moveToCenter() { Bounds bounds = node.getBoundsInLocal(); moveTo(bounds.getWidth() / 2, bounds.getHeight() / 2); return this; }
public <T extends Node & Caret> Bounds getCaretBoundsOnScreen(T caret) { layout(); // ensure layout, is a no-op if not dirty checkWithinParagraph(caret); Bounds localBounds = caret.getBoundsInLocal(); return caret.localToScreen(localBounds); }
@Override public RNode<T> moveToCenter(Duration d) { Bounds bounds = node.getBoundsInLocal(); return moveTo(d, bounds.getWidth() / 2, bounds.getHeight() / 2); }
/** * * @param node * @return The Y scene coordinate of the node. */ static public double sceneY(Node node) { return node.localToScene(node.getBoundsInLocal()).getMinY() + node.getScene().getY(); }
@Override public RNode<T> moveTo(Duration d, double x, double y) { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); controller.run(Move.to(d,bounds.getMinX() + x, bounds.getMinY() + y)); return null; }
@Override public RNode<T> dragTo(double x, double y) { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); controller.run(Drag.to(bounds.getWidth() / 2, bounds.getHeight() / 2, x, y)); return this; }
@Override public RNode<T> dragTo(Duration d, double x, double y) { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); controller.run(Drag.to(d, bounds.getWidth() / 2, bounds.getHeight() / 2, x, y)); return this; }
@Override public Point2D center() { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); return new Point2D(bounds.getMinX() + bounds.getWidth()/2, bounds.getMinY() + bounds.getHeight()/2); }
/** * * @param node * @return The Y screen coordinate of the node. */ static public double screenY(Node node) { return node.localToScene(node.getBoundsInLocal()).getMinY() + node.getScene().getY() + node.getScene().getWindow().getY(); }
/** * * @param node * @return The X screen coordinate of the node. */ static public double screenX(Node node) { return node.localToScene(node.getBoundsInLocal()).getMinX() + node.getScene().getX() + node.getScene().getWindow().getX(); }
/** * * @param node * @return The X screen coordinate of the node. */ static public double screenX(Node node) { return node.localToScene(node.getBoundsInLocal()).getMinX() + node.getScene().getX() + node.getScene().getWindow().getX(); }
@Override public RNode<T> dragBy(Duration d, double dx, double dy) { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); controller.run(Drag.by(d, bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy)); return this; }
@Override public RNode<T> dragBy(double dx, double dy) { Bounds bounds = node.localToScreen(node.getBoundsInLocal()); controller.run(Drag.by( bounds.getMinX() + bounds.getWidth() / 2, bounds.getMinY() + bounds.getHeight() / 2, dx, dy)); return this; }