Class SWT2Geometry
- java.lang.Object
-
- org.eclipse.gef.geometry.convert.swt.SWT2Geometry
-
public class SWT2Geometry extends java.lang.ObjectUtility class to support conversions between SWT's geometry classes and GEF's geometry API.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ObjecttoLine(int... swtPointArray)Converts the given integer array to a GEFLine.static PathtoPath(int windingRule, PathData pd)static PointtoPoint(Point swtPoint)static PolygontoPolygon(int... swtPointArray)Converts the given integer array to a GEFPolygon.static java.lang.ObjecttoPolyline(int... swtPointArray)Converts the given integer array to a GEFPolyline.static RectangletoRectangle(Rectangle swtRectangle)Converts the givenSWT Rectangleto a GEFRectangle.
-
-
-
Method Detail
-
toLine
public static java.lang.Object toLine(int... swtPointArray)
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
public static Path toPath(int windingRule, PathData pd)
-
toPolygon
public static Polygon toPolygon(int... swtPointArray)
-
toPolyline
public static java.lang.Object toPolyline(int... swtPointArray)
-
toRectangle
public static Rectangle toRectangle(Rectangle swtRectangle)
Converts the givenSWT Rectangleto a GEFRectangle.- Parameters:
swtRectangle- theSWT Rectangleto convert- Returns:
- a new
Rectangleat the position of the givenSWT Rectangle
-
-