Example usage for javafx.scene.effect Bloom setThreshold

List of usage examples for javafx.scene.effect Bloom setThreshold

Introduction

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

Prototype

public final void setThreshold(double value) 

Source Link

Usage

From source file:Main.java

static Node bloom() {
    Group g = new Group();

    Rectangle r = new Rectangle();
    r.setX(10);/*  w ww . j  a  v a  2s .  c o  m*/
    r.setY(10);
    r.setWidth(160);
    r.setHeight(80);
    r.setFill(Color.DARKBLUE);

    Text t = new Text();
    t.setText("Bloom!");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font("null", FontWeight.BOLD, 36));
    t.setX(25);
    t.setY(65);

    g.setCache(true);
    //g.setEffect(new Bloom());
    Bloom bloom = new Bloom();
    bloom.setThreshold(1.0);
    g.setEffect(bloom);
    g.getChildren().add(r);
    g.getChildren().add(t);
    g.setTranslateX(350);
    return g;
}