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 ObjecttoLine(int... swtPointArray) Converts the given integer array to a GEFLine.static Pathstatic Pointstatic PolygontoPolygon(int... swtPointArray) Converts the given integer array to a GEFPolygon.static ObjecttoPolyline(int... swtPointArray) Converts the given integer array to a GEFPolyline.static RectangletoRectangle(Rectangle swtRectangle) Converts the givenSWT Rectangleto 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 startPointand 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
Lineat the specified position
-
toPath
-
toPoint
-
toPolygon
-
toPolyline
-
toRectangle
Converts the givenSWT Rectangleto a GEFRectangle.- Parameters:
swtRectangle- theSWT Rectangleto convert- Returns:
- a new
Rectangleat the position of the givenSWT Rectangle
-