Class PointListHelper

java.lang.Object
org.csstudio.opibuilder.widgets.feedback.PointListHelper

public final class PointListHelper extends Object
A transformator utility for PointList objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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).
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 list
      width - the new width
      height - 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 list
      x - the x coordinate
      y - 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 list
      targetBounds - the target bounds
      Returns:
      a point list copy, which has been scaled to the new bounds