Class FXShapes

java.lang.Object
org.jhotdraw8.geom.FXShapes

public class FXShapes extends Object
Provides conversion methods between AWT shapes and JavaFX shapes.
Author:
Werner Randelshofer
  • Method Details

    • awtCapFromFX

      public static int awtCapFromFX(@Nullable javafx.scene.shape.StrokeLineCap cap)
    • awtJoinFromFX

      public static int awtJoinFromFX(@Nullable javafx.scene.shape.StrokeLineJoin join)
    • awtPathIteratorFromFXPathElements

      public static PathIterator awtPathIteratorFromFXPathElements(List<javafx.scene.shape.PathElement> pathElements, int windingRule, AffineTransform tx)
    • awtPathIteratorFromFxPoint2Ds

      public static @NonNull PathIterator awtPathIteratorFromFxPoint2Ds(@NonNull List<javafx.geometry.Point2D> points, boolean closed, int windingRule, @Nullable AffineTransform tx)
    • awtShapeFromFX

      public static Shape awtShapeFromFX(javafx.scene.shape.Shape fx)
      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
    • awtShapeFromFXBounds

      public static @NonNull Shape awtShapeFromFXBounds(@NonNull javafx.geometry.Bounds node)
    • awtShapeFromFXPathElements

      public static @NonNull Shape awtShapeFromFXPathElements(@NonNull Iterable<javafx.scene.shape.PathElement> pathElements, javafx.scene.shape.FillRule fillRule)
    • buildFromPathElements

      public static <T extends PathBuilder<?>> @NonNull T buildFromPathElements(@NonNull T p, @NonNull Iterable<javafx.scene.shape.PathElement> pathElements)
    • awtShapeFromFXRectangle

      public static @NonNull Shape awtShapeFromFXRectangle(@NonNull javafx.scene.shape.Rectangle node)
    • awtTransformFromFX

      public static @Nullable AffineTransform awtTransformFromFX(@Nullable javafx.scene.transform.Transform fxT)
      Converts a Java Path iterator to a JavaFX shape.
      Parameters:
      fxT - A JavaFX Transform.
      Returns:
      An AWT Transform.
    • fxPathElementsFromAwt

      public static @NonNull List<javafx.scene.shape.PathElement> fxPathElementsFromAwt(@NonNull PathIterator iter)
      Converts a Java Path iterator to a JavaFX shape.
      Parameters:
      iter - AWT Path Iterator
      Returns:
      JavaFX Shape
    • fxShapeFromAwt

      public static @NonNull javafx.scene.shape.Path fxShapeFromAwt(@NonNull Shape shape, javafx.scene.transform.Transform fxT)
      Converts a Java AWT Shape iterator to a JavaFX Shape.
      Parameters:
      shape - AWT Shape
      fxT - Optional transformation which is applied to the shape
      Returns:
      JavaFX Shape
    • fxShapeFromAwt

      public static @NonNull javafx.scene.shape.Path fxShapeFromAwt(@NonNull Shape shape, AffineTransform at)
      Converts a Java AWT Shape iterator to a JavaFX Shape.
      Parameters:
      shape - AWT Shape
      at - Optional transformation which is applied to the shape
      Returns:
      JavaFX Shape
    • fxShapeFromAwt

      public static @NonNull javafx.scene.shape.Path fxShapeFromAwt(@NonNull Shape shape)
      Converts a Java AWT Shape iterator to a JavaFX Shape.
      Parameters:
      shape - AWT Shape
      Returns:
      JavaFX Shape
    • fxShapeFromAwt

      public static @NonNull javafx.scene.shape.Path fxShapeFromAwt(@NonNull PathIterator iter)
      Converts a Java Path iterator to a JavaFX shape.
      Parameters:
      iter - AWT Path Iterator
      Returns:
      JavaFX Shape