Package org.eclipse.gef.fx.utils

# Class Geometry2Shape

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

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

## Constructor Summary

Constructors
Constructor
Description
`Geometry2Shape()`

## Method Summary

Modifier and Type
Method
Description
`static Arc`
`toArc(Arc arc)`
Returns a `Arc` that visualizes the given `Arc`.
`static CubicCurve`
`toCubicCurve(CubicCurve cubic)`
Returns a `CubicCurve` that visualizes the given `CubicCurve`.
`static Ellipse`
`toEllipse(Ellipse ellipse)`
Returns a `Ellipse` that visualizes the given `Ellipse`.
`static Line`
`toLine(Line line)`
Returns a `Line` that visualizes the given `Line`.
`static Path`
`toPath(Path path)`
Converts the given `Path` to a JavaFX `Path`.
`static PathElement[]`
`toPathElements(Path path)`
Converts the given `Path` to an array of JavaFX `PathElement` s.
`static Polygon`
`toPolygon(Polygon polygon)`
Returns a `Polygon` that visualizes the given `Polygon`.
`static Polyline`
`toPolyline(Polyline polyline)`
Returns a `Polyline` that visualizes the given `Polyline`.
`static QuadCurve`
`toQuadCurve(QuadraticCurve quadCurve)`
Returns a `QuadCurve` that visualizes the given `QuadraticCurve`.
`static Rectangle`
`toRectangle(Rectangle rect)`
Returns a `Rectangle` that visualizes the given `Rectangle`.
`static Rectangle`
`toRectangle(RoundedRectangle roundedRect)`
Returns a `Rectangle` that visualizes the given `RoundedRectangle`.
`static 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 Details

### Geometry2Shape

public Geometry2Shape()

## Method Details

### toArc

public static 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 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 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 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 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 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 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 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 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 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 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 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`.