Example usage for javafx.scene.shape Arc setFill

List of usage examples for javafx.scene.shape Arc setFill

Introduction

In this page you can find the example usage for javafx.scene.shape Arc setFill.

Prototype

public final void setFill(Paint value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.LIGHTGRAY);

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);//from   www  .j a  va  2s.  co  m
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.TRANSPARENT);
    arc.setStroke(Color.BLACK);/*from www  . j a va2 s  . c  o  m*/

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.TRANSPARENT);
    arc.setStroke(Color.BLACK);/*from  w w w.  ja va 2s .c om*/
    arc.setType(ArcType.ROUND);

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);//from w  w  w . java 2s  .com
    arc.setType(ArcType.ROUND);

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.TRANSPARENT);
    arc.setStroke(Color.BLACK);/*w  w w . j a  v  a2s .c o  m*/
    arc.setType(ArcType.CHORD);

    HBox box = new HBox(arc);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);/*from ww  w  .  j a  v  a2  s.  c  o m*/
    arc.setType(ArcType.ROUND);

    HBox box = new HBox(arc);

    box.setSpacing(10);
    box.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;"
            + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;");

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.GRAY);
    arc.setStroke(Color.BLACK);//  w  ww  . j a  v  a2  s . c o m
    arc.setType(ArcType.ROUND);

    Arc arc1 = new Arc(0, 0, 50, 100, 0, 90);
    arc1.setFill(Color.GRAY);
    arc1.setStroke(Color.BLACK);
    arc1.setType(ArcType.ROUND);

    HBox box = new HBox(arc, arc1);

    box.setSpacing(10);

    Scene scene = new Scene(box);
    stage.setScene(scene);
    stage.setTitle("Test");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Circle circle = new Circle(40);
    circle.setFill(Color.RED);/*ww w.j  a  va  2  s  .co  m*/
    circle.setStroke(Color.BLACK);
    circle.setStrokeWidth(2.0);

    Rectangle rect = new Rectangle(120, 75);
    rect.setFill(Color.RED);

    // Create a line
    Line line = new Line(0, 0, 150, 50);
    line.setStrokeWidth(5.0);
    line.setStroke(Color.GREEN);

    // Create a parallelogram
    Polygon parallelogram = new Polygon();
    parallelogram.getPoints().addAll(30.0, 0.0, 130.0, 0.0, 120.00, 50.0, 0.0, 50.0);
    parallelogram.setFill(Color.AZURE);
    parallelogram.setStroke(Color.BLACK);

    // Create a hexagon
    Polyline hexagon = new Polyline(100.0, 0.0, 120.0, 20.0, 110.0, 140.0, 100.0, 60.0, 80.0, 40.0, 80.0, 120.0,
            100.0, 0.0);
    hexagon.setFill(Color.WHITE);
    hexagon.setStroke(Color.BLACK);

    // A CHORD arc with no fill and a stroke
    Arc arc = new Arc(0, 0, 50, 100, 0, 90);
    arc.setFill(Color.TRANSPARENT);
    arc.setStroke(Color.BLACK);
    arc.setType(ArcType.CHORD);

    // Add all shapes to an HBox
    HBox root = new HBox(circle, rect, line, parallelogram, hexagon, arc);
    root.setSpacing(10);
    root.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;"
            + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;");

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("2D Shapes");
    stage.show();
}