Rectangle.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_RECTANGLE_H
00002 #define JAVA_AWT_RECTANGLE_H 1
00003 
00004 #ifndef JAVA_AWT_GEOM_RECTANGLE2D_H
00005 #include <java_awt_geom/Rectangle2D.h>
00006 #endif /* JAVA_AWT_GEOM_RECTANGLE2D_H */
00007 #ifndef JAVA_AWT_POINT_H
00008 #include <java_awt/Point.h>
00009 #endif /* JAVA_AWT_POINT_H */
00010 #ifndef JAVA_AWT_DIMENSION_H
00011 #include <java_awt/Dimension.h>
00012 #endif /* JAVA_AWT_DIMENSION_H */
00013 #ifndef JAVA_AWT_SPEC
00014 #include <java_awt/Spec.h>
00015 #endif /* JAVA_AWT_SPEC */
00016 
00017 namespace java {
00018   namespace awt {
00019 
00049     class JAVA_AWT_SPEC Rectangle : virtual public geom::Rectangle2D,
00050       public Point, public Dimension {
00051 
00052     public:
00053 
00059       Rectangle();
00060 
00071       Rectangle(jint x, jint y, jint w, jint h);
00072 
00080       Rectangle(jint w, jint h);
00081 
00092       Rectangle(const Point& p, const Dimension& d);
00093 
00100       Rectangle(const Point& p);
00101 
00108       Rectangle(const Dimension& d);
00109 
00115       virtual jdouble getX() const;
00116 
00122       virtual jdouble getY() const;
00123 
00129       virtual jdouble getWidth() const;
00130 
00136       virtual jdouble getHeight() const;
00137 
00151       virtual Rectangle getBounds() const;
00152 
00157       virtual Ref<geom::Rectangle2D> getBounds2D() const;
00158 
00170       virtual void setBounds(const Rectangle& r);
00171 
00190       virtual void setBounds(jint x, jint y, jint width, jint height);
00191 
00205       virtual void setRect(jdouble x, jdouble y, jdouble width, jdouble height);
00206 
00217       virtual jboolean contains(const Point& p) const;
00218 
00231       virtual jboolean contains(jint _x, jint _y) const;
00232 
00242       virtual jboolean contains(const Rectangle& r) const;
00243 
00259       virtual jboolean contains(jint _x, jint _y, jint _w, jint _h) const;
00260 
00271       virtual jboolean intersects(const Rectangle& r) const;
00272 
00288       virtual jboolean intersects(jint _x, jint _y, jint _w, jint _h) const;
00289 
00303       Rectangle intersection(const Rectangle& r) const;
00304 
00315       Rectangle unionOf(const Rectangle& r) const;
00316 
00335       virtual void add(jint newx, jint newy);
00336 
00355       virtual void add(const Point& pt);
00356 
00363       virtual void add(const Rectangle& r);
00364 
00388       virtual void grow(jint h, jint v);
00389 
00397       virtual jboolean isEmpty() const;
00398 
00415       virtual jint outcode(jdouble x, jdouble y) const;
00416 
00428       virtual Ref<geom::Rectangle2D> createIntersection(const geom::Rectangle2D& r) const;
00429 
00441       virtual Ref<geom::Rectangle2D> createUnion(const geom::Rectangle2D& r) const;
00442 
00447       virtual jint hashCode() const;
00448 
00460       virtual jboolean equals(const Object& obj) const;
00461 
00468       virtual String toString() const;
00469 
00470     private:
00471 
00472       REGISTER_MEMBERS;
00473 
00474     };
00475 
00476   } // namespace awt
00477 } // namespace java
00478 
00479 #endif /* JAVA_AWT_RECTANGLE_H */

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