Example usage for javafx.animation RotateTransition play

List of usage examples for javafx.animation RotateTransition play

Introduction

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

Prototype

public void play() 

Source Link

Document

Plays Animation from current position in the direction indicated by rate .

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 500, 200);
    stage.setScene(scene);//  ww w  . j a  va2  s.c o m

    Rectangle rect = new Rectangle(100, 40, 100, 100);
    rect.setArcHeight(50);
    rect.setArcWidth(50);
    rect.setFill(Color.VIOLET);

    RotateTransition rt = new RotateTransition(Duration.millis(3000), rect);
    rt.setByAngle(180);
    rt.setAutoReverse(true);

    rt.play();

    root.getChildren().add(rect);

    stage.show();

}

From source file:ijfx.ui.plugin.overlay.OverlayPanel.java

public void onGearClicked(MouseEvent e) {
    if (!optionsPane.isShowing()) {
        RotateTransition rotate = new RotateTransition(Duration.millis(500), gearIcon);
        rotate.setByAngle(180);// w  ww .j a v  a2  s.com
        rotate.play();
        optionsPane.show(gearIcon);
    } else {
        RotateTransition rotate = new RotateTransition(Duration.millis(500), gearIcon);
        rotate.setByAngle(-180);
        rotate.play();
        optionsPane.hide();
    }

    e.consume();
}

From source file:pe.edu.system.jcmr.controlador.SplashController.java

public void start() {

    FadeTransition tt = new FadeTransition(Duration.seconds(16), stackMain);
    //         tt.setFromAngle(0);
    //         tt.setToAngle(360);
    //         tt.setAutoReverse(true);
    //         tt.setCycleCount(4);
    //         tt.setInterpolator(Interpolator.);
    //         tt.setAxis( Rotate.X_AXIS );

    tt.setAutoReverse(true);/*from w w w .  ja  va  2  s .  c o  m*/
    tt.setCycleCount(3);
    tt.setFromValue(1.0);
    tt.setToValue(0.0);

    RotateTransition rr = new RotateTransition(Duration.seconds(30), imgLogo);
    rr.setCycleCount(3);
    rr.setByAngle(360);

    //        rotator.setInterpolator(Interpolator.LINEAR);
    //                tt.setFromX( -(imgLogo.getFitWidth()) );
    //                tt.setToX( stackMain.getPrefWidth() );
    //                tt.setCycleCount( Timeline.INDEFINITE );
    //                tt.play();
    rr.play();
}

From source file:pe.edu.system.jcmr.controlador.SplashController.java

public void start2() {

    FadeTransition tt = new FadeTransition(Duration.seconds(16), stackMain);
    //         tt.setFromAngle(0);
    //         tt.setToAngle(360);
    //         tt.setAutoReverse(true);
    //         tt.setCycleCount(4);
    //         tt.setInterpolator(Interpolator.);
    //         tt.setAxis( Rotate.X_AXIS );

    tt.setAutoReverse(true);/*from w  w  w .j  a va2s  . co  m*/
    tt.setCycleCount(3);
    tt.setFromValue(1.0);
    tt.setToValue(0.0);

    RotateTransition rr = new RotateTransition(Duration.seconds(30), imgLogo2);
    rr.setCycleCount(3);
    rr.setByAngle(360);

    //        rotator.setInterpolator(Interpolator.LINEAR);
    //                tt.setFromX( -(imgLogo.getFitWidth()) );
    //                tt.setToX( stackMain.getPrefWidth() );
    //                tt.setCycleCount( Timeline.INDEFINITE );
    //                tt.play();
    rr.play();
}

From source file:Watcher.FXMLDocumentController.java

@FXML
protected void addSite(ActionEvent event) {
    addSitePane.setVisible(true);//from   w w  w  . 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);/*from  ww  w  . java 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();
}