Class SWT2Geometry
- java.lang.Object
-
- org.eclipse.gef.geometry.convert.swt.SWT2Geometry
-
public class SWT2Geometry extends java.lang.Object
Utility 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.Object
toLine(int... swtPointArray)
Converts the given integer array to a GEFLine
.static Path
toPath(int windingRule, PathData pd)
static Point
toPoint(Point swtPoint)
static Polygon
toPolygon(int... swtPointArray)
Converts the given integer array to a GEFPolygon
.static java.lang.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 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 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
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 Rectangle
to a GEFRectangle
.- Parameters:
swtRectangle
- theSWT Rectangle
to convert- Returns:
- a new
Rectangle
at the position of the givenSWT Rectangle
-
-