Package org.lwjgl.util
Class Point
java.lang.Object
org.lwjgl.util.Point
- All Implemented Interfaces:
Serializable
,ReadablePoint
,WritablePoint
A 2D integer point class, which looks remarkably like an AWT one.
- Version:
- $Revision$ $Id$
- Author:
- $Author$
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether an instance ofPoint2D
is equal to this point.void
getLocation
(WritablePoint dest) Copy this ReadablePoint into a destination Pointint
getX()
int
getY()
int
hashCode()
Returns the hash code for thisPoint
.void
setLocation
(int x, int y) void
void
setX
(int x) void
setY
(int y) toString()
Returns a string representation of this point and its location in the (x, y) coordinate space.void
translate
(int dx, int dy) Translate a point.void
Translate a point.void
Un-translate a point.
-
Constructor Details
-
Point
public Point()Constructor for Point. -
Point
public Point(int x, int y) Constructor for Point. -
Point
Constructor for Point.
-
-
Method Details
-
setLocation
public void setLocation(int x, int y) - Specified by:
setLocation
in interfaceWritablePoint
-
setLocation
- Specified by:
setLocation
in interfaceWritablePoint
-
setX
public void setX(int x) - Specified by:
setX
in interfaceWritablePoint
-
setY
public void setY(int y) - Specified by:
setY
in interfaceWritablePoint
-
translate
public void translate(int dx, int dy) Translate a point.- Parameters:
dx
- The translation to applydy
- The translation to apply
-
translate
Translate a point.- Parameters:
p
- The translation to apply
-
untranslate
Un-translate a point.- Parameters:
p
- The translation to apply
-
equals
Determines whether an instance ofPoint2D
is equal to this point. Two instances ofPoint2D
are equal if the values of theirx
andy
member fields, representing their position in the coordinate space, are the same. -
toString
Returns a string representation of this point and its location in the (x, y) coordinate space. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not benull
. -
hashCode
public int hashCode()Returns the hash code for thisPoint
. -
getX
public int getX()- Specified by:
getX
in interfaceReadablePoint
- Returns:
- int
-
getY
public int getY()- Specified by:
getY
in interfaceReadablePoint
- Returns:
- int
-
getLocation
Description copied from interface:ReadablePoint
Copy this ReadablePoint into a destination Point- Specified by:
getLocation
in interfaceReadablePoint
- Parameters:
dest
- The destination Point, or null, to create a new Point
-