|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.eclipse.draw2d.geometry.Point
Provides support for a point in two dimensional space.
| Field Summary | |
static Point |
SINGLETON
|
int |
x
|
int |
y
|
| Constructor Summary | |
Point()
Constructs a Point at location (0,0). |
|
Point(double x,
double y)
Constructs a Point at the locations along axes suplied as input in double format. |
|
Point(int x,
int y)
Constructs a Point at the locations along axes suplied as input. |
|
Point(Point copy)
Constructs a Point which is at the same location as the input Point. |
|
| Method Summary | |
boolean |
equals(Object o)
Returns whether this Point is equal to the Object input. |
Point |
getCopy()
Returns a copy of this Point. |
Dimension |
getDifference(Point pt)
Returns the difference in location between this Point and the Point pt as a Dimension. |
double |
getDistance(Point pt)
Returns the distance of this Point from the Point pt. |
int |
getDistance2(Point pt)
Returns the sum of the squares of the length between this Point and the Point pt. |
int |
getDistanceOrthogonal(Point pt)
Returns the orthogonal distance to the specified point. |
Point |
getNegated()
Returns a new Point with the negated values of this Point. |
int |
getPosition(Point p)
|
Point |
getScaled(float amount)
Returns a new Point, which is scaled by the input value. |
Point |
getSWTPoint()
Returns a new org.eclipse.swt.graphics.Point, that is equivalent to this Point. |
Point |
getTranslated(Dimension delta)
Returns a new Point which is translated by the values of the input Dimension. |
Point |
getTranslated(int x,
int y)
Returns a new Point which is translated by the values of the inputs. |
Point |
getTranslated(Point pt)
Returns a new Point which is translated by the values of the input Point. |
Point |
getTransposed()
Returns a new Point with the transposed values of this Point. |
static Point |
max(Point p1,
Point p2)
|
static Point |
min(Point p1,
Point p2)
|
Point |
negate()
Mirrors this Point about the origin, and returns this for conveinience. |
void |
performScale(float factor)
Scales the location of this Point along both X and Y axes by factor. |
void |
performTranslate(int dx,
int dy)
Translates this Point by (dx,dy). |
Point |
scale(float amount)
Scales the location of this Point along both X and Y axes by the value input. |
Point |
scale(float xAmount,
float yAmount)
Scales the location of this Point along X and Y axes by the respective values given as input, and returns this for convenience. |
Point |
setLocation(int x,
int y)
Sets the location of this Point by setting its x and y coordinates to the x and y values passed in. |
Point |
setLocation(Point pt)
Sets the location of this Point by setting its x and y coordinates to pt.x and pt.y, respectively. |
String |
toString()
Returns the description of this Point as a String. |
Point |
translate(Dimension d)
Shifts this Point by the values of the Dimension along each axis, 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()
Interchanges the location of this Point along each of the axes and returns this for convenience. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public int x
public int y
public static final Point SINGLETON
| Constructor Detail |
public Point()
public Point(Point copy)
copy - Point from which the initial values are
taken.
public Point(int x,
int y)
x - Position of point along X axis.y - Position of point along Y axis.
public Point(double x,
double y)
double format.x - Position of point along X axis.y - Position of point along Y axis.| Method Detail |
public boolean equals(Object o)
equals in class Objecto - Object being tested for equality.public Point getNegated()
public int getPosition(Point p)
public Point getScaled(float amount)
amount - Value indicating the amount of scaling to
be done.public Point getSWTPoint()
public Point getTranslated(Dimension delta)
delta - Dimension which provides the translation amounts.public Point getTranslated(Point pt)
pt - Point which provides the translation amounts.
public Point getTranslated(int x,
int y)
x - Amount by which the Point should be translated along X axis.y - Amount by which the Point should be translated along Y axis.public Point getTransposed()
public static Point max(Point p1,
Point p2)
public static Point min(Point p1,
Point p2)
public Point getCopy()
public Dimension getDifference(Point pt)
pt - Point to which the difference is required.public double getDistance(Point pt)
pt - Point from which the distance is required.doublepublic int getDistanceOrthogonal(Point pt)
public int getDistance2(Point pt)
pt - Point against which the difference calculations are made.public Point negate()
public void performScale(float factor)
performScale in interface Translatable
public void performTranslate(int dx,
int dy)
performTranslate in interface Translatablepublic Point scale(float amount)
public Point scale(float xAmount,
float yAmount)
xAmount - Amounts scaling along X axis.yAMount - Amounts scaling along Y axis.public Point setLocation(Point pt)
public Point setLocation(int x,
int y)
public String toString()
toString in class Objectpublic Point translate(Point p)
p - Point to which the origin is being shifted.translate(int,int),
translate(Dimension)public Point translate(Dimension d)
d - Dimension by which the origin is being shifted.translate(Point),
translate(int,int)
public Point translate(int dx,
int dy)
dx - Amount by which point is shifted along X axis.dy - Amount by which point is shifted along Y axis.translate(Point),
translate(Dimension)public Point transpose()
|
Draw2D v2.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||