Class SWT2Geometry


  • public class SWT2Geometry
    extends java.lang.Object
    Utility class to support conversions between SWT's geometry classes and GEF's geometry API.
    • Method Detail

      • toLine

        public static java.lang.Object toLine​(int... swtPointArray)
        Converts the given integer array to a GEF Line. The integer array has to consist of exactly 4 values which are interpreted as the x and y coordinates of the Line's start Point and the x and y coordinates of the Line'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
      • toPolygon

        public static Polygon toPolygon​(int... swtPointArray)
        Converts the given integer array to a GEF Polygon. The integer array is interpreted to consist of alternating x and y coordinates specifying the Points used to construct the new GEF Polygon.
        Parameters:
        swtPointArray - the integer array that specifies the Points used to construct the new GEF Polygon
        Returns:
        a new Polygon from the given coordinates
      • toPolyline

        public static java.lang.Object toPolyline​(int... swtPointArray)
        Converts the given integer array to a GEF Polyline. The integer array is interpreted to consist of alternating x and y coordinates specifying the Points used to construct the new GEF Polyline.
        Parameters:
        swtPointArray - the integer array that specifies the Points used to construct the new GEF Polyline
        Returns:
        a new Polyline from the given coordinates