/** * this method is used to add shadow effect to the node, * however the shadow is not real ( gets affected with node transformations) * <p> * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow */ public static void setDepth(Node control, int level) { level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; control.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); }
public static void pop(Node control) { control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1)); }
private void refreshHSLCircle() { ColorAdjust colorAdjust = new ColorAdjust(); colorAdjust.setHue(map(currentHue + (currentHue < 127.5 ? 1 : -1) * 127.5, 0, 255, -1, 1)); slCircleView.setEffect(colorAdjust); setColorAtLocation((int) selector.getTranslateX() + selectorSize / 2, (int) selector.getTranslateY() + selectorSize / 2); }
private void setFocusBorder() { InnerShadow innerFocus = new InnerShadow(); innerFocus.setColor((Color) innerFocusColorProperty().get()); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(6.5); innerFocus.setChoke(0.7); innerFocus.setOffsetX(0.0); innerFocus.setOffsetY(0.0); DropShadow outerFocus = new DropShadow(); outerFocus.setColor((Color) outerFocusColorProperty().get()); outerFocus.setBlurType(BlurType.ONE_PASS_BOX); outerFocus.setRadius(5.0); outerFocus.setSpread(0.6); outerFocus.setOffsetX(0.0); outerFocus.setOffsetY(0.0); outerFocus.setInput(innerFocus); for (Node child : getChildren()) { if (child instanceof StackPane) { child.setEffect(outerFocus); } } }
public void setFill(Color color) { innerBar.setFill(color); DropShadow ds = new DropShadow(15, color); ds.setInput(new Glow(0.5)); innerBar.setEffect(ds); }
ButtonClickTransition(Node node, DropShadow shadowEffect) { super(node, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(shadowEffect.radiusProperty(), JFXDepthManager.getShadowAt(2).radiusProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.spreadProperty(), JFXDepthManager.getShadowAt(2).spreadProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetXProperty(), JFXDepthManager.getShadowAt(2).offsetXProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetYProperty(), JFXDepthManager.getShadowAt(2).offsetYProperty().get(), Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(shadowEffect.radiusProperty(), JFXDepthManager.getShadowAt(5).radiusProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.spreadProperty(), JFXDepthManager.getShadowAt(5).spreadProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetXProperty(), JFXDepthManager.getShadowAt(5).offsetXProperty().get(), Interpolator.EASE_BOTH), new KeyValue(shadowEffect.offsetYProperty(), JFXDepthManager.getShadowAt(5).offsetYProperty().get(), Interpolator.EASE_BOTH)
public FocusBorder() { innerFocus = new InnerShadow(); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(5.0); innerFocus.setChoke(0.8); innerFocus.setOffsetX(0.0); setSpread(0.6); setBlurType(BlurType.ONE_PASS_BOX); setRadius(6.5); setOffsetX(0.0); setOffsetY(0.0); setInput(innerFocus); }
/** * Updates grayscale of the miniature when the enabled state has been updated * * @param miniature The miniature */ private void updateEnabled(final Region miniature) { if (!getControl().isEnabled()) { final ColorAdjust grayScale = new ColorAdjust(); grayScale.setSaturation(-1); miniature.setEffect(grayScale); } else { miniature.setEffect(null); } } }
/** * Define the perspective transform that will map a rectangle (control) to the paper scroll. * @return transfrom effect to be applied onto the control */ protected final PerspectiveTransform createPerspectiveTransform() { return new PerspectiveTransform(185, 0, 449, 19, 459, 502, -20, 403); } /**
public void setInnerFocusColor(Color color) { innerFocus.setColor(color); } }
level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; container.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); return container;
private void setSelectedFocusBorder() { InnerShadow innerFocus = new InnerShadow(); innerFocus.setColor((Color) innerFocusColorProperty().get()); innerFocus.setBlurType(BlurType.ONE_PASS_BOX); innerFocus.setRadius(6.5); innerFocus.setChoke(0.7); innerFocus.setOffsetX(0.0); innerFocus.setOffsetY(0.0); DropShadow outerFocus = new DropShadow(); outerFocus.setColor((Color) outerFocusColorProperty().get()); outerFocus.setBlurType(BlurType.ONE_PASS_BOX); outerFocus.setRadius(7.0); outerFocus.setSpread(0.7); outerFocus.setOffsetX(0.0); outerFocus.setOffsetY(0.0); outerFocus.setInput(innerFocus); for (Node child : getChildren()) { if (child instanceof StackPane) { child.setEffect(outerFocus); } } }
public void setFill(Color color) { innerBar.setFill(color); DropShadow ds = new DropShadow(15, color); ds.setInput(new Glow(0.5)); innerBar.setEffect(ds); }
public static void pop(Node control) { control.setEffect(new DropShadow(BlurType.GAUSSIAN, Color.rgb(0, 0, 0, 0.26), 5, 0.05, 0, 1)); }
PathClickTransition(final Path path) { super(JFXCustomColorPicker.this, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(((DropShadow) path.getEffect()).radiusProperty(), JFXDepthManager.getShadowAt(2).radiusProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).spreadProperty(), JFXDepthManager.getShadowAt(2).spreadProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).offsetXProperty(), JFXDepthManager.getShadowAt(2).offsetXProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).offsetYProperty(), JFXDepthManager.getShadowAt(2).offsetYProperty().get(), EASE_BOTH), new KeyValue(path.strokeWidthProperty(), 0, EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(((DropShadow) path.getEffect()).radiusProperty(), JFXDepthManager.getShadowAt(5).radiusProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).spreadProperty(), JFXDepthManager.getShadowAt(5).spreadProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).offsetXProperty(), JFXDepthManager.getShadowAt(5).offsetXProperty().get(), EASE_BOTH), new KeyValue(((DropShadow) path.getEffect()).offsetYProperty(), JFXDepthManager.getShadowAt(5).offsetYProperty().get(), EASE_BOTH),
private void refreshHSLCircle() { ColorAdjust colorAdjust = new ColorAdjust(); colorAdjust.setHue(map(currentHue + (currentHue < 127.5 ? 1 : -1) * 127.5, 0, 255, -1, 1)); slCircleView.setEffect(colorAdjust); setColorAtLocation((int) selector.getTranslateX() + selectorSize / 2, (int) selector.getTranslateY() + selectorSize / 2); }
/** * this method is used to add shadow effect to the node, * however the shadow is not real ( gets affected with node transformations) * <p> * use {@link #createMaterialNode(Node, int)} instead to generate a real shadow */ public static void setDepth(Node control, int level) { level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; control.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); }
setEffect(new DropShadow(3, Color.BLACK));
level = level < 0 ? 0 : level; level = level > 5 ? 5 : level; container.setEffect(new DropShadow(BlurType.GAUSSIAN, depth[level].getColor(), depth[level].getRadius(), depth[level].getSpread(), depth[level].getOffsetX(), depth[level].getOffsetY())); return container;
/** * Prepare Stage for dock feedback display */ void buildDockFeedbackStage() { dockFeedbackPopup = new Stage(StageStyle.TRANSPARENT); dockFeedback = new Rectangle(0, 0, 100, 100); dockFeedback.setArcHeight(10); dockFeedback.setArcWidth(10); dockFeedback.setFill(Color.TRANSPARENT); dockFeedback.setStroke(Color.BLACK); dockFeedback.setStrokeWidth(2); dockFeedback.setCache(true); dockFeedback.setCacheHint(CacheHint.SPEED); dockFeedback.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 10, 0.2, 3, 3)); dockFeedback.setMouseTransparent(true); BorderPane borderpane = new BorderPane(); borderpane.setStyle("-fx-background-color:transparent"); // J8 borderpane.setCenter(dockFeedback); Scene scene = new Scene(borderpane); scene.setFill(Color.TRANSPARENT); dockFeedbackPopup.setScene(scene); dockFeedbackPopup.sizeToScene(); }