Java Code Examples for javafx.scene.Node#scaleYProperty()

The following examples show how to use javafx.scene.Node#scaleYProperty() . 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 vote down vote up
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 vote down vote up
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: RootActionPane.java    From triplea with GNU General Public License v3.0 5 votes vote down vote up
private static Timeline getAnimation(final Node node) {
  return new Timeline(
      new KeyFrame(
          Duration.ZERO,
          new KeyValue(node.scaleXProperty(), 0.0),
          new KeyValue(node.scaleYProperty(), 0.0)),
      new KeyFrame(new Duration(100), new KeyValue(node.scaleYProperty(), 1.1)),
      new KeyFrame(new Duration(200), new KeyValue(node.scaleXProperty(), 0.4)),
      new KeyFrame(
          new Duration(300),
          new KeyValue(node.scaleXProperty(), 1.0),
          new KeyValue(node.scaleYProperty(), 1.0)));
}
 
Example 4
Source File: JFXAlertAnimation.java    From JFoenix with Apache License 2.0 5 votes vote down vote up
@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 5
Source File: Animations.java    From pdfsam with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * creates a shake animation. This is based on https://github.com/fxexperience/code/blob/master/FXExperienceControls/src/com/fxexperience/javafx/animation/TadaTransition.java
 * and http://daneden.github.io/animate.css/
 * 
 * @param node
 * @return
 */
public static Timeline shake(Node node) {
    Timeline timeline = new Timeline(new KeyFrame(Duration.millis(2500)),
            new KeyFrame(Duration.millis(0), new KeyValue(node.scaleXProperty(), 1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 0, EASE_BOTH)),
            new KeyFrame(Duration.millis(100), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
            new KeyFrame(Duration.millis(200), new KeyValue(node.scaleXProperty(), 0.9, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 0.9, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
            new KeyFrame(Duration.millis(300), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
            new KeyFrame(Duration.millis(400), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
            new KeyFrame(Duration.millis(500), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
            new KeyFrame(Duration.millis(600), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
            new KeyFrame(Duration.millis(700), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
            new KeyFrame(Duration.millis(800), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), -3, EASE_BOTH)),
            new KeyFrame(Duration.millis(900), new KeyValue(node.scaleXProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1.1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 3, EASE_BOTH)),
            new KeyFrame(Duration.millis(1000), new KeyValue(node.scaleXProperty(), 1, EASE_BOTH),
                    new KeyValue(node.scaleYProperty(), 1, EASE_BOTH),
                    new KeyValue(node.rotateProperty(), 0, EASE_BOTH)));
    timeline.setCycleCount(Timeline.INDEFINITE);
    timeline.setDelay(Duration.millis(2000));
    return timeline;
}