Example usage for javafx.scene.shape Shape setStroke

List of usage examples for javafx.scene.shape Shape setStroke

Introduction

In this page you can find the example usage for javafx.scene.shape Shape setStroke.

Prototype

public final void setStroke(Paint value) 

Source Link

Usage

From source file:Main.java

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

    Ellipse bigCircle = EllipseBuilder.create().centerX(100).centerY(100).radiusX(50).radiusY(75 / 2)
            .strokeWidth(3).stroke(Color.BLACK).fill(Color.WHITE).build();

    Ellipse smallCircle = EllipseBuilder.create().centerX(100).centerY(100).radiusX(35 / 2).radiusY(25 / 2)

            .build();/*  w w  w .  j  a  v  a 2 s .c  om*/

    Shape shape = Path.subtract(bigCircle, smallCircle);
    shape.setStrokeWidth(1);
    shape.setStroke(Color.BLACK);

    shape.setFill(Color.rgb(255, 200, 0));

    root.getChildren().add(shape);

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

From source file:Main.java

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

    Ellipse bigCircle = EllipseBuilder.create().centerX(100).centerY(100).radiusX(50).radiusY(75 / 2)
            .strokeWidth(3).stroke(Color.BLACK).fill(Color.WHITE).build();

    Ellipse smallCircle = EllipseBuilder.create().centerX(100).centerY(100).radiusX(35 / 2).radiusY(25 / 2)
            .build();/*w  w  w .  j  ava 2s .  c om*/

    Shape shape = Path.subtract(bigCircle, smallCircle);
    shape.setStrokeWidth(1);
    shape.setStroke(Color.BLACK);

    shape.setFill(Color.rgb(255, 200, 0));

    DropShadow dropShadow = DropShadowBuilder.create().offsetX(2.0f).offsetY(2.0f)
            .color(Color.rgb(50, 50, 50, .588)).build();
    shape.setEffect(dropShadow);

    root.getChildren().add(shape);

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