Example usage for javafx.scene.shape MoveTo MoveTo

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

Introduction

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

Prototype

public MoveTo(double x, double y) 

Source Link

Document

Creates a new instance of MoveTo.

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {

    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 0.0f));
    path.getElements().add(new HLineTo(80.0f));

    Group root = new Group();
    root.getChildren().add(path);//from w ww  . java2 s. c om
    primaryStage.setScene(new Scene(root, 300, 250));
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    Group group = new Group();

    Path spade = new Path();
    spade.getElements().add(new MoveTo(25.0f, 0.0f));
    spade.getElements()//from w  ww. j ava2 s .co m
            .add(QuadCurveToBuilder.create().controlX(40.0f).controlY(50.0f).x(27.0f).y(30.0f).build());

    group.getChildren().add(spade);

    Scene scene = new Scene(group, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Path pathTriangle = new Path(new MoveTo(50, 0), new LineTo(0, 50), new LineTo(100, 50), new LineTo(50, 0));

    pathTriangle.setFill(Color.LIGHTGRAY);
    pathTriangle.setStroke(Color.BLACK);

    SVGPath svgTriangle = new SVGPath();
    svgTriangle.setContent("M50, 0 L10, 20 L100, 50 Z");
    svgTriangle.setFill(Color.LIGHTGRAY);
    svgTriangle.setStroke(Color.BLACK);

    HBox root = new HBox(pathTriangle, svgTriangle);
    root.setSpacing(10);/* w ww.j  a v a  2  s .  c o m*/
    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 using Path and SVGPath Classes");
    stage.show();
}

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);// w  w  w . j  a v  a 2s.c  o m
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    path.getElements().add(new VLineTo(50.0f));

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*  w w w.ja v a  2 s . c o  m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);

    path.getElements().add(vlt);
    System.out.println(vlt.getY());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*from   w ww. j  a va2s  .  co m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.getY());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from  w  w w. j a va  2s. c o  m
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo();
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(final Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//from w  w w  .  j  a v a 2s.c  o m
    stage.setHeight(500);
    Scene scene = new Scene(new Group());

    VBox root = new VBox();

    Path path = new Path();
    path.getElements().add(new MoveTo(50.0f, 0.0f));
    VLineTo vlt = new VLineTo(50.0f);
    vlt.setY(.7);
    path.getElements().add(vlt);

    System.out.println(vlt.yProperty());

    root.getChildren().addAll(path);
    scene.setRoot(root);

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

From source file:Main.java

@Override
public void start(Stage stage) {
    ArcTo arcTo = new ArcTo();
    arcTo.setX(20);//from w w w .jav  a  2s  . c  o  m
    arcTo.setY(30);

    arcTo.setRadiusX(30);
    arcTo.setRadiusY(30);

    Path path = new Path(new MoveTo(0, 0), new VLineTo(100), new HLineTo(100), new VLineTo(50), arcTo);
    HBox box = new HBox(path);

    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) {
    Scene scene = new Scene(new Group());
    stage.setTitle("");
    stage.setWidth(230);/*from  w ww .  ja v a  2s . c o  m*/
    stage.setHeight(120);

    Path path = new Path();
    path.getElements().add(new MoveTo(0.0f, 50.0f));
    path.getElements().add(new LineTo(100.0f, 100.0f));

    VBox vbox = new VBox();
    vbox.getChildren().addAll(path);
    vbox.setSpacing(5);

    HBox root = new HBox();
    root.getChildren().add(vbox);
    root.setSpacing(40);
    root.setPadding(new Insets(20, 10, 10, 20));

    ((Group) scene.getRoot()).getChildren().add(root);

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