Example usage for javafx.animation RotateTransition setFromAngle

List of usage examples for javafx.animation RotateTransition setFromAngle

Introduction

In this page you can find the example usage for javafx.animation RotateTransition setFromAngle.

Prototype

public final void setFromAngle(double value) 

Source Link

Usage

From source file:Watcher.FXMLDocumentController.java

@FXML
protected void addSite(ActionEvent event) {
    addSitePane.setVisible(true);/*from   w  ww.  j a v a  2  s  .c o m*/
    RotateTransition rt = new RotateTransition(Duration.millis(200), addSitePane);
    rt.setFromAngle(180);
    rt.setToAngle(0);
    rt.setCycleCount(1);
    rt.setInterpolator(Interpolator.EASE_IN);
    fadeout(true);
    rt.play();
}

From source file:Watcher.FXMLDocumentController.java

@FXML
protected void cancelSiteAdd(MouseEvent event) {
    RotateTransition rt = new RotateTransition(Duration.millis(200), addSitePane);
    rt.setFromAngle(0);
    rt.setToAngle(180);/* w w  w .j  a  va 2 s . c o m*/
    rt.setCycleCount(1);
    rt.setInterpolator(Interpolator.EASE_OUT);
    rt.setOnFinished(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent t) {
            addSitePane.setVisible(false);
            fadeout(false);
        }
    });

    rt.play();
}