Search in sources :

Example 1 with HLineTo

use of javafx.scene.shape.HLineTo in project Board-Instrumentation-Framework by intel.

the class ShapeConverter method processPath.

private static Path processPath(final List<String> PATH_LIST, final PathReader READER) {
    final Path PATH = new Path();
    PATH.setFillRule(FillRule.EVEN_ODD);
    while (!PATH_LIST.isEmpty()) {
        if ("M".equals(READER.read())) {
            PATH.getElements().add(new MoveTo(READER.nextX(), READER.nextY()));
        } else if ("L".equals(READER.read())) {
            PATH.getElements().add(new LineTo(READER.nextX(), READER.nextY()));
        } else if ("C".equals(READER.read())) {
            PATH.getElements().add(new CubicCurveTo(READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY()));
        } else if ("Q".equals(READER.read())) {
            PATH.getElements().add(new QuadCurveTo(READER.nextX(), READER.nextY(), READER.nextX(), READER.nextY()));
        } else if ("H".equals(READER.read())) {
            PATH.getElements().add(new HLineTo(READER.nextX()));
        } else if ("L".equals(READER.read())) {
            PATH.getElements().add(new VLineTo(READER.nextY()));
        } else if ("A".equals(READER.read())) {
            PATH.getElements().add(new ArcTo(READER.nextX(), READER.nextY(), 0, READER.nextX(), READER.nextY(), false, false));
        } else if ("Z".equals(READER.read())) {
            PATH.getElements().add(new ClosePath());
        }
    }
    return PATH;
}
Also used : Path(javafx.scene.shape.Path) ClosePath(javafx.scene.shape.ClosePath) SVGPath(javafx.scene.shape.SVGPath) ClosePath(javafx.scene.shape.ClosePath) MoveTo(javafx.scene.shape.MoveTo) LineTo(javafx.scene.shape.LineTo) VLineTo(javafx.scene.shape.VLineTo) HLineTo(javafx.scene.shape.HLineTo) ArcTo(javafx.scene.shape.ArcTo) QuadCurveTo(javafx.scene.shape.QuadCurveTo) VLineTo(javafx.scene.shape.VLineTo) HLineTo(javafx.scene.shape.HLineTo) CubicCurveTo(javafx.scene.shape.CubicCurveTo)

Aggregations

ArcTo (javafx.scene.shape.ArcTo)1 ClosePath (javafx.scene.shape.ClosePath)1 CubicCurveTo (javafx.scene.shape.CubicCurveTo)1 HLineTo (javafx.scene.shape.HLineTo)1 LineTo (javafx.scene.shape.LineTo)1 MoveTo (javafx.scene.shape.MoveTo)1 Path (javafx.scene.shape.Path)1 QuadCurveTo (javafx.scene.shape.QuadCurveTo)1 SVGPath (javafx.scene.shape.SVGPath)1 VLineTo (javafx.scene.shape.VLineTo)1