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 ofPoint
s.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 ofPoint
s.- Parameters:
coordinates
- The array of coordinates.- Returns:
- a new array of
Point
s, representing the given x and y coordinates
-
toPointsArray
-
toSegmentsArray
Transforms a sequence ofPoint
coordinates into a sequence ofLine
segments, by creating aLine
segment for each two adjacent points in the array. In case it is specified to close the segment list, aLine
segment is furthermore created between the last and the first point in the list.- Parameters:
points
- the array ofPoint
s 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
Line
segments, which is created by creating aLine
for each two adjacentPoint
s in the given array, which includes aLine
segment between the last point in the given array in the first one, if and only if the parameter close is given astrue
-