Class PrecisionPoint

java.lang.Object
org.eclipse.draw2d.geometry.Point
org.eclipse.draw2d.geometry.PrecisionPoint
All Implemented Interfaces:
Serializable, Cloneable, Translatable

public class PrecisionPoint extends Point
See Also:
  • Field Details

    • preciseX

      public double preciseX
      Deprecated.
      Use setPreciseX(double) and preciseX() instead. This field will become private in future versions.
      Double value for X
    • preciseY

      public double preciseY
      Deprecated.
      Use setPreciseY(double) and preciseY() instead. This field will become private in future versions.
      Double value for Y
  • Constructor Details

    • PrecisionPoint

      public PrecisionPoint()
      Constructor for PrecisionPoint.
    • PrecisionPoint

      public PrecisionPoint(double x, double y)
      Constructor for PrecisionPoint.
      Parameters:
      x - X value
      y - Y value
    • PrecisionPoint

      public PrecisionPoint(int x, int y)
      Constructor for PrecisionPoint.
      Parameters:
      x - X value
      y - Y value
    • PrecisionPoint

      public PrecisionPoint(Point p)
      Constructor for PrecisionPoint.
      Parameters:
      p - Point from which the initial values are taken
  • Method Details

    • equals

      public boolean equals(Object o)
      Description copied from class: Point
      Test for equality.
      Overrides:
      equals in class Point
      Parameters:
      o - Object being tested for equality
      Returns:
      true if both x and y values are equal
      See Also:
    • getCopy

      public Point getCopy()
      Overrides:
      getCopy in class Point
      Returns:
      a copy of this Point
      See Also:
    • getDifference

      public Dimension getDifference(Point p)
      Description copied from class: Point
      Calculates the difference in between this Point and the one specified.
      Overrides:
      getDifference in class Point
      Parameters:
      p - The Point being subtracted from this Point
      Returns:
      A new Dimension representing the difference
      See Also:
    • getPreciseCopy

      public PrecisionPoint getPreciseCopy()
      Returns a precise copy of this.
      Returns:
      a precise copy
      Since:
      3.7
    • performScale

      public void performScale(double factor)
      Description copied from interface: Translatable
      Scales this object by the scale factor.
      Specified by:
      performScale in interface Translatable
      Overrides:
      performScale in class Point
      Parameters:
      factor - The scale factor
      See Also:
    • performTranslate

      public void performTranslate(int dx, int dy)
      Description copied from interface: Translatable
      Translates this object horizontally by dx and vertically by dy.
      Specified by:
      performTranslate in interface Translatable
      Overrides:
      performTranslate in class Point
      Parameters:
      dx - The amount to translate horizontally
      dy - The amount to translate vertically
      See Also:
    • preciseX

      public double preciseX()
      Description copied from class: Point
      Returns double x coordinate
      Overrides:
      preciseX in class Point
      Returns:
      double x coordinate
      See Also:
    • preciseY

      public double preciseY()
      Description copied from class: Point
      Returns double y coordinate
      Overrides:
      preciseY in class Point
      Returns:
      double y coordinate
      See Also:
    • scale

      public Point scale(double xFactor, double yFactor)
      Description copied from class: Point
      Scales this Point by the specified values.
      Overrides:
      scale in class Point
      Parameters:
      xFactor - horizontal scale factor
      yFactor - vertical scale factor
      Returns:
      this for convenience
      See Also:
    • setLocation

      public Point setLocation(int x, int y)
      Description copied from class: Point
      Sets the location of this Point to the provided x and y locations.
      Overrides:
      setLocation in class Point
      Parameters:
      x - the x location
      y - the y location
      Returns:
      this for convenience
      See Also:
    • setLocation

      public Point setLocation(Point pt)
      Description copied from class: Point
      Sets the location of this Point to the specified Point.
      Overrides:
      setLocation in class Point
      Parameters:
      pt - the Location
      Returns:
      this for convenience
      See Also:
    • setPreciseLocation

      public PrecisionPoint setPreciseLocation(double x, double y)
      Sets the precise location of this PrecisionPoint to the given x and y values.
      Parameters:
      x - The new x value
      y - The new y value
      Returns:
      this for convenience
      Since:
      3.7
    • setPreciseLocation

      public PrecisionPoint setPreciseLocation(PrecisionPoint p)
      Sets the precise location of this PrecisionPoint to the x and y values of the given one.
      Parameters:
      p - The PrecisionPoint specifying the new x and y values.
      Returns:
      this for convenience
      Since:
      3.7
    • setPreciseX

      public PrecisionPoint setPreciseX(double x)
      Sets the precise x value of this PrecisionPoint to the given value.
      Parameters:
      x - The new x value
      Returns:
      this for convenience
      Since:
      3.7
    • setPreciseY

      public PrecisionPoint setPreciseY(double y)
      Sets the precise y value of this PrecisionPoint to the given value.
      Parameters:
      y - The new y value
      Returns:
      this for convenience
      Since:
      3.7
    • setX

      public Point setX(int x)
      Description copied from class: Point
      Sets the x value of this Point to the given value.
      Overrides:
      setX in class Point
      Parameters:
      x - The new x value
      Returns:
      this for convenience
      See Also:
    • setY

      public Point setY(int y)
      Description copied from class: Point
      Sets the y value of this Point to the given value;
      Overrides:
      setY in class Point
      Parameters:
      y - The new y value
      Returns:
      this for convenience
      See Also:
    • translate

      public Point translate(Dimension d)
      Description copied from class: Point
      Shifts this Point by the values of the Dimension along each axis, and returns this for convenience.
      Overrides:
      translate in class Point
      Parameters:
      d - Dimension by which the origin is being shifted.
      Returns:
      this for convenience
      See Also:
    • translate

      public Point translate(int dx, int dy)
      Description copied from class: Point
      Shifts this Point by the values supplied along each axes, and returns this for convenience.
      Overrides:
      translate in class Point
      Parameters:
      dx - Amount by which point is shifted along X axis.
      dy - Amount by which point is shifted along Y axis.
      Returns:
      this for convenience
      See Also:
    • translate

      public Point translate(double dx, double dy)
      Description copied from class: Point
      Shifts this Point by the values supplied along each axes, and returns this for convenience.
      Overrides:
      translate in class Point
      Parameters:
      dx - Amount by which point is shifted along X axis.
      dy - Amount by which point is shifted along Y axis.
      Returns:
      this for convenience
      See Also:
    • translate

      public Point translate(Point p)
      Description copied from class: Point
      Shifts the location of this Point by the location of the input Point along each of the axes, and returns this for convenience.
      Overrides:
      translate in class Point
      Parameters:
      p - Point to which the origin is being shifted.
      Returns:
      this for convenience
      See Also:
    • transpose

      public Point transpose()
      Description copied from class: Point
      Transposes this object. X and Y values are exchanged.
      Overrides:
      transpose in class Point
      Returns:
      this for convenience
      See Also:
    • updateInts

      public final void updateInts()
      Deprecated.
      This method should not be accessed by clients any more (it will be made private in future releases). The update of integer and precision fields is performed automatically if preciseX and preciseY field values are not manipulated directly, but only via respective methods offered by this class.
      Updates the integer fields using the precise versions.