|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--acm.graphics.GPoint
public class GPoint extends ObjectThis class is a double-precision version of the Point class in java.awt.
| Constructor Summary |
| GPoint() |
| GPoint(double x,
double y) |
| GPoint(GPoint p) |
| GPoint(Point p) |
| Method Summary | |
| GPoint | getLocation() |
| double | getX() |
| double | getY() |
| void | setLocation(double x,
double y) |
| void | setLocation(GPoint p) |
| Point | toPoint() |
| void | translate(double dx,
double dy) |
| Constructor Detail |
public GPoint()| Usage: | pt = new GPoint(); |
public GPoint(double x,
double y)| Usage: | pt = new GPoint(x, y); | ||||
| Parameters: |
|
public GPoint(GPoint p)| Usage: | pt = new GPoint(p); | ||
| Parameter: |
|
public GPoint(Point p)| Usage: | pt = new GPoint(p); | ||
| Parameter: |
|
| Method Detail |
public GPoint getLocation()| Usage: | p = pt.getLocation(); |
| Returns: | A new point with the same coordinates |
public double getX()| Usage: | x = pt.getX(); |
| Returns: | The x coordinate of this GPoint |
public double getY()| Usage: | y = pt.getY(); |
| Returns: | The y coordinate of this GPoint |
public void setLocation(double x,
double y)| Usage: | pt.setLocation(x, y); | ||||
| Parameters: |
|
public void setLocation(GPoint p)| Usage: | pt.setLocation(p); | ||
| Parameter: |
|
public Point toPoint()| Usage: | size = dim.toPoint(); |
| Returns: | The closest integer-based Point |
public void translate(double dx,
double dy)| Usage: | pt.translate(dx, dy); | ||||
| Parameters: |
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||