java.lang.Object java.awt.geom.Point2D java.awt.Point
public class Point
A point representing a location in (x, y) coordinate space, specified in integer precision.
int
x
int
y
Point()
Point(int x, int y)
Point(Point p)
Point
object. Method Summary boolean
equals(Object obj)
Point
getLocation()
double
getX()
double
getY()
void
move(int x, int y)
void
setLocation(double x, double y)
void
setLocation(int x, int y)
void
setLocation(Point p)
String
toString()
void
translate(int dx, int dy)
dx
along the x axis and dy
along the y axis so that it now represents the point (x
+
dx
, y
+
dy
). x
public int x
getLocation()
, move(int, int)
public int y
getLocation()
, move(int, int)
public Point()
public Point(Point p)
Point
object.
p
- a point
public Point(int x, int y)
x
- the x coordinate
y
- the y coordinate
public double getX()
getX
in class Point2D
public double getY()
getY
in class Point2D
public Point getLocation()
getLocation
method of Component
.
Component.getLocation()
, setLocation(java.awt.Point)
, setLocation(int, int)
public void setLocation(Point p)
setLocation
method of Component
.
p
- a point, the new location for this point
Component.setLocation(java.awt.Point)
, getLocation()
public void setLocation(int x, int y)
This method is included for completeness, to parallel the setLocation
method of Component
. Its behavior is identical with move(int, int)
.
x
- the x coordinate of the new location
y
- the y coordinate of the new location
Component.setLocation(int, int)
, getLocation()
, move(int, int)
public void setLocation(double x, double y)
Integer.MIN_VALUE
will be reset to MIN_VALUE
, and any number larger than Integer.MAX_VALUE
will be reset to MAX_VALUE
.
setLocation
in class Point2D
x
- the x coordinate of the new location
y
- the y coordinate of the new location
getLocation()
public void move(int x, int y)
setLocation(int, int)
.
x
- the x coordinate of the new location
y
- the y coordinate of the new location
Component.setLocation(int, int)
public void translate(int dx, int dy)
dx
along the x axis and dy
along the y axis so that it now represents the point (x
+
dx
, y
+
dy
).
dx
- the distance to move this point along the x axis
dy
- the distance to move this point along the y axis
public boolean equals(Object obj)
Point2D
are equal if the values of their x
and y
member fields, representing their position in the coordinate space, are the same.
equals
in class Point2D
obj
- an object to be compared with this Point2D
true
if the object to be compared is an instance of Point2D
and has the same values; false
otherwise.
Object.hashCode()
, Hashtable
public String toString()
null
.
toString
in class Object
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4