Class SWT2Geometry
java.lang.Object
org.eclipse.gef.geometry.convert.swt.SWT2Geometry
Utility class to support conversions between SWT's geometry classes and
GEF's geometry API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Object
toLine
(int... swtPointArray) Converts the given integer array to a GEFLine
.static Path
static Point
static Polygon
toPolygon
(int... swtPointArray) Converts the given integer array to a GEFPolygon
.static Object
toPolyline
(int... swtPointArray) Converts the given integer array to a GEFPolyline
.static Rectangle
toRectangle
(Rectangle swtRectangle) Converts the givenSWT Rectangle
to a GEFRectangle
.
-
Method Details
-
toLine
Converts the given integer array to a GEFLine
. The integer array has to consist of exactly 4 values which are interpreted as the x and y coordinates of theLine
's startPoint
and the x and y coordinates of theLine
's end point , respectively.- Parameters:
swtPointArray
- an integer array which contains the x0, y0, x1, y1 coordinates- Returns:
- a new
Line
at the specified position
-
toPath
-
toPoint
-
toPolygon
-
toPolyline
-
toRectangle
Converts the givenSWT Rectangle
to a GEFRectangle
.- Parameters:
swtRectangle
- theSWT Rectangle
to convert- Returns:
- a new
Rectangle
at the position of the givenSWT Rectangle
-