Point2D.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_GEOM_POINT2D_H
00002 #define JAVA_AWT_GEOM_POINT2D_H 1
00003 
00004 #ifndef JAVA_LANG_OBJECT_H
00005 #include <java_lang/Object.h>
00006 #endif /* JAVA_LANG_OBJECT_H */
00007 #ifndef JAVA_AWT_SPEC
00008 #include <java_awt/Spec.h>
00009 #endif /* JAVA_AWT_SPEC */
00010 
00011 namespace java {
00012   namespace awt {
00013     namespace geom {
00014 
00015       class Point2D;
00016       
00029       class JAVA_AWT_SPEC Point2D : virtual public Object {
00030 
00031       public:
00032         
00033         class Float;
00034         class Double;
00035           
00042         virtual jdouble getX() const = 0;
00043 
00050         virtual jdouble getY() const = 0;
00051 
00058         virtual void setLocation(jdouble x, jdouble y) = 0;
00059 
00067         virtual void setLocation(const Point2D& p);
00068 
00076         static jdouble distanceSq(jdouble X1, jdouble Y1, jdouble X2, jdouble Y2);
00077 
00085         static jdouble distance(jdouble X1, jdouble Y1, jdouble X2, jdouble Y2);
00086 
00094         virtual jdouble distanceSq(jdouble PX, jdouble PY) const;
00095 
00103         virtual jdouble distanceSq(const Point2D& pt) const;
00104 
00113         virtual jdouble distance(jdouble PX, jdouble PY) const;
00114 
00122         virtual jdouble distance(const Point2D& pt) const;
00123 
00124         private:
00125 
00126         REGISTER_MEMBERS;
00127 
00128       };
00129 
00130       class JAVA_AWT_SPEC Point2D::Float : public Point2D {
00131 
00132       public:
00133 
00138         jfloat x;
00139           
00144         jfloat y;
00145 
00153         Float(jfloat x = 0, jfloat y = 0);
00154 
00161         virtual jdouble getX() const;
00162 
00169         virtual jdouble getY() const;
00170 
00177         virtual void setLocation(jdouble x, jdouble y);
00178 
00186         virtual void setLocation(jfloat x, jfloat y);
00187 
00195         virtual void setLocation(const Point2D& p);
00196 
00204         virtual void setLocation(const Float& p);
00205 
00210         virtual jint hashCode() const;
00211 
00223         virtual jboolean equals(const Object& obj) const;
00224 
00231         virtual String toString() const;
00232 
00233       private:
00234 
00235         REGISTER_MEMBERS;
00236 
00237       };
00238 
00239       class JAVA_AWT_SPEC Point2D::Double : public Point2D {
00240 
00241       public:
00242 
00247         jdouble x;
00248           
00253         jdouble y;
00254 
00262         Double(jdouble x = 0, jdouble y = 0);
00263 
00270         virtual jdouble getX() const;
00271 
00278         virtual jdouble getY() const;
00279 
00286         virtual void setLocation(jdouble x, jdouble y);
00287 
00295         virtual void setLocation(const Point2D& p);
00296 
00304         virtual void setLocation(const Double& p);
00305 
00310         virtual jint hashCode() const;
00311 
00323         virtual jboolean equals(const Object& obj) const;
00324 
00331         virtual String toString() const;
00332 
00333       private:
00334 
00335         REGISTER_MEMBERS;
00336 
00337       };
00338 
00339     } // namespace geom
00340   } // namespace awt
00341 } // namespace java
00342 
00343 #endif /* JAVA_AWT_GEOM_POINT2D_H */

Generated on Fri May 16 11:54:43 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3