public class PrecisionPoint extends Point
Modifier and Type | Field and Description |
---|---|
double |
preciseX
Deprecated.
Use
setPreciseX(double) and preciseX()
instead. This field will become private in future versions. |
double |
preciseY
Deprecated.
Use
setPreciseY(double) and preciseY()
instead. This field will become private in future versions. |
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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(Dimension d)
Shifts this Point by the values of the Dimension along each axis, and
returns this for convenience.
|
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(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.
|
void |
updateInts()
Deprecated.
|
equals, getDistance, getDistance2, getDistanceOrthogonal, getNegated, getPosition, getScaled, getScaled, getSWTPoint, getTranslated, getTranslated, getTranslated, getTranslated, getTransposed, hashCode, max, min, negate, scale, toString, x, y
public double preciseX
setPreciseX(double)
and preciseX()
instead. This field will become private in future versions.public double preciseY
setPreciseY(double)
and preciseY()
instead. This field will become private in future versions.public PrecisionPoint()
public PrecisionPoint(double x, double y)
x
- X valuey
- Y valuepublic PrecisionPoint(int x, int y)
x
- X valuey
- Y valuepublic PrecisionPoint(Point p)
p
- Point from which the initial values are takenpublic boolean equals(java.lang.Object o)
Point
equals
in class Point
o
- Object being tested for equalityPoint.equals(java.lang.Object)
public Point getCopy()
getCopy
in class Point
Point.getCopy()
public Dimension getDifference(Point p)
Point
getDifference
in class Point
p
- The Point being subtracted from this PointPoint.getDifference(org.eclipse.draw2d.geometry.Point)
public PrecisionPoint getPreciseCopy()
public void performScale(double factor)
Translatable
performScale
in interface Translatable
performScale
in class Point
factor
- The scale factorPoint.performScale(double)
public void performTranslate(int dx, int dy)
Translatable
dx
and vertically by
dy
.performTranslate
in interface Translatable
performTranslate
in class Point
dx
- The amount to translate horizontallydy
- The amount to translate verticallyPoint.performTranslate(int, int)
public double preciseX()
Point
double
x coordinatepreciseX
in class Point
double
x coordinatePoint.preciseX()
public double preciseY()
Point
double
y coordinatepreciseY
in class Point
double
y coordinatePoint.preciseY()
public Point scale(double xFactor, double yFactor)
Point
scale
in class Point
xFactor
- horizontal scale factoryFactor
- vertical scale factorthis
for conveniencePoint.scale(double, double)
public Point setLocation(int x, int y)
Point
setLocation
in class Point
x
- the x locationy
- the y locationthis
for conveniencePoint.setLocation(int, int)
public Point setLocation(Point pt)
Point
setLocation
in class Point
pt
- the Locationthis
for conveniencePoint.setLocation(Point)
public PrecisionPoint setPreciseLocation(double x, double y)
x
- The new x valuey
- The new y valuepublic PrecisionPoint setPreciseLocation(PrecisionPoint p)
p
- The PrecisionPoint specifying the new x and y values.public PrecisionPoint setPreciseX(double x)
x
- The new x valuepublic PrecisionPoint setPreciseY(double y)
y
- The new y valuepublic Point setX(int x)
Point
setX
in class Point
x
- The new x valuePoint.setX(int)
public Point setY(int y)
Point
setY
in class Point
y
- The new y valuePoint.setY(int)
public Point translate(Dimension d)
Point
translate
in class Point
d
- Dimension by which the origin is being shifted.this
for conveniencePoint.translate(org.eclipse.draw2d.geometry.Dimension)
public Point translate(int dx, int dy)
Point
translate
in class Point
dx
- Amount by which point is shifted along X axis.dy
- Amount by which point is shifted along Y axis.this
for conveniencePoint.translate(int, int)
public Point translate(double dx, double dy)
Point
translate
in class Point
dx
- Amount by which point is shifted along X axis.dy
- Amount by which point is shifted along Y axis.this
for conveniencePoint.translate(double, double)
public Point translate(Point p)
Point
translate
in class Point
p
- Point to which the origin is being shifted.this
for conveniencePoint.translate(org.eclipse.draw2d.geometry.Point)
public Point transpose()
Point
transpose
in class Point
this
for conveniencePoint.transpose()
public final void updateInts()
preciseX
and preciseY
field values are not
manipulated directly, but only via respective methods offered
by this class.Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.