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 TypeFieldDescriptiondouble
Deprecated.double
Deprecated.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 TypeMethodDescriptionboolean
Test for equality.getCopy()
Calculates the difference in between this Point and the one specified.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 bydx
and vertically bydy
.double
preciseX()
Returnsdouble
x coordinatedouble
preciseY()
Returnsdouble
y 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 void
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 preciseXDeprecated.UsesetPreciseX(double)
andpreciseX()
instead. This field will become private in future versions.Double value for X -
preciseY
public double preciseYDeprecated.UsesetPreciseY(double)
andpreciseY()
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 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:Point
Test for equality. -
getCopy
-
getDifference
Description copied from class:Point
Calculates the difference in between this Point and the one specified.- Overrides:
getDifference
in classPoint
- Parameters:
p
- The Point being subtracted from this Point- Returns:
- A new Dimension representing the difference
- See Also:
-
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 interfaceTranslatable
- Overrides:
performScale
in classPoint
- Parameters:
factor
- The scale factor- See Also:
-
performTranslate
public void performTranslate(int dx, int dy) Description copied from interface:Translatable
Translates this object horizontally bydx
and vertically bydy
.- Specified by:
performTranslate
in interfaceTranslatable
- Overrides:
performTranslate
in classPoint
- Parameters:
dx
- The amount to translate horizontallydy
- The amount to translate vertically- See Also:
-
preciseX
public double preciseX()Description copied from class:Point
Returnsdouble
x coordinate -
preciseY
public double preciseY()Description copied from class:Point
Returnsdouble
y coordinate -
scale
Description copied from class:Point
Scales this Point by the specified values. -
setLocation
Description copied from class:Point
Sets the location of this Point to the provided x and y locations.- Overrides:
setLocation
in classPoint
- Parameters:
x
- the x locationy
- the y location- Returns:
this
for convenience- See Also:
-
setLocation
Description copied from class:Point
Sets the location of this Point to the specified Point.- Overrides:
setLocation
in classPoint
- Parameters:
pt
- the Location- Returns:
this
for 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:Point
Sets the x value of this Point to the given value. -
setY
Description copied from class:Point
Sets the y value of this Point to the given value; -
translate
Description copied from class:Point
Shifts this Point by the values of the Dimension along each axis, and returns this for convenience. -
translate
Description copied from class:Point
Shifts this Point by the values supplied along each axes, and returns this for convenience. -
translate
Description copied from class:Point
Shifts this Point by the values supplied along each axes, and returns this for convenience. -
translate
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. -
transpose
Description copied from class:Point
Transposes this object. X and Y values are exchanged. -
updateInts
public final void updateInts()Deprecated.Updates the integer fields using the precise versions.
-
setPreciseX(double)
andpreciseX()
instead.