Example usage for Java java.awt Point fields, constructors, methods, implement or subclass
The text is from its open source code.
Point() Constructs and initializes a point at the origin (0, 0) of the coordinate space. | |
Point(int x, int y) Constructs and initializes a point at the specified (x,y) location in the coordinate space. | |
Point(Point p) Constructs and initializes a point with the same location as the specified Point object. |
Object | clone() Creates a new object of the same class and with the same contents as this object. |
double | distance(Point2D pt) Returns the distance from this Point2D to a specified Point2D . |
boolean | equals(Object obj) Determines whether or not two points are equal. |
Point | getLocation() Returns the location of this point. |
double | getX() |
double | getY() |
void | move(int x, int y) Moves this point to the specified location in the (x,y) coordinate plane. |
void | setLocation(int x, int y) Changes the point to have the specified location. |
void | setLocation(double x, double y) Sets the location of this point to the specified double coordinates. |
void | setLocation(Point p) Sets the location of the point to the specified location. |
String | toString() Returns a string representation of this point and its location in the (x,y) coordinate space. |
void | translate(int dx, int dy) Translates this point, at location (x,y) , by dx along the x axis and dy along the y axis so that it now represents the point (x+dx,y+dy) . |