Class PointListUtils
java.lang.Object
org.eclipse.gef.geometry.internal.utils.PointListUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]toCoordinatesArray(Point[] points) static int[]toIntegerArray(double[] doubles) Converts an array of double values into an array of integer values by casting them.static Point[]toPointsArray(double[] coordinates) Converts a given array of x/y coordinate values into an array ofPoints.static Point[]toPointsArray(Line[] segmentsArray, boolean open) static Line[]toSegmentsArray(Point[] points, boolean close)
-
Method Details
-
toCoordinatesArray
-
toIntegerArray
public static int[] toIntegerArray(double[] doubles) Converts an array of double values into an array of integer values by casting them.- Parameters:
doubles- an array of doubles to convert- Returns:
- a new array of integer values, which is created by casting the double values
-
toPointsArray
Converts a given array of x/y coordinate values into an array ofPoints.- Parameters:
coordinates- The array of coordinates.- Returns:
- a new array of
Points, representing the given x and y coordinates
-
toPointsArray
-
toSegmentsArray
Transforms a sequence ofPointcoordinates into a sequence ofLinesegments, by creating aLinesegment for each two adjacent points in the array. In case it is specified to close the segment list, aLinesegment is furthermore created between the last and the first point in the list.- Parameters:
points- the array ofPoints to convertclose- a flag indicating whether a line segment will be created from the last point in the list back to the first one- Returns:
- an array of
Linesegments, which is created by creating aLinefor each two adjacentPoints in the given array, which includes aLinesegment between the last point in the given array in the first one, if and only if the parameter close is given astrue
-