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); } }
switch (getMaskType()) { case RECT: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth, 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, break; default: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth,
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); } }
switch (getMaskType()) { case RECT: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth, 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, break; default: mask = new Rectangle(bounds.getMinX() + diffMinX - snappedLeftInset(), bounds.getMinY() + diffMinY - snappedTopInset(), width - 2 * borderWidth,