JavaFX add Move To Line - Java javafx.scene.shape

Java examples for javafx.scene.shape:Line

Description

JavaFX add Move To Line

Demo Code


import java.util.ArrayList;
import java.util.List;
import javafx.scene.shape.ArcTo;
import javafx.scene.shape.ClosePath;
import javafx.scene.shape.HLineTo;
import javafx.scene.shape.LineTo;
import javafx.scene.shape.MoveTo;
import javafx.scene.shape.Path;
import javafx.scene.shape.PathElement;
import javafx.scene.shape.QuadCurveTo;
import javafx.scene.shape.Shape;
import javafx.scene.shape.VLineTo;
import javafx.scene.transform.Affine;

public class Main{

    /**/*from w  ww. j a v  a 2 s .co  m*/
     *
     * @param pathSegment
     * @param x
     * @param y
     */
    public static void addMoveTo(List<PathElement> pathSegment, double x,
            double y) {
        pathSegment.add(buildMoveTo(x, y));
    }
    /**
     *
     * @param x
     * @param y
     * @return
     */
    public static MoveTo buildMoveTo(double x, double y) {
        MoveTo moveTo = new MoveTo();
        moveTo.setX(x);
        moveTo.setY(y);
        return moveTo;
    }
}

Related Tutorials