Example usage for javafx.scene.shape Circle Circle

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

Introduction

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

Prototype

public Circle() 

Source Link

Document

Creates an empty instance of Circle.

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Circle c = new Circle();
    Group root = new Group(c);
    Scene scene = new Scene(root, 100, 100);

    c.centerXProperty().bind(scene.widthProperty().divide(2));
    c.centerYProperty().bind(scene.heightProperty().divide(2));
    c.radiusProperty().bind(Bindings.min(scene.widthProperty(), scene.heightProperty()).divide(2));

    stage.setTitle("A Centered Circle");
    stage.setScene(scene);//  w w  w.  j  a  va2 s. c om
    stage.sizeToScene();
    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.web("0x0000FF"));

    Circle circle = new Circle();
    circle.setCenterX(100.0f);/*from   ww  w .j a v  a 2s. c om*/
    circle.setCenterY(100.0f);
    circle.setRadius(50.0f);

    root.getChildren().add(circle);

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

    Group g = new Group();

    DropShadow ds1 = new DropShadow();
    ds1.setOffsetY(4.0);/*from  www .j  av a2  s.c  o m*/

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

From source file:Main.java

static Node blendMode() {
    Rectangle r = new Rectangle();
    r.setX(590);/* www.ja v  a2s . c o m*/
    r.setY(50);
    r.setWidth(50);
    r.setHeight(50);
    r.setFill(Color.BLUE);

    Circle c = new Circle();
    c.setFill(Color.rgb(255, 0, 0, 0.5f));
    c.setCenterX(590);
    c.setCenterY(50);
    c.setRadius(25);

    Group g = new Group();
    g.setBlendMode(BlendMode.MULTIPLY);
    g.getChildren().add(r);
    g.getChildren().add(c);
    return g;
}

From source file:Main.java

static Node dropShadow() {
    Group g = new Group();
    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0f);//  w  w  w .  j  a  v  a 2 s.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:Pages.LandingPage.java

public void profilePicture(String picture, Stage theStage) {
    // <editor-fold defaultstate="collapsed" desc="Circle Image">

    profile_pic = (new ImageView(new Image(picture)));
    Rectangle square = new Rectangle();
    square.setWidth(150);/*from   w w  w  . j a v a2  s .c  o  m*/
    square.setHeight(150);
    profile_pic.setClip(square);
    Circle clip = new Circle();
    clip.setCenterX(75);
    clip.setCenterY(75);
    clip.setRadius(75);
    profile_pic.fitWidthProperty().bind(square.widthProperty());
    profile_pic.fitHeightProperty().bind(square.heightProperty());
    profile_pic.setClip(clip);

    profile_pic.setOnMouseClicked(new EventHandler<MouseEvent>() {

        @Override
        public void handle(MouseEvent arg0) {
            createProfilePicture(theStage);
        }

    });

    userbox.getChildren().add(profile_pic);
    // </editor-fold>  
}