Package org.eclipse.draw2d.geometry

# 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:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`double`
`preciseX`
Deprecated.
Use `setPreciseX(double)` and `preciseX()` instead.
`double`
`preciseY`
Deprecated.
Use `setPreciseY(double)` and `preciseY()` instead.

### Fields inherited from class org.eclipse.draw2d.geometry.Point

`SINGLETON, x, y`

## Constructor Summary

Constructors
Constructor
Description
`PrecisionPoint()`
Constructor for PrecisionPoint.
`PrecisionPoint(double x, double y)`
Constructor for PrecisionPoint.
`PrecisionPoint(int x, int y)`
Constructor for PrecisionPoint.
`PrecisionPoint(Point p)`
Constructor for PrecisionPoint.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
Test for equality.
`Point`
`getCopy()`
`Dimension`
`getDifference(Point p)`
Calculates the difference in between this Point and the one specified.
`PrecisionPoint`
`getPreciseCopy()`
Returns a precise copy of this.
`void`
`performScale(double factor)`
Scales this object by the scale factor.
`void`
`performTranslate(int dx, int dy)`
Translates this object horizontally by `dx` and vertically by `dy`.
`double`
`preciseX()`
Returns `double` x coordinate
`double`
`preciseY()`
Returns `double` y coordinate
`Point`
`scale(double xFactor, double yFactor)`
Scales this Point by the specified values.
`Point`
`setLocation(int x, int y)`
Sets the location of this Point to the provided x and y locations.
`Point`
`setLocation(Point pt)`
Sets the location of this Point to the specified Point.
`PrecisionPoint`
`setPreciseLocation(double x, double y)`
Sets the precise location of this PrecisionPoint to the given x and y values.
`PrecisionPoint`
`setPreciseLocation(PrecisionPoint p)`
Sets the precise location of this PrecisionPoint to the x and y values of the given one.
`PrecisionPoint`
`setPreciseX(double x)`
Sets the precise x value of this PrecisionPoint to the given value.
`PrecisionPoint`
`setPreciseY(double y)`
Sets the precise y value of this PrecisionPoint to the given value.
`Point`
`setX(int x)`
Sets the x value of this Point to the given value.
`Point`
`setY(int y)`
Sets the y value of this Point to the given value;
`Point`
`translate(double dx, double dy)`
Shifts this Point by the values supplied along each axes, and returns this for convenience.
`Point`
`translate(int dx, int dy)`
Shifts this Point by the values supplied along each axes, and returns this for convenience.
`Point`
`translate(Dimension d)`
Shifts this Point by the values of the Dimension along each axis, and returns this for convenience.
`Point`
`translate(Point p)`
Shifts the location of this Point by the location of the input Point along each of the axes, and returns this for convenience.
`Point`
`transpose()`
Transposes this object.
`final void`
`updateInts()`
Deprecated.
This method should not be accessed by clients any more (it will be made private in future releases).

### Methods inherited from class org.eclipse.draw2d.geometry.Point

`equals, getDistance, getDistance2, getDistanceOrthogonal, getNegated, getPosition, getScaled, getScaled, getSWTPoint, getTranslated, getTranslated, getTranslated, getTranslated, getTransposed, hashCode, max, min, negate, scale, toString, x, y`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.draw2d.geometry.Translatable

`performTranslate, performTranslate, performTranslate`

## 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:
  - `Point.equals(java.lang.Object)`

### getCopy

public Point getCopy()

Overrides:
  `getCopy` in class `Point`
Returns:
  a copy of this Point
See Also:
  - `Point.getCopy()`

### 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:
  - `Point.getDifference(org.eclipse.draw2d.geometry.Point)`

### 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:
  - `Point.performScale(double)`

### 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:
  - `Point.performTranslate(int, int)`

### preciseX

public double preciseX()
Description copied from class: `Point`
Returns `double` x coordinate

Overrides:
  `preciseX` in class `Point`
Returns:
  `double` x coordinate
See Also:
  - `Point.preciseX()`

### preciseY

public double preciseY()
Description copied from class: `Point`
Returns `double` y coordinate

Overrides:
  `preciseY` in class `Point`
Returns:
  `double` y coordinate
See Also:
  - `Point.preciseY()`

### 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:
  - `Point.scale(double, double)`

### 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:
  - `Point.setLocation(int, int)`

### 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:
  - `Point.setLocation(Point)`

### 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:
  - `Point.setX(int)`

### 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:
  - `Point.setY(int)`

### 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:
  - `Point.translate(org.eclipse.draw2d.geometry.Dimension)`

### 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:
  - `Point.translate(int, int)`

### 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:
  - `Point.translate(double, double)`

### 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:
  - `Point.translate(org.eclipse.draw2d.geometry.Point)`

### 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:
  - `Point.transpose()`

### 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.