java.lang.Object
org.jhotdraw8.geom.FXShapes
Provides conversion methods between AWT shapes and JavaFX shapes.
- Author:
- Werner Randelshofer
-
Method Summary
Modifier and TypeMethodDescriptionConverts a Java Path iterator to a JavaFX shape.static @NonNull javafx.scene.shape.PathawtShapeToFXShape(@NonNull Shape shape) Converts a Java AWT Shape iterator to a JavaFX Shape.static @NonNull javafx.scene.shape.PathawtShapeToFXShape(@NonNull Shape shape, AffineTransform at) Converts a Java AWT Shape iterator to a JavaFX Shape.static @NonNull javafx.scene.shape.PathawtShapeToFXShape(@NonNull Shape shape, javafx.scene.transform.Transform fxT) Converts a Java AWT Shape iterator to a JavaFX Shape.static @NonNull javafx.scene.shape.PathConverts a Java Path iterator to a JavaFX shape.static <T extends PathBuilder<?>>
@NonNull TbuildPathElements(@NonNull T p, @NonNull Iterable<javafx.scene.shape.PathElement> pathElements) fxBoundsToAwtShape(@NonNull javafx.geometry.Bounds node) static intfxLineCapToAwtLineCap(@Nullable javafx.scene.shape.StrokeLineCap cap) static intfxLineJoinToAwtLineJoin(@Nullable javafx.scene.shape.StrokeLineJoin join) static PathIteratorfxPathElementsToAwtPathIterator(@NonNull Iterable<javafx.scene.shape.PathElement> pathElements, int windingRule, @Nullable AffineTransform tx) fxPathELementsToAwtShape(@NonNull Iterable<javafx.scene.shape.PathElement> pathElements, javafx.scene.shape.FillRule fillRule) static PathIteratorfxPathToAwtPathIterator(@NonNull javafx.scene.shape.Path path, @Nullable AffineTransform tx) static @NonNull PathIteratorfxPointsToAwtPathIterator(@NonNull List<javafx.geometry.Point2D> points, boolean closed, int windingRule, @Nullable AffineTransform tx) fxRectangleToAwtShape(@NonNull 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
-
fxLineJoinToAwtLineJoin
-
fxPathToAwtPathIterator
public static PathIterator fxPathToAwtPathIterator(@NonNull javafx.scene.shape.Path path, @Nullable AffineTransform tx) -
fxPathElementsToAwtPathIterator
public static PathIterator fxPathElementsToAwtPathIterator(@NonNull Iterable<javafx.scene.shape.PathElement> pathElements, int windingRule, @Nullable AffineTransform tx) -
fxPointsToAwtPathIterator
public static @NonNull PathIterator fxPointsToAwtPathIterator(@NonNull 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<?>> @NonNull T buildPathElements(@NonNull T p, @NonNull 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 @NonNull List<javafx.scene.shape.PathElement> awtPathIteratorToFXPathElements(@NonNull PathIterator iter) Converts a Java Path iterator to a JavaFX shape.- Parameters:
iter- AWT Path Iterator- Returns:
- JavaFX Shape
-
awtShapeToFXShape
public static @NonNull javafx.scene.shape.Path awtShapeToFXShape(@NonNull 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
public static @NonNull javafx.scene.shape.Path awtShapeToFXShape(@NonNull Shape shape, AffineTransform at) 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
-