Example usage for javafx.scene.effect Reflection setFraction

List of usage examples for javafx.scene.effect Reflection setFraction

Introduction

In this page you can find the example usage for javafx.scene.effect Reflection setFraction.

Prototype

public final void setFraction(double value) 

Source Link

Usage

From source file:Main.java

static Node reflection() {
    Text t = new Text();
    t.setX(10.0f);//  w  w  w .j  a va  2  s  .c  o m
    t.setY(50.0f);
    t.setCache(true);
    t.setText("Reflections on JavaFX...");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 30));

    Reflection r = new Reflection();
    r.setFraction(0.7f);

    t.setEffect(r);

    t.setTranslateY(400);
    return t;
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Text Fonts");
    Group root = new Group();
    Scene scene = new Scene(root, 550, 250, Color.WHITE);

    Text text = new Text(50, 50, "JavaFX 2.0 from Java2s.com");
    Font monoFont = Font.font("Dialog", 30);
    text.setFont(monoFont);/*w  w  w  .  j a v  a  2 s.c  o m*/
    text.setFill(Color.BLACK);
    root.getChildren().add(text);

    Reflection refl = new Reflection();
    refl.setFraction(0.8f);
    text.setEffect(refl);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    Text t = new Text();
    t.setX(10.0);//from  ww  w  . j ava2 s.com
    t.setY(50.0);
    t.setCache(true);
    t.setText("Reflections on JavaFX...");
    t.setFill(Color.RED);
    t.setFont(Font.font(null, FontWeight.BOLD, 30));

    Reflection r = new Reflection();
    r.setFraction(0.7);

    t.setEffect(r);

    root.getChildren().add(t);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(final Stage stage) throws Exception {
    Group rootGroup = new Group();
    Scene scene = new Scene(rootGroup, 800, 400);

    Text text1 = new Text(25, 25, "java2s.com");
    text1.setFill(Color.CHOCOLATE);
    text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35));

    final Reflection reflection = new Reflection();
    reflection.setFraction(1.0);
    text1.setEffect(reflection);/*  w ww . j  a  v a 2 s  .co m*/

    rootGroup.getChildren().add(text1);

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

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Title");

    final Circle circ = new Circle(40, 40, 30);
    final Group root = new Group(circ);

    final Scene scene = new Scene(root, 800, 400, Color.BEIGE);

    final Text text1 = new Text(25, 25, "java2s.com");
    text1.setFill(Color.DARKBLUE);
    text1.setFont(Font.font(java.awt.Font.SERIF, 25));
    final Reflection reflection = new Reflection();
    reflection.setFraction(1.0);
    text1.setEffect(reflection);//from ww  w  .  j a  v  a2 s .  com

    root.getChildren().add(text1);

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

From source file:Main.java

private void createControls() {
    artist = new Label();
    artist.setId("artist");
    album = new Label();
    album.setId("album");
    title = new Label();
    title.setId("title");
    year = new Label();
    year.setId("year");

    final Reflection reflection = new Reflection();
    reflection.setFraction(0.2);

    //    final URL url = getClass().getResource("resources/defaultAlbum.png");
    //   final Image image = new Image(url.toString());

    //    albumCover = new ImageView(image);
    //   albumCover.setFitWidth(240);
    //  albumCover.setPreserveRatio(true);
    // albumCover.setSmooth(true);
    // albumCover.setEffect(reflection);
}

From source file:AudioPlayer3.java

private ImageView createAlbumCover() {
    final Reflection reflection = new Reflection();
    reflection.setFraction(0.2);

    final ImageView albumCover = new ImageView();
    albumCover.setFitWidth(240);/*from   w  w  w. java  2  s  . c om*/
    albumCover.setPreserveRatio(true);
    albumCover.setSmooth(true);
    albumCover.setEffect(reflection);

    return albumCover;
}