Example usage for javafx.animation RotateTransition setOnFinished

List of usage examples for javafx.animation RotateTransition setOnFinished

Introduction

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

Prototype

public final void setOnFinished(EventHandler<ActionEvent> value) 

Source Link

Usage

From source file:Watcher.FXMLDocumentController.java

@FXML
protected void cancelSiteAdd(MouseEvent event) {
    RotateTransition rt = new RotateTransition(Duration.millis(200), addSitePane);
    rt.setFromAngle(0);// ww  w .j a v  a 2  s . c  om
    rt.setToAngle(180);
    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();
}