Package at.bestsolution.animationutils.pagetransition.animation

Source Code of at.bestsolution.animationutils.pagetransition.animation.RotateOutAnimation

package at.bestsolution.animationutils.pagetransition.animation;

import javafx.animation.Animation;
import javafx.animation.ParallelTransitionBuilder;
import javafx.animation.RotateTransitionBuilder;
import javafx.animation.ScaleTransitionBuilder;
import javafx.scene.Node;
import javafx.util.Duration;
import at.bestsolution.animationutils.pagetransition.ACenterSwitchAnimation;

public class RotateOutAnimation extends ACenterSwitchAnimation {

  @Override
  protected Animation createAndPrepareAnimation(Node curNode, Node newNode) {
   
    return ParallelTransitionBuilder.create()
      .children(
        RotateTransitionBuilder.create()
          .node(curNode)
          .byAngle(360)
          .duration(new Duration(600))
          .build(),
        ScaleTransitionBuilder.create()
          .node(curNode)
          .toX(0)
          .toY(0)
          .duration(new Duration(600))
          .build()
      )
      .build();
  }
 
  @Override
  protected void resetProperties(Node curNode, Node newNode) {
    curNode.setRotate(0);
    curNode.setScaleX(1);
    curNode.setScaleY(1);
  }

}
TOP

Related Classes of at.bestsolution.animationutils.pagetransition.animation.RotateOutAnimation

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.