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 classGeometry2Shape
provides methods for the conversion ofIGeometry
implementations to JavaFXShape
implementations.
-
-
Constructor Summary
Constructors Constructor Description Geometry2Shape()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javafx.scene.shape.Arc
toArc(Arc arc)
Returns aArc
that visualizes the givenArc
.static javafx.scene.shape.CubicCurve
toCubicCurve(CubicCurve cubic)
Returns aCubicCurve
that visualizes the givenCubicCurve
.static javafx.scene.shape.Ellipse
toEllipse(Ellipse ellipse)
Returns aEllipse
that visualizes the givenEllipse
.static javafx.scene.shape.Line
toLine(Line line)
Returns aLine
that visualizes the givenLine
.static javafx.scene.shape.Path
toPath(Path path)
Converts the givenPath
to a JavaFXPath
.static javafx.scene.shape.PathElement[]
toPathElements(Path path)
Converts the givenPath
to an array of JavaFXPathElement
s.static javafx.scene.shape.Polygon
toPolygon(Polygon polygon)
Returns aPolygon
that visualizes the givenPolygon
.static javafx.scene.shape.Polyline
toPolyline(Polyline polyline)
Returns aPolyline
that visualizes the givenPolyline
.static javafx.scene.shape.QuadCurve
toQuadCurve(QuadraticCurve quadCurve)
Returns aQuadCurve
that visualizes the givenQuadraticCurve
.static javafx.scene.shape.Rectangle
toRectangle(Rectangle rect)
Returns aRectangle
that visualizes the givenRectangle
.static javafx.scene.shape.Rectangle
toRectangle(RoundedRectangle roundedRect)
Returns aRectangle
that visualizes the givenRoundedRectangle
.static javafx.scene.shape.Shape
toShape(IGeometry geometry)
Creates aShape
that visualizes the passed-inIGeometry
.
-
-
-
Method Detail
-
toArc
public static javafx.scene.shape.Arc toArc(Arc arc)
Returns aArc
that visualizes the givenArc
.
-
toCubicCurve
public static javafx.scene.shape.CubicCurve toCubicCurve(CubicCurve cubic)
Returns aCubicCurve
that visualizes the givenCubicCurve
.- Parameters:
cubic
- TheCubicCurve
from which aCubicCurve
is constructed.- Returns:
- A newly created
CubicCurve
that visualizes the givenCubicCurve
.
-
toEllipse
public static javafx.scene.shape.Ellipse toEllipse(Ellipse ellipse)
Returns aEllipse
that visualizes the givenEllipse
.
-
toLine
public static javafx.scene.shape.Line toLine(Line line)
Returns aLine
that visualizes the givenLine
.
-
toPath
public static javafx.scene.shape.Path toPath(Path path)
Converts the givenPath
to a JavaFXPath
.- Parameters:
path
- ThePath
to convert.- Returns:
- The new JavaFX
Path
.
-
toPathElements
public static javafx.scene.shape.PathElement[] toPathElements(Path path)
Converts the givenPath
to an array of JavaFXPathElement
s.- Parameters:
path
- ThePath
to convert.- Returns:
- The new array of
PathElement
s.
-
toPolygon
public static javafx.scene.shape.Polygon toPolygon(Polygon polygon)
Returns aPolygon
that visualizes the givenPolygon
.
-
toPolyline
public static javafx.scene.shape.Polyline toPolyline(Polyline polyline)
Returns aPolyline
that visualizes the givenPolyline
.
-
toQuadCurve
public static javafx.scene.shape.QuadCurve toQuadCurve(QuadraticCurve quadCurve)
Returns aQuadCurve
that visualizes the givenQuadraticCurve
.- Parameters:
quadCurve
- TheQuadraticCurve
from which aQuadCurve
is constructed.- Returns:
- A newly created
QuadCurve
that visualizes the givenQuadraticCurve
.
-
toRectangle
public static javafx.scene.shape.Rectangle toRectangle(Rectangle rect)
Returns aRectangle
that visualizes the givenRectangle
.
-
toRectangle
public static javafx.scene.shape.Rectangle toRectangle(RoundedRectangle roundedRect)
Returns aRectangle
that visualizes the givenRoundedRectangle
.- Parameters:
roundedRect
- TheRoundedRectangle
from which aRectangle
is constructed.- Returns:
- A newly created
Rectangle
that visualizes the givenRoundedRectangle
.
-
-