JavaFX add Vertical Line To Path - Java javafx.scene.shape

Java examples for javafx.scene.shape:Path

Description

JavaFX add Vertical Line To Path

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  ww  w.  ja v  a2 s  .  c o m*/
     * @param pathSegment
     * @param y
     */
    public static void addVLineTo(List<PathElement> pathSegment, double y) {
        pathSegment.add(buildVLineTo(y));
    }
    /**
     *
     * @param y
     * @return
     */
    public static VLineTo buildVLineTo(double y) {
        VLineTo vLineTo = new VLineTo();
        vLineTo.setY(y);
        return vLineTo;
    }
}

Related Tutorials