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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionConstructor for PrecisionPoint.PrecisionPoint(double x, double y) Constructor for PrecisionPoint.PrecisionPoint(int x, int y) Constructor for PrecisionPoint.Constructor for PrecisionPoint.
- 
Method SummaryModifier 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.Pointequals, 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.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.geometry.TranslatableperformTranslate, performTranslate, performTranslate
- 
Field Details- 
preciseXDeprecated, 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.
 
- 
preciseYDeprecated, 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- 
PrecisionPointpublic PrecisionPoint()Constructor for PrecisionPoint.
- 
PrecisionPointpublic PrecisionPoint(double x, double y) Constructor for PrecisionPoint.- Parameters:
- x- X value
- y- Y value
 
- 
PrecisionPointpublic PrecisionPoint(int x, int y) Constructor for PrecisionPoint.- Parameters:
- x- X value
- y- Y value
 
- 
PrecisionPointConstructor for PrecisionPoint.- Parameters:
- p- Point from which the initial values are taken
 
 
- 
- 
Method Details- 
equalsDescription copied from class:PointTest for equality.
- 
getCopy
- 
getDifferenceDescription copied from class:PointCalculates the difference in between this Point and the one specified.- Overrides:
- getDifferencein class- Point
- Parameters:
- p- The Point being subtracted from this Point
- Returns:
- A new Dimension representing the difference
- See Also:
 
- 
getDistanceOrthogonalprovide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceOrthogonal(org.eclipse.draw2d.geometry.Point)- Overrides:
- getDistanceOrthogonalin class- Point
- Parameters:
- p- The reference Point
- Returns:
- the orthogonal distance
- Since:
- 3.19
 
- 
getDistanceSquaredprovide a precision version of org.eclipse.draw2d.geometry.Point#getDistanceSquared(org.eclipse.draw2d.geometry.Point)- Overrides:
- getDistanceSquaredin class- Point
- Parameters:
- p- The reference Point
- Returns:
- distance2
- Since:
- 3.19
 
- 
getPreciseCopyReturns a precise copy of this.- Returns:
- a precise copy
- Since:
- 3.7
 
- 
performScalepublic void performScale(double factor) Description copied from interface:TranslatableScales this object by the scale factor.- Specified by:
- performScalein interface- Translatable
- Overrides:
- performScalein class- Point
- Parameters:
- factor- The scale factor
- See Also:
 
- 
performTranslatepublic void performTranslate(int dx, int dy) Description copied from interface:TranslatableTranslates this object horizontally bydxand vertically bydy.- Specified by:
- performTranslatein interface- Translatable
- Overrides:
- performTranslatein class- Point
- Parameters:
- dx- The amount to translate horizontally
- dy- The amount to translate vertically
- See Also:
 
- 
preciseXpublic double preciseX()Description copied from class:PointReturnsdoublex coordinate
- 
preciseYpublic double preciseY()Description copied from class:PointReturnsdoubley coordinate
- 
scaleDescription copied from class:PointScales this Point by the specified values.
- 
setLocationDescription copied from class:PointSets the location of this Point to the provided x and y locations.- Overrides:
- setLocationin class- Point
- Parameters:
- x- the x location
- y- the y location
- Returns:
- thisfor convenience
- See Also:
 
- 
setLocationDescription copied from class:PointSets the location of this Point to the specified Point.- Overrides:
- setLocationin class- Point
- Parameters:
- pt- the Location
- Returns:
- thisfor convenience
- See Also:
 
- 
setPreciseLocationSets 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
 
- 
setPreciseLocationSets 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
 
- 
setPreciseXSets the precise x value of this PrecisionPoint to the given value.- Parameters:
- x- The new x value
- Returns:
- this for convenience
- Since:
- 3.7
 
- 
setPreciseYSets the precise y value of this PrecisionPoint to the given value.- Parameters:
- y- The new y value
- Returns:
- this for convenience
- Since:
- 3.7
 
- 
setXDescription copied from class:PointSets the x value of this Point to the given value.
- 
setYDescription copied from class:PointSets the y value of this Point to the given value;
- 
translateDescription copied from class:PointShifts this Point by the values of the Dimension along each axis, and returns this for convenience.
- 
translateDescription copied from class:PointShifts this Point by the values supplied along each axes, and returns this for convenience.
- 
translateDescription copied from class:PointShifts this Point by the values supplied along each axes, and returns this for convenience.
- 
translateDescription 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.
- 
transposeDescription copied from class:PointTransposes this object. X and Y values are exchanged.
- 
updateIntsDeprecated, 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.