Example usage for javafx.scene.paint Color VIOLET

List of usage examples for javafx.scene.paint Color VIOLET

Introduction

In this page you can find the example usage for javafx.scene.paint Color VIOLET.

Prototype

Color VIOLET

To view the source code for javafx.scene.paint Color VIOLET.

Click Source Link

Document

The color violet with an RGB value of #EE82EE

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);/* w  w w  .  java2 s  . co 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:Main.java

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

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

    ScaleTransition st = new ScaleTransition(Duration.millis(2000), rect);
    st.setByX(1.5f);
    st.setByY(1.5f);
    st.setAutoReverse(true);

    st.play();

    root.getChildren().add(rect);

    stage.show();

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);/*from w  ww.  j  a  va2 s  .  c  om*/

    VBox vb = new VBox();

    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);
    SequentialTransition seqTransition = new SequentialTransition(new PauseTransition(Duration.millis(1000)), // wait a second
            rt);
    seqTransition.play();

    vb.getChildren().add(rect);
    scene.setRoot(vb);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Sample");
    stage.setWidth(300);/*w  w  w. j av a  2s.c  om*/
    stage.setHeight(190);

    VBox vbox = new VBox();
    vbox.setLayoutX(20);
    vbox.setLayoutY(20);

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

    TranslateTransition tt = new TranslateTransition(Duration.millis(2000), rect);
    tt.setByX(200f);
    tt.setAutoReverse(true);

    tt.play();

    vbox.getChildren().add(rect);
    vbox.setSpacing(10);
    ((Group) scene.getRoot()).getChildren().add(vbox);

    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 260, 80);
    stage.setScene(scene);/*from w  w  w  . j  a v  a2 s  . c om*/

    VBox vb = new VBox();

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

    final Duration SEC_2 = Duration.millis(2000);
    final Duration SEC_3 = Duration.millis(3000);

    FadeTransition ft = new FadeTransition(SEC_3);
    ft.setFromValue(1.0f);
    ft.setToValue(0.3f);

    ft.setAutoReverse(true);
    TranslateTransition tt = new TranslateTransition(SEC_2);
    tt.setFromX(-100f);
    tt.setToX(100f);

    tt.setAutoReverse(true);
    RotateTransition rt = new RotateTransition(SEC_3);
    rt.setByAngle(180f);

    rt.setAutoReverse(true);
    ScaleTransition st = new ScaleTransition(SEC_2);
    st.setByX(1.5f);
    st.setByY(1.5f);

    st.setAutoReverse(true);

    ParallelTransition pt = new ParallelTransition(rect, ft, tt, rt, st);
    pt.play();
    vb.getChildren().add(rect);

    scene.setRoot(vb);
    stage.show();
}