Example usage for javafx.scene.shape QuadCurveTo setControlY

List of usage examples for javafx.scene.shape QuadCurveTo setControlY

Introduction

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

Prototype

public final void setControlY(double value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 300, 150);
    stage.setScene(scene);//from  ww w .java 2  s  . c o m
    stage.setTitle("");

    Path path = new Path();

    MoveTo moveTo = new MoveTo();
    moveTo.setX(0.0f);
    moveTo.setY(50.0f);

    QuadCurveTo quadTo = new QuadCurveTo();
    quadTo.setControlX(25.0f);
    quadTo.setControlY(0.0f);
    quadTo.setX(50.0f);
    quadTo.setY(50.0f);

    path.getElements().add(moveTo);
    path.getElements().add(quadTo);

    root.getChildren().add(path);

    scene.setRoot(root);
    stage.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);

    Path path = new Path();

    QuadCurveTo quadCurveTo = new QuadCurveTo();
    quadCurveTo.setX(50);//from  w ww.jav a2  s.co  m
    quadCurveTo.setY(50);
    quadCurveTo.setControlX(10);
    quadCurveTo.setControlY(50);

    LineTo lineTo1 = new LineTo();
    lineTo1.setX(150);
    lineTo1.setY(150);

    LineTo lineTo2 = new LineTo();
    lineTo2.setX(100);
    lineTo2.setY(200);

    LineTo lineTo3 = new LineTo();
    lineTo3.setX(350);
    lineTo3.setY(150);

    MoveTo moveTo = new MoveTo();
    moveTo.setX(50);
    moveTo.setY(150);

    path.getElements().add(moveTo);
    path.getElements().add(quadCurveTo);
    path.getElements().add(lineTo1);
    path.getElements().add(lineTo2);
    path.getElements().add(lineTo3);
    path.setTranslateY(30);
    path.setStrokeWidth(3);
    path.setStroke(Color.BLACK);

    root.getChildren().add(path);

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