Class PointListHelper
java.lang.Object
org.csstudio.opibuilder.widgets.feedback.PointListHelper
A transformator utility for
PointList objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.draw2d.geometry.PointListscaleTo(org.eclipse.draw2d.geometry.PointList points, org.eclipse.draw2d.geometry.Rectangle targetBounds) Scales the point list to the new bounds.static org.eclipse.draw2d.geometry.PointListscaleToLocation(org.eclipse.draw2d.geometry.PointList points, int x, int y) Moves the origin (0,0) of the coordinate system of all the points in the specified point list to the Point (x,y).static org.eclipse.draw2d.geometry.PointListscaleToSize(org.eclipse.draw2d.geometry.PointList points, int width, int height) Transforms the points in the specified point list to fit the given size.
-
Method Details
-
scaleToSize
public static org.eclipse.draw2d.geometry.PointList scaleToSize(org.eclipse.draw2d.geometry.PointList points, int width, int height) Transforms the points in the specified point list to fit the given size. All point coordinates are transformed relatively to the new size.- Parameters:
points- the point listwidth- the new widthheight- the new height- Returns:
- a point list copy, which has been scaled to the new size
-
scaleToLocation
public static org.eclipse.draw2d.geometry.PointList scaleToLocation(org.eclipse.draw2d.geometry.PointList points, int x, int y) Moves the origin (0,0) of the coordinate system of all the points in the specified point list to the Point (x,y).- Parameters:
points- the point listx- the x coordinatey- the y coordinate- Returns:
- a point list copy, which has been scaled to the new location
-
scaleTo
public static org.eclipse.draw2d.geometry.PointList scaleTo(org.eclipse.draw2d.geometry.PointList points, org.eclipse.draw2d.geometry.Rectangle targetBounds) Scales the point list to the new bounds.- Parameters:
points- the point listtargetBounds- the target bounds- Returns:
- a point list copy, which has been scaled to the new bounds
-