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

    • 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

      public static Shape fxShapeToAwtShape(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
    • fxBoundsToAwtShape

      public static Shape fxBoundsToAwtShape(javafx.geometry.Bounds node)
    • fxPathELementsToAwtShape

      public static Shape fxPathELementsToAwtShape(Iterable<javafx.scene.shape.PathElement> pathElements, javafx.scene.shape.FillRule fillRule)
    • buildPathElements

      public static <T extends PathBuilder<?>> T buildPathElements(T p, Iterable<javafx.scene.shape.PathElement> pathElements)
    • fxRectangleToAwtShape

      public static Shape fxRectangleToAwtShape(javafx.scene.shape.Rectangle node)
    • 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 Shape
      fxT - Optional transformation which is applied to the shape
      Returns:
      JavaFX Shape
    • awtShapeToFXShape

      public static javafx.scene.shape.Path awtShapeToFXShape(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
    • awtShapeToFXShape

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

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