Java Code Examples for javafx.scene.Node#opacityProperty()
The following examples show how to use
javafx.scene.Node#opacityProperty() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JFXCheckBoxSkin.java From JFoenix with Apache License 2.0 | 6 votes |
CheckBoxTransition(Node mark) { super(null, new Timeline( new KeyFrame( Duration.ZERO, new KeyValue(mark.opacityProperty(), 0, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame(Duration.millis(400), new KeyValue(mark.opacityProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleXProperty(), 0.5, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 0.5, Interpolator.EASE_OUT) ), new KeyFrame( Duration.millis(1000), new KeyValue(mark.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(mark.scaleYProperty(), 1, Interpolator.EASE_OUT) ) ) ); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.12)); setDelay(Duration.seconds(0.05)); this.mark = mark; }
Example 2
Source File: CenterTransition.java From JFoenix with Apache License 2.0 | 6 votes |
public CenterTransition(Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.scaleXProperty(), 0, Interpolator.LINEAR), new KeyValue(contentContainer.scaleYProperty(), 0, Interpolator.LINEAR), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ), new KeyFrame(Duration.millis(1000), new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH) ))); // reduce the number to increase the shifting , increase number to reduce shifting setCycleDuration(Duration.seconds(0.4)); setDelay(Duration.seconds(0)); }
Example 3
Source File: HorizontalTransition.java From JFoenix with Apache License 2.0 | 6 votes |
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)); }
Example 4
Source File: VerticalTransition.java From JFoenix with Apache License 2.0 | 6 votes |
public VerticalTransition(boolean topDirection, Node contentContainer, Node overlay) { super(contentContainer, new Timeline( new KeyFrame(Duration.ZERO, new KeyValue(contentContainer.translateYProperty(), (contentContainer.getLayoutY() + contentContainer.getLayoutBounds().getMaxY()) * (topDirection? -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.translateYProperty(), 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)); }
Example 5
Source File: FlipOutXTransition.java From TweetwallFX with MIT License | 6 votes |
/** * Create new FlipOutXTransition * * @param node The node to affect */ public FlipOutXTransition(final Node node) { this.node = node; timeline = new Timeline( new KeyFrame(Duration.millis(0), new KeyValue(node.rotateProperty(), 0, EASE), new KeyValue(node.opacityProperty(), 1, EASE) ), new KeyFrame(Duration.millis(1000), new KeyValue(node.rotateProperty(), -90, EASE), new KeyValue(node.opacityProperty(), 0, EASE) ) ); setCycleDuration(Duration.seconds(1)); setDelay(Duration.seconds(0.2)); statusProperty().addListener((ObservableValue<? extends Status> ov, Status t, Status newStatus) -> { if (Status.RUNNING == newStatus) { starting(); } else { stopping(); } }); }
Example 6
Source File: JFXAlertAnimation.java From JFoenix with Apache License 2.0 | 5 votes |
@Override public Animation createShowingAnimation(Node contentContainer, Node overlay) { return new CachedTransition(contentContainer, new Timeline( new KeyFrame(Duration.millis(1000), new KeyValue(contentContainer.scaleXProperty(), 1, Interpolator.EASE_OUT), new KeyValue(contentContainer.scaleYProperty(), 1, Interpolator.EASE_OUT), new KeyValue(overlay.opacityProperty(), 1, Interpolator.EASE_BOTH) ))) { { setCycleDuration(Duration.millis(160)); setDelay(Duration.seconds(0)); } }; }
Example 7
Source File: JFXAlertAnimation.java From JFoenix with Apache License 2.0 | 5 votes |
@Override public Animation createHidingAnimation(Node contentContainer, Node overlay) { return new CachedTransition(contentContainer, new Timeline( new KeyFrame(Duration.millis(1000), new KeyValue(overlay.opacityProperty(), 0, Interpolator.EASE_BOTH) ))) { { setCycleDuration(Duration.millis(160)); setDelay(Duration.seconds(0)); } }; }
Example 8
Source File: FlipInXTransition.java From TweetwallFX with MIT License | 5 votes |
/** * Create new FlipInXTransition * * @param node The node to affect */ public FlipInXTransition(final Node node) { this.node = node; this.node.setOpacity(0); timeline = new Timeline( new KeyFrame(Duration.millis(0), new KeyValue(node.rotateProperty(), -90, EASE), new KeyValue(node.opacityProperty(), 0, EASE) ), new KeyFrame(Duration.millis(400), new KeyValue(node.rotateProperty(), 10, EASE) ), new KeyFrame(Duration.millis(700), new KeyValue(node.rotateProperty(), -10, EASE) ), new KeyFrame(Duration.millis(1000), new KeyValue(node.rotateProperty(), 0, EASE), new KeyValue(node.opacityProperty(), 1, EASE) ) ); setCycleDuration(Duration.seconds(2)); setDelay(Duration.seconds(0.2)); statusProperty().addListener((ObservableValue<? extends Status> ov, Status t, Status newStatus) -> { if (Status.RUNNING == newStatus) { starting(); } else { stopping(); } }); }