|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.XYPoint
public final class XYPoint
Represents a point on a two dimensional, cartesian plane.
Typically, these objects are used to represent drawing positions or corners of drawing fields. In these cases, it's handy to remember that the point (0,0) represents the top, left-hand corner of a graphics extent, with increasing positive values describing the plane downwards and to the right.
XYRect
Field Summary | ||
---|---|---|
int |
x
Distance of point along horizontal axis. |
|
int |
y
Distance of point along vertical axis. |
Constructor Summary | ||
---|---|---|
XYPoint()
Constructs an origin point. |
||
XYPoint(int x,
int y)
Constructs a specified point. |
||
XYPoint(XYPoint point)
Constructs a copy of a point. |
Method Summary | ||
---|---|---|
void |
reset()
Resets the point to (0,0). |
|
void |
set(int x,
int y)
Provides new value for this point. |
|
void |
set(XYPoint point)
Sets this point equal to the given point. |
|
String |
toString()
Retrieves string form of this point. |
|
void |
translate(int dx,
int dy)
Moves this point within the plane. |
|
void |
translate(XYPoint point)
Moves this point using existing point as reference. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int x
public int y
Constructor Detail |
---|
public XYPoint()
Points built with this constructor are initialized at (0,0).
public XYPoint(int x, int y)
Pass two values to this constructor to build a point within the plane.
x
- Horizontal distance from origin.y
- Vertical distance from origin.public XYPoint(XYPoint point)
Provide an existing point to this constructor to build a new, identical point.
point
- Point to copy.Method Detail |
---|
public void reset()
public void set(int x, int y)
x
- Horizontal distance from origin.y
- Vertical distance from origin.public void set(XYPoint point)
Pass a point to this method to set this point equal to your reference point.
point
- Reference point.public String toString()
toString
in class Object
(x,y)
.public void translate(int dx, int dy)
dx
- Horizontal distance to move this point.dy
- Vertical distance to move this point.public void translate(XYPoint point)
point
- Horizontal position of parameter point used as distance to
move this point horizontally; the vertical position of parameter point
used as distance to move this point vertically.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal