|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.geom.Point2D
java.awt.Point
public class Point
Represents a point in two dimensional space using integer co-ordinates
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.geom.Point2D |
|---|
Point2D.Double, Point2D.Float |
| Field Summary | |
|---|---|
int |
x
The x coordinate of the point |
int |
y
The y coordinate of the point |
| Constructor Summary | |
|---|---|
Point()
Create a point at (0,0) |
|
Point(int x,
int y)
Create a point at (x,y) |
|
Point(Point p)
Create a point from a given point |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
Test if this point is equal to a given object |
Point |
getLocation()
Get the location of the point |
double |
getX()
Get the x coordinate as a double |
double |
getY()
Get the y coordinate as a double |
void |
move(int x,
int y)
Move the location of the point to (x,y) |
void |
setLocation(double x,
double y)
Set the location of this Point2D using double coordinates |
void |
setLocation(int x,
int y)
Set the location of the point using integer coordinates |
void |
setLocation(Point p)
Set the location of the point to a given point |
String |
toString()
Represent the point as a String |
void |
translate(int dx,
int dy)
Move the point by the vector (dx, dy) |
| Methods inherited from class java.awt.geom.Point2D |
|---|
clone, distance, distance, distance, distanceSq, distanceSq, distanceSq, setLocation |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int x
public int y
| Constructor Detail |
|---|
public Point()
public Point(int x,
int y)
x - the x coordinatey - the y coordinatepublic Point(Point p)
p - the given point| Method Detail |
|---|
public double getX()
Point2D
getX in class Point2Dpublic double getY()
Point2D
getY in class Point2D
public void setLocation(double x,
double y)
Point2D
setLocation in class Point2Dx - the new x coordinatey - the new y coordinate
public void setLocation(int x,
int y)
x - the x coordinatey - the y coordinatepublic void setLocation(Point p)
p - the given point
public void move(int x,
int y)
x - the new x coordinatey - the new y coordinate
public void translate(int dx,
int dy)
dx - the increment of the x coordinatedy - the increment of the y coordinatepublic Point getLocation()
public String toString()
toString in class Objectpublic boolean equals(Object obj)
Point2D
equals in class Point2D
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||