java::awt::Point Class Reference

Inheritance diagram for java::awt::Point:

Inheritance graph
java::awt::Rectanglejava::awt::geom::Point2Djava::lang::Object
[legend]
Collaboration diagram for java::awt::Point:

Collaboration graph
java::awt::geom::Point2Djava::lang::Object
[legend]

List of all members.


Detailed Description

A point representing a location in (x, y) coordinate space, specified in integer precision.

Version:
1.37, 01/23/03
Author:
Sami Shaio
Since:
JDK1.0

Public Member Functions

 Point (jint x=0, jint y=0)
 Constructs and initializes a point at the specified (xy) location in the coordinate space.
virtual jdouble getX () const
 Returns the X coordinate of the point in double precision.
virtual jdouble getY () const
 Returns the Y coordinate of the point in double precision.
virtual Point getLocation () const
 Returns the location of this point.
virtual void setLocation (const Point &p)
 Sets the location of the point to the specified location.
virtual void setLocation (jint x, jint y)
 Changes the point to have the specified location.
virtual void setLocation (jdouble x, jdouble y)
 Sets the location of this Point to the specified double coordinates.
virtual void setLocation (const geom::Point2D &p)
 Sets the location of this Point to the same coordinates as the specified Point2D object.
virtual void move (jint x, jint y)
 Moves this point to the specified location in the (xy) coordinate plane.
virtual void translate (jint dx, jint dy)
 Translates this point, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy).
virtual jint hashCode () const
 Returns the hashcode for this Point2D.
virtual jboolean equals (const Object &obj) const
 Determines whether or not two points are equal.
virtual String toString () const
 Returns a string representation of this point and its location in the (xy) coordinate space.

Public Attributes

jint x
 The x coordinate.
jint y
 The y coordinate.

Constructor & Destructor Documentation

java::awt::Point::Point ( jint  x = 0,
jint  y = 0 
)

Constructs and initializes a point at the specified (xy) location in the coordinate space.

Parameters:
x the x coordinate
y the y coordinate


Member Function Documentation

virtual jdouble java::awt::Point::getX (  )  const [virtual]

Returns the X coordinate of the point in double precision.

Returns:
the X coordinate of the point in double precision

Implements java::awt::geom::Point2D.

Reimplemented in java::awt::Rectangle.

virtual jdouble java::awt::Point::getY (  )  const [virtual]

Returns the Y coordinate of the point in double precision.

Returns:
the Y coordinate of the point in double precision

Implements java::awt::geom::Point2D.

Reimplemented in java::awt::Rectangle.

virtual Point java::awt::Point::getLocation (  )  const [virtual]

Returns the location of this point.

This method is included for completeness, to parallel the getLocation method of Component.

Returns:
a copy of this point, at the same location
See also:
java.awt.Component::getLocation

java.awt.Point::setLocation(java.awt.Point)

java.awt.Point::setLocation(int, int)

Since:
JDK1.1

virtual void java::awt::Point::setLocation ( const Point p  )  [virtual]

Sets the location of the point to the specified location.

This method is included for completeness, to parallel the setLocation method of Component.

Parameters:
p a point, the new location for this point
See also:
java.awt.Component::setLocation(java.awt.Point)

java.awt.Point::getLocation

Since:
JDK1.1

virtual void java::awt::Point::setLocation ( jint  x,
jint  y 
) [virtual]

Changes the point to have the specified location.

This method is included for completeness, to parallel the setLocation method of Component. Its behavior is identical with move(int, int).

Parameters:
x the x coordinate of the new location
y the y coordinate of the new location
See also:
java.awt.Component::setLocation(int, int)

java.awt.Point::getLocation

java.awt.Point::move(int, int)

Since:
JDK1.1

virtual void java::awt::Point::setLocation ( jdouble  x,
jdouble  y 
) [virtual]

Sets the location of this Point to the specified double coordinates.

Parameters:
x, y the coordinates of this Point2D
Since:
1.2

Implements java::awt::geom::Point2D.

virtual void java::awt::Point::setLocation ( const geom::Point2D p  )  [virtual]

Sets the location of this Point to the same coordinates as the specified Point2D object.

Parameters:
p the specified Point2D the which to set this Point2D
Since:
1.2

Reimplemented from java::awt::geom::Point2D.

virtual void java::awt::Point::move ( jint  x,
jint  y 
) [virtual]

Moves this point to the specified location in the (xy) coordinate plane.

This method is identical with setLocation(int, int).

Parameters:
x the x coordinate of the new location
y the y coordinate of the new location
See also:
java.awt.Component::setLocation(int, int)

virtual void java::awt::Point::translate ( jint  dx,
jint  dy 
) [virtual]

Translates this point, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy).

Parameters:
dx the distance to move this point along the x axis
dy the distance to move this point along the y axis

virtual jint java::awt::Point::hashCode (  )  const [virtual]

Returns the hashcode for this Point2D.

Returns:
a hash code for this Point2D.

Reimplemented from java::awt::geom::Point2D.

Reimplemented in java::awt::Rectangle.

virtual jboolean java::awt::Point::equals ( const Object obj  )  const [virtual]

Determines whether or not two points are equal.

Two instances of Point2D are equal if the values of their x and y member fields, representing their position in the coordinate space, are the same.

Parameters:
obj an object to be compared with this Point2D
Returns:
true if the object to be compared is an instance of Point2D and has the same values; false otherwise.

Reimplemented from java::awt::geom::Point2D.

Reimplemented in java::awt::Rectangle.

virtual String java::awt::Point::toString (  )  const [virtual]

Returns a string representation of this point and its location in the (xy) 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 be null.

Returns:
a string representation of this point

Reimplemented from java::awt::geom::Point2D.

Reimplemented in java::awt::Rectangle.


Member Data Documentation

jint java::awt::Point::x

The x coordinate.

If no x coordinate is set it will default to 0.

See also:
getLocation()

move(int, int)

Reimplemented from java::awt::geom::Point2D.

jint java::awt::Point::y

The y coordinate.

If no y coordinate is set it will default to 0.

See also:
getLocation()

move(int, int)

Reimplemented from java::awt::geom::Point2D.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:07 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3