Java examples for javafx.scene.shape:Path
Convert a JavaFX Shape to Path.
//package com.java2s; import javafx.scene.shape.Path; import javafx.scene.shape.Shape; public class Main { /**/*from w ww . ja v a 2 s.c om*/ * Convert a Shape to Path. * * @param shape * @return */ public static Path shapeToPath(Shape shape) { if (shape == null) { return null; } if (shape instanceof Path) { return (Path) shape; } return (Path) Shape.union(createEmptyShape(), shape); } /** * Create an empty Shape. * * @return */ public static Path createEmptyShape() { return new Path(); // The better, we can do !!! } }