Example usage for javafx.scene.effect Reflection Reflection

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

Introduction

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

Prototype

public Reflection() 

Source Link

Document

Creates a new instance of Reflection with default parameters.

Usage

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);/*from ww w.  ja va  2s. c o  m*/
    text1.setEffect(reflection);

    rootGroup.getChildren().add(text1);

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

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);//from   w w  w .j a v a  2  s  .  c  om
    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 w  ww  .ja  v  a2s .c o  m
    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(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);//from  ww w  .j  ava2 s. c o m
    text1.setEffect(reflection);

    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);/*from   w w w  . j a v  a2 s .  c om*/

    //    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:Main.java

static Node reflection() {
    Text t = new Text();
    t.setX(10.0f);//w  w w  . j a v  a  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:AudioPlayer3.java

private ImageView createAlbumCover() {
    final Reflection reflection = new Reflection();
    reflection.setFraction(0.2);//ww w .  j ava  2s . co  m

    final ImageView albumCover = new ImageView();
    albumCover.setFitWidth(240);
    albumCover.setPreserveRatio(true);
    albumCover.setSmooth(true);
    albumCover.setEffect(reflection);

    return albumCover;
}

From source file:Main.java

private Effect getEffect() {
    Effect effect = null;/*  w  w w.j a v  a  2 s.com*/
    if (dropshadowEffect.isSelected()) {
        effect = new DropShadow();
    } else if (reflectionEffect.isSelected()) {
        effect = new Reflection();
    } else if (glowEffect.isSelected()) {
        effect = new Glow();
    }

    return effect;
}