Example usage for javafx.scene.shape Circle setCache

List of usage examples for javafx.scene.shape Circle setCache

Introduction

In this page you can find the example usage for javafx.scene.shape Circle setCache.

Prototype

public final void setCache(boolean value) 

Source Link

Usage

From source file:Main.java

static Node dropShadow() {
    Group g = new Group();
    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0f);/* w  w w.ja  v  a 2s.c  o  m*/
    ds.setColor(Color.color(0.4f, 0.4f, 0.4f));

    Text t = new Text();
    t.setEffect(ds);
    t.setCache(true);
    t.setX(10.0f);
    t.setY(270.0f);
    t.setFill(Color.RED);
    t.setText("JavaFX drop shadow...");
    t.setFont(Font.font("null", FontWeight.BOLD, 32));

    DropShadow ds1 = new DropShadow();
    ds1.setOffsetY(4.0f);

    Circle c = new Circle();
    c.setEffect(ds1);
    c.setCenterX(50.0f);
    c.setCenterY(325.0f);
    c.setRadius(30.0f);
    c.setFill(Color.ORANGE);
    c.setCache(true);

    g.getChildren().add(t);
    g.getChildren().add(c);
    return g;
}

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);

    Group g = new Group();

    DropShadow ds1 = new DropShadow();
    ds1.setOffsetY(4.0);//from   w  ww.j a  va 2s  .com

    Circle c = new Circle();
    c.setEffect(ds1);
    c.setCenterX(50.0);
    c.setCenterY(125.0);
    c.setRadius(30.0);
    c.setFill(Color.RED);
    c.setCache(true);

    g.getChildren().add(c);

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