Package org.eclipse.gef.fx.utils

## Class Geometry2Shape

- java.lang.Object
- - org.eclipse.gef.fx.utils.Geometry2Shape

    public class Geometry2Shape
    extends java.lang.Object

The utility class `Geometry2Shape` provides methods for the conversion of `IGeometry` implementations to JavaFX `Shape` implementations.

### Constructor Summary

Constructors
`Geometry2Shape()`

### Method Summary

All Methods Static Methods Concrete Methods
`static javafx.scene.shape.Arc` `toArc​(Arc arc)` Returns a `Arc` that visualizes the given `Arc`.
`static javafx.scene.shape.CubicCurve` `toCubicCurve​(CubicCurve cubic)` Returns a `CubicCurve` that visualizes the given `CubicCurve`.
`static javafx.scene.shape.Ellipse` `toEllipse​(Ellipse ellipse)` Returns a `Ellipse` that visualizes the given `Ellipse`.
`static javafx.scene.shape.Line` `toLine​(Line line)` Returns a `Line` that visualizes the given `Line`.
`static javafx.scene.shape.Path` `toPath​(Path path)` Converts the given `Path` to a JavaFX `Path`.
`static javafx.scene.shape.PathElement[]` `toPathElements​(Path path)` Converts the given `Path` to an array of JavaFX `PathElement` s.
`static javafx.scene.shape.Polygon` `toPolygon​(Polygon polygon)` Returns a `Polygon` that visualizes the given `Polygon`.
`static javafx.scene.shape.Polyline` `toPolyline​(Polyline polyline)` Returns a `Polyline` that visualizes the given `Polyline`.
`static javafx.scene.shape.QuadCurve` `toQuadCurve​(QuadraticCurve quadCurve)` Returns a `QuadCurve` that visualizes the given `QuadraticCurve`.
`static javafx.scene.shape.Rectangle` `toRectangle​(Rectangle rect)` Returns a `Rectangle` that visualizes the given `Rectangle`.
`static javafx.scene.shape.Rectangle` `toRectangle​(RoundedRectangle roundedRect)` Returns a `Rectangle` that visualizes the given `RoundedRectangle`.
`static javafx.scene.shape.Shape` `toShape​(IGeometry geometry)` Creates a `Shape` that visualizes the passed-in `IGeometry` .

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Geometry2Shape

    public Geometry2Shape()

### Method Detail

#### toArc

    public static javafx.scene.shape.Arc toArc​(Arc arc)

Returns a `Arc` that visualizes the given `Arc`.

Parameters:
  `arc` - The `Arc` from which a `Arc` is constructed.
Returns:
  A newly created `Arc` that visualizes the given `Arc`.

#### toCubicCurve

    public static javafx.scene.shape.CubicCurve toCubicCurve​(CubicCurve cubic)

Returns a `CubicCurve` that visualizes the given `CubicCurve`.

Parameters:
  `cubic` - The `CubicCurve` from which a `CubicCurve` is constructed.
Returns:
  A newly created `CubicCurve` that visualizes the given `CubicCurve`.

#### toEllipse

    public static javafx.scene.shape.Ellipse toEllipse​(Ellipse ellipse)

Returns a `Ellipse` that visualizes the given `Ellipse`.

Parameters:
  `ellipse` - The `Ellipse` from which a `Ellipse` is constructed.
Returns:
  A newly created `Ellipse` that visualizes the given `Ellipse`.

#### toLine

    public static javafx.scene.shape.Line toLine​(Line line)

Returns a `Line` that visualizes the given `Line`.

Parameters:
  `line` - The `Line` from which a `Line` is constructed.
Returns:
  A newly created `Line` that visualizes the given `Line`.

#### toPath

    public static javafx.scene.shape.Path toPath​(Path path)

Converts the given `Path` to a JavaFX `Path`.

Parameters:
  `path` - The `Path` to convert.
Returns:
  The new JavaFX `Path`.

#### toPathElements

    public static javafx.scene.shape.PathElement[] toPathElements​(Path path)

Converts the given `Path` to an array of JavaFX `PathElement` s.

Parameters:
  `path` - The `Path` to convert.
Returns:
  The new array of `PathElement`s.

#### toPolygon

    public static javafx.scene.shape.Polygon toPolygon​(Polygon polygon)

Returns a `Polygon` that visualizes the given `Polygon`.

Parameters:
  `polygon` - The `Polygon` from which a `Polygon` is constructed.
Returns:
  A newly created `Polygon` that visualizes the given `Polygon`.

#### toPolyline

    public static javafx.scene.shape.Polyline toPolyline​(Polyline polyline)

Returns a `Polyline` that visualizes the given `Polyline`.

Parameters:
  `polyline` - The `Polyline` from which a `Polyline` is constructed.
Returns:
  A newly created `Polyline` that visualizes the given `Polyline`.

#### toQuadCurve

    public static javafx.scene.shape.QuadCurve toQuadCurve​(QuadraticCurve quadCurve)

Returns a `QuadCurve` that visualizes the given `QuadraticCurve`.

Parameters:
  `quadCurve` - The `QuadraticCurve` from which a `QuadCurve` is constructed.
Returns:
  A newly created `QuadCurve` that visualizes the given `QuadraticCurve`.

#### toRectangle

    public static javafx.scene.shape.Rectangle toRectangle​(Rectangle rect)

Returns a `Rectangle` that visualizes the given `Rectangle`.

Parameters:
  `rect` - The `Rectangle` from which a `Rectangle` is constructed.
Returns:
  A newly created `Rectangle` that visualizes the given `Rectangle`.

#### toRectangle

    public static javafx.scene.shape.Rectangle toRectangle​(RoundedRectangle roundedRect)

Returns a `Rectangle` that visualizes the given `RoundedRectangle`.

Parameters:
  `roundedRect` - The `RoundedRectangle` from which a `Rectangle` is constructed.
Returns:
  A newly created `Rectangle` that visualizes the given `RoundedRectangle`.

#### toShape

    public static javafx.scene.shape.Shape toShape​(IGeometry geometry)

Creates a `Shape` that visualizes the passed-in `IGeometry` .

Parameters:
  `geometry` - The `IGeometry` for which a `Shape` is created.
Returns:
  A newly created `Shape` that visualizes the given `IGeometry`.