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
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleDeprecated, for removal: This API element is subject to removal in a future version.doubleDeprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseY(double)andpreciseY()instead. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for PrecisionPoint.PrecisionPoint(double x, double y) Constructor for PrecisionPoint.PrecisionPoint(int x, int y) Constructor for PrecisionPoint.Constructor for PrecisionPoint. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest for equality.getCopy()Calculates the difference in between this Point and the one specified.intprovide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceOrthogonal(org.eclipse.draw2d.geometry.Point)intprovide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceSquared(org.eclipse.draw2d.geometry.Point)Returns a precise copy of this.voidperformScale(double factor) Scales this object by the scale factor.voidperformTranslate(int dx, int dy) Translates this object horizontally bydxand vertically bydy.doublepreciseX()Returnsdoublex coordinatedoublepreciseY()Returnsdoubley coordinatescale(double xFactor, double yFactor) Scales this Point by the specified values.setLocation(int x, int y) Sets the location of this Point to the provided x and y locations.setLocation(Point pt) Sets the location of this Point to the specified Point.setPreciseLocation(double x, double y) Sets the precise location of this PrecisionPoint to the given x and y values.Sets the precise location of this PrecisionPoint to the x and y values of the given one.setPreciseX(double x) Sets the precise x value of this PrecisionPoint to the given value.setPreciseY(double y) Sets the precise y value of this PrecisionPoint to the given value.setX(int x) Sets the x value of this Point to the given value.setY(int y) Sets the y value of this Point to the given value;translate(double dx, double dy) Shifts this Point by the values supplied along each axes, and returns this for convenience.translate(int dx, int dy) Shifts this Point by the values supplied along each axes, and returns this for convenience.Shifts this Point by the values of the Dimension along each axis, and returns this for convenience.Shifts the location of this Point by the location of the input Point along each of the axes, and returns this for convenience.Transposes this object.final voidDeprecated, for removal: This API element is subject to removal in a future version.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, getNegated, getPosition, getScaled, getScaled, getSWTPoint, getTranslated, getTranslated, getTranslated, getTranslated, getTransposed, hashCode, max, min, negate, scale, toString, x, yMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.geometry.Translatable
performTranslate, performTranslate, performTranslate
-
Field Details
-
preciseX
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseX(double)andpreciseX()instead. This field will become private in future versions.Double value for X- @noreference
- This field is not intended to be referenced by clients.
-
preciseY
Deprecated, for removal: This API element is subject to removal in a future version.UsesetPreciseY(double)andpreciseY()instead. This field will become private in future versions.Double value for Y- @noreference
- This field is not intended to be referenced by clients.
-
-
Constructor Details
-
PrecisionPoint
public PrecisionPoint()Constructor for PrecisionPoint. -
PrecisionPoint
public PrecisionPoint(double x, double y) Constructor for PrecisionPoint.- Parameters:
x- X valuey- Y value
-
PrecisionPoint
public PrecisionPoint(int x, int y) Constructor for PrecisionPoint.- Parameters:
x- X valuey- Y value
-
PrecisionPoint
Constructor for PrecisionPoint.- Parameters:
p- Point from which the initial values are taken
-
-
Method Details
-
equals
Description copied from class:PointTest for equality. -
getCopy
-
getDifference
Description copied from class:PointCalculates the difference in between this Point and the one specified.- Overrides:
getDifferencein classPoint- Parameters:
p- The Point being subtracted from this Point- Returns:
- A new Dimension representing the difference
- See Also:
-
getDistanceOrthogonal
provide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceOrthogonal(org.eclipse.draw2d.geometry.Point)- Overrides:
getDistanceOrthogonalin classPoint- Parameters:
p- The reference Point- Returns:
- the orthogonal distance
- Since:
- 3.19
-
getDistanceSquared
provide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceSquared(org.eclipse.draw2d.geometry.Point)- Overrides:
getDistanceSquaredin classPoint- Parameters:
p- The reference Point- Returns:
- distance2
- Since:
- 3.19
-
getPreciseCopy
Returns a precise copy of this.- Returns:
- a precise copy
- Since:
- 3.7
-
performScale
public void performScale(double factor) Description copied from interface:TranslatableScales this object by the scale factor.- Specified by:
performScalein interfaceTranslatable- Overrides:
performScalein classPoint- Parameters:
factor- The scale factor- See Also:
-
performTranslate
public void performTranslate(int dx, int dy) Description copied from interface:TranslatableTranslates this object horizontally bydxand vertically bydy.- Specified by:
performTranslatein interfaceTranslatable- Overrides:
performTranslatein classPoint- Parameters:
dx- The amount to translate horizontallydy- The amount to translate vertically- See Also:
-
preciseX
public double preciseX()Description copied from class:PointReturnsdoublex coordinate -
preciseY
public double preciseY()Description copied from class:PointReturnsdoubley coordinate -
scale
Description copied from class:PointScales this Point by the specified values. -
setLocation
Description copied from class:PointSets the location of this Point to the provided x and y locations.- Overrides:
setLocationin classPoint- Parameters:
x- the x locationy- the y location- Returns:
thisfor convenience- See Also:
-
setLocation
Description copied from class:PointSets the location of this Point to the specified Point.- Overrides:
setLocationin classPoint- Parameters:
pt- the Location- Returns:
thisfor convenience- See Also:
-
setPreciseLocation
Sets the precise location of this PrecisionPoint to the given x and y values.- Parameters:
x- The new x valuey- The new y value- Returns:
- this for convenience
- Since:
- 3.7
-
setPreciseLocation
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
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
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
Description copied from class:PointSets the x value of this Point to the given value. -
setY
Description copied from class:PointSets the y value of this Point to the given value; -
translate
Description copied from class:PointShifts this Point by the values of the Dimension along each axis, and returns this for convenience. -
translate
Description copied from class:PointShifts this Point by the values supplied along each axes, and returns this for convenience. -
translate
Description copied from class:PointShifts this Point by the values supplied along each axes, and returns this for convenience. -
translate
Description copied from class:PointShifts the location of this Point by the location of the input Point along each of the axes, and returns this for convenience. -
transpose
Description copied from class:PointTransposes this object. X and Y values are exchanged. -
updateInts
Deprecated, for removal: This API element is subject to removal in a future version.Updates the integer fields using the precise versions.- @noreference
- This method is not intended to be referenced by clients.
-
setPreciseX(double)andpreciseX()instead.