|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Double
com.quinncurtis.chart2djava.ChartPoint2D
public class ChartPoint2D
The ChartPoint2D
class defines a point representing a location in (x,y) coordinate space.
Extrapolated from the original Sun Point2D class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.geom.Point2D |
---|
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
Field Summary |
---|
Fields inherited from class java.awt.geom.Point2D.Double |
---|
x, y |
Constructor Summary | |
---|---|
ChartPoint2D()
Default constructor. |
|
ChartPoint2D(ChartPoint2D p)
Constructs and initializes a ChartPoint2D with the specified coordinates. |
|
ChartPoint2D(double px,
double py)
Constructs and initializes a ChartPoint2D with the specified coordinates. |
|
ChartPoint2D(java.util.GregorianCalendar px,
double py)
Constructs and initializes a ChartPoint2D with the specified coordinates. |
|
ChartPoint2D(java.awt.geom.Point2D p)
Constructs and initializes a ChartPoint2D with the specified coordinates. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates a new object of the same class and with the same contents as this object. |
double |
distance(ChartPoint2D pt)
Returns the distance from this ChartPoint2D to a specified ChartPoint2D . |
double |
distance(double PX,
double PY)
Returns the distance from this ChartPoint2D to a specified point. |
static double |
distance(double X1,
double Y1,
double X2,
double Y2)
Returns the distance between two points. |
double |
distanceSq(ChartPoint2D pt)
Returns the square of the distance between the specified point and the current point. |
double |
distanceSq(double PX,
double PY)
Returns the square of the distance between the specified point and the current point. |
static double |
distanceSq(double X1,
double Y1,
double X2,
double Y2)
Returns the square of the distance between two points. |
java.util.GregorianCalendar |
getCalendarX()
Returns the X coordinate of this ChartPoint2D . |
java.util.GregorianCalendar |
getDateTimeX()
Returns the X coordinate of this ChartPoint2D . |
java.awt.Point |
getPoint()
Returns a Point conversion of ChartPoint2D . |
java.awt.geom.Point2D.Float |
getPointF()
Returns a PointF conversion of ChartPoint2D . |
void |
setLocation(ChartPoint2D p)
Sets the location of this ChartPoint2D to the specified coordinates. |
void |
setLocation(java.util.GregorianCalendar px,
double py)
Initializes a ChartPoint2D with the specified coordinates. |
void |
setPoint(java.awt.Point p)
Set the coordinates using a Point object . |
void |
setPointF(java.awt.geom.Point2D.Float p)
Set the coordinates using a PointF object . |
void |
setX(double x)
Sets the x-coordinate |
void |
setY(double y)
Sets the x-coordinate |
Methods inherited from class java.awt.geom.Point2D.Double |
---|
getX, getY, setLocation, toString |
Methods inherited from class java.awt.geom.Point2D |
---|
distance, distanceSq, equals, hashCode, setLocation |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChartPoint2D()
public ChartPoint2D(ChartPoint2D p)
ChartPoint2D
with the specified coordinates.
p
- the xy coordinatespublic ChartPoint2D(double px, double py)
ChartPoint2D
with the specified coordinates.
px
- the x-coordinatepy
- the y-coordinatepublic ChartPoint2D(java.util.GregorianCalendar px, double py)
ChartPoint2D
with the specified coordinates.
px
- the x-coordinatepy
- the y-coordinatepublic ChartPoint2D(java.awt.geom.Point2D p)
ChartPoint2D
with the specified coordinates.
p
- the xy coordinatesMethod Detail |
---|
public java.lang.Object clone()
clone
in class java.awt.geom.Point2D
public double distance(ChartPoint2D pt)
ChartPoint2D
to a specified ChartPoint2D
.
pt
- the coordinates of the specified point
ChartPoint2D
and the specified ChartPoint2D
.public double distance(double PX, double PY)
ChartPoint2D
to a specified point.
distance
in class java.awt.geom.Point2D
PX
- the x-value of the specified pointPY
- the y-value of the specified point
ChartPoint2D
and a specified point.public static double distance(double X1, double Y1, double X2, double Y2)
X1
- the x-coordinate of the first pointY1
- the y-coordinate of the first pointX2
- the x-coordinate of the second pointY2
- the y-coordinate of the second point
public double distanceSq(ChartPoint2D pt)
pt
- the coordinates of the specified point
public double distanceSq(double PX, double PY)
distanceSq
in class java.awt.geom.Point2D
PX
- the x-value of the specified pointPY
- the y-value of the specified point
public static double distanceSq(double X1, double Y1, double X2, double Y2)
X1
- the x-coordinate of the first pointY1
- the y-coordinate of the first pointX2
- the x-coordinate of the second pointY2
- the y-coordinate of the second point
public java.util.GregorianCalendar getCalendarX()
ChartPoint2D
.
ChartPoint2D
.public java.util.GregorianCalendar getDateTimeX()
ChartPoint2D
.
ChartPoint2D
.public java.awt.Point getPoint()
ChartPoint2D
.
ChartPoint2D
.public java.awt.geom.Point2D.Float getPointF()
ChartPoint2D
.
ChartPoint2D
.public void setLocation(ChartPoint2D p)
ChartPoint2D
to the specified coordinates.
p
- the coordinate valuespublic void setLocation(java.util.GregorianCalendar px, double py)
ChartPoint2D
with the specified coordinates.
px
- the x-coordinatepy
- the y-coordinatepublic void setPoint(java.awt.Point p)
p
- Set the coordinates using a Point object .public void setPointF(java.awt.geom.Point2D.Float p)
p
- Set the coordinates using a PointF object .public void setX(double x)
x
- Sets the x-coordinate.public void setY(double y)
y
- Sets the x-coordinate.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |