java.lang.Object
org.jhotdraw8.geom.FXShapes
Provides conversion methods between AWT shapes and JavaFX shapes.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<javafx.scene.shape.PathElement> Converts a Java Path iterator to a JavaFX shape.static javafx.scene.shape.PathConverts a Java Path iterator to a JavaFX shape.static javafx.scene.shape.PathawtShapeToFXShape(Shape shape) Converts a Java AWT Shape iterator to a JavaFX Shape.static javafx.scene.shape.PathawtShapeToFXShape(Shape shape, AffineTransform at) Converts a Java AWT Shape iterator to a JavaFX Shape.static javafx.scene.shape.PathawtShapeToFXShape(Shape shape, javafx.scene.transform.Transform fxT) Converts a Java AWT Shape iterator to a JavaFX Shape.static <T extends PathBuilder<?>>
TbuildPathElements(T p, Iterable<javafx.scene.shape.PathElement> pathElements) static ShapefxBoundsToAwtShape(javafx.geometry.Bounds node) static intfxLineCapToAwtLineCap(@Nullable javafx.scene.shape.StrokeLineCap cap) static intfxLineJoinToAwtLineJoin(@Nullable javafx.scene.shape.StrokeLineJoin join) static PathIteratorfxPathElementsToAwtPathIterator(Iterable<javafx.scene.shape.PathElement> pathElements, int windingRule, @Nullable AffineTransform tx) static ShapefxPathELementsToAwtShape(Iterable<javafx.scene.shape.PathElement> pathElements, javafx.scene.shape.FillRule fillRule) static PathIteratorfxPathToAwtPathIterator(javafx.scene.shape.Path path, @Nullable AffineTransform tx) static PathIteratorfxPointsToAwtPathIterator(List<javafx.geometry.Point2D> points, boolean closed, int windingRule, @Nullable AffineTransform tx) static ShapefxRectangleToAwtShape(javafx.scene.shape.Rectangle node) static ShapefxShapeToAwtShape(javafx.scene.shape.Shape fx) Converts a JavaFX shape to a AWT shape.static @Nullable AffineTransformfxTransformToAwtTransform(@Nullable javafx.scene.transform.Transform fxT) Converts a Java Path iterator to a JavaFX shape.
-
Method Details
-
fxLineCapToAwtLineCap
public static int fxLineCapToAwtLineCap(@Nullable javafx.scene.shape.StrokeLineCap cap) -
fxLineJoinToAwtLineJoin
public static int fxLineJoinToAwtLineJoin(@Nullable javafx.scene.shape.StrokeLineJoin join) -
fxPathToAwtPathIterator
public static PathIterator fxPathToAwtPathIterator(javafx.scene.shape.Path path, @Nullable AffineTransform tx) -
fxPathElementsToAwtPathIterator
public static PathIterator fxPathElementsToAwtPathIterator(Iterable<javafx.scene.shape.PathElement> pathElements, int windingRule, @Nullable AffineTransform tx) -
fxPointsToAwtPathIterator
public static PathIterator fxPointsToAwtPathIterator(List<javafx.geometry.Point2D> points, boolean closed, int windingRule, @Nullable AffineTransform tx) -
fxShapeToAwtShape
Converts a JavaFX shape to a AWT shape.If conversion fails, returns a Rectangle.Double with the layout bounds of the shape.
- Parameters:
fx- A JavaFX shape- Returns:
- AWT Shape or Rectangle
-
fxBoundsToAwtShape
-
fxPathELementsToAwtShape
-
buildPathElements
public static <T extends PathBuilder<?>> T buildPathElements(T p, Iterable<javafx.scene.shape.PathElement> pathElements) -
fxRectangleToAwtShape
-
fxTransformToAwtTransform
public static @Nullable AffineTransform fxTransformToAwtTransform(@Nullable javafx.scene.transform.Transform fxT) Converts a Java Path iterator to a JavaFX shape.- Parameters:
fxT- A JavaFX Transform.- Returns:
- An AWT Transform.
-
awtPathIteratorToFXPathElements
public static List<javafx.scene.shape.PathElement> awtPathIteratorToFXPathElements(PathIterator iter) Converts a Java Path iterator to a JavaFX shape.- Parameters:
iter- AWT Path Iterator- Returns:
- JavaFX Shape
-
awtShapeToFXShape
public static javafx.scene.shape.Path awtShapeToFXShape(Shape shape, javafx.scene.transform.Transform fxT) Converts a Java AWT Shape iterator to a JavaFX Shape.- Parameters:
shape- AWT ShapefxT- Optional transformation which is applied to the shape- Returns:
- JavaFX Shape
-
awtShapeToFXShape
Converts a Java AWT Shape iterator to a JavaFX Shape.- Parameters:
shape- AWT Shapeat- Optional transformation which is applied to the shape- Returns:
- JavaFX Shape
-
awtShapeToFXShape
Converts a Java AWT Shape iterator to a JavaFX Shape.- Parameters:
shape- AWT Shape- Returns:
- JavaFX Shape
-
awtShapeToFXShape
Converts a Java Path iterator to a JavaFX shape.- Parameters:
iter- AWT Path Iterator- Returns:
- JavaFX Shape
-