Graphics.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_GRAPHICS_H
00002 #define JAVA_AWT_GRAPHICS_H 1
00003 
00004 #ifndef JAVA_AWT_FONT_H
00005 #include <java_awt/Font.h>
00006 #endif /* JAVA_AWT_FONT_H */
00007 #ifndef JAVA_AWT_FONTMETRICS_H
00008 #include <java_awt/FontMetrics.h>
00009 #endif /* JAVA_AWT_FONTMETRICS_H */
00010 #ifndef JAVA_AWT_COLOR_H
00011 #include <java_awt/Color.h>
00012 #endif /* JAVA_AWT_COLOR_H */
00013 #ifndef JAVA_AWT_IMAGE_H
00014 #include <java_awt/Image.h>
00015 #endif /* JAVA_AWT_IMAGE_H */
00016 #ifndef JAVA_AWT_RECTANGLE_H
00017 #include <java_awt/Rectangle.h>
00018 #endif /* JAVA_AWT_RECTANGLE_H */
00019 #ifndef JAVA_AWT_IMAGE_IMAGEOBSERVER_H
00020 #include <java_awt_image/ImageObserver.h>
00021 #endif /* JAVA_AWT_IMAGE_IMAGEOBSERVER_H */
00022 #ifndef JAVA_TEXT_ATTRIBUTEDCHARACTERITERATOR_H
00023 #include <java_text/AttributedCharacterIterator.h>
00024 #endif /* JAVA_TEXT_ATTRIBUTEDCHARACTERITERATOR_H */
00025 #ifndef JAVA_AWT_SPEC
00026 #include <java_awt/Spec.h>
00027 #endif /* JAVA_AWT_SPEC */
00028 
00029 namespace java {
00030   namespace awt {
00031 
00032     using namespace java::text;
00033     using namespace java::awt::image;
00034 
00107     class JAVA_AWT_SPEC Graphics : virtual public Object {
00108 
00109     public:
00110 
00117       virtual Ref<Graphics> create() const = 0;
00118 
00153       virtual Ref<Graphics> create(jint x, jint y, jint width, jint height) const;
00154 
00166       virtual void translate(jint x, jint y) = 0;
00167 
00174       virtual Ref<Color> getColor() const = 0;
00175 
00184       virtual void setColor(const Ref<Color>& c) = 0;
00185 
00191       virtual Ref<Color> getBkColor() const = 0;
00192 
00200       virtual void setBkColor(const Ref<Color>& c) = 0;
00201 
00209       virtual void setPaintMode() = 0;
00210 
00226       virtual void setXORMode(const Ref<Color>& c) = 0;
00227 
00234       virtual Ref<Font> getFont() const = 0;
00235 
00246       virtual void setFont(const Ref<Font>& font) = 0;
00247 
00256       virtual Ref<FontMetrics> getFontMetrics(const Ref<Font>& f = 0) const = 0;
00257 
00275       virtual Rectangle getClipBounds() const = 0;
00276 
00296       virtual void clipRect(jint x, jint y, jint width, jint height) = 0;
00297 
00313       virtual void setClip(jint x, jint y, jint width, jint height) = 0;
00314 
00331       virtual Ref<Shape> getClip() const = 0;
00332 
00349       virtual void setClip(const Ref<Shape>& clip) = 0;
00350 
00370       virtual void copyArea(jint x, jint y, jint width, jint height, jint dx, jint dy) = 0;
00371 
00381       virtual void drawLine(jint x1, jint y1, jint x2, jint y2) = 0;
00382 
00402       virtual void fillRect(jint x, jint y, jint width, jint height) = 0;
00403 
00420       virtual void drawRect(jint x, jint y, jint width, jint height);
00421 
00441       virtual void clearRect(jint x, jint y, jint width, jint height) = 0;
00442 
00459       virtual void drawRoundRect(jint x, jint y, jint width, jint height, jint arcWidth, jint arcHeight) = 0;
00460 
00477       virtual void fillRoundRect(jint x, jint y, jint width, jint height, jint arcWidth, jint arcHeight) = 0;
00478 
00498       virtual void draw3DRect(jint x, jint y, jint width, jint height, jboolean raised);
00499 
00515       virtual void fill3DRect(jint x, jint y, jint width, jint height, jboolean raised);
00516 
00534       virtual void drawOval(jint x, jint y, jint width, jint height) = 0;
00535 
00547       virtual void fillOval(jint x, jint y, jint width, jint height) = 0;
00548 
00586       virtual void drawArc(jint x, jint y, jint width, jint height, jint startAngle, jint arcAngle) = 0;
00587 
00624       virtual void fillArc(jint x, jint y, jint width, jint height, jint startAngle, jint arcAngle) = 0;
00625 
00635       virtual void drawPolyline(const Array<Point>& ps) = 0;
00636 
00654       virtual void drawPolygon(const Array<Point>& ps) = 0;
00655 
00673       virtual void fillPolygon(const Array<Point>& ps) = 0;
00674 
00686       virtual void drawString(const String& str, jint x, jint y) = 0;
00687 
00700       virtual void drawString(const AttributedCharacterIterator& iter, jint x, jint y) = 0;
00701 
00734       virtual jboolean drawImage
00735         (const Ref<Image>& img, jint x, jint y, 
00736          const Ref<ImageObserver>& observer, 
00737          const Ref<Color>& bgColor = 0) = 0;
00738 
00779       virtual jboolean drawImage
00780         (const Ref<Image>& img, jint x, jint y, jint width, jint height, 
00781          const Ref<ImageObserver>& observer, 
00782          const Ref<Color>& bgColor = 0) = 0;
00783 
00839       virtual jboolean drawImage
00840         (const Ref<Image>& img, 
00841          jint dx1, jint dy1, jint dx2, jint dy2, 
00842          jint sx1, jint sy1, jint sx2, jint sy2, 
00843          const Ref<ImageObserver>& observer, 
00844          const Ref<Color>& bgColor = 0) = 0;
00845 
00873       virtual void dispose() = 0;
00874 
00901       virtual jboolean hitClip(jint x, jint y, jint width, jint height) const;
00902 
00908       virtual String toString() const;
00909 
00910     private:
00911 
00912       REGISTER_MEMBERS;
00913 
00914     };
00915 
00916   } // namespace awt
00917 } // namespace java
00918 
00919 #endif /* JAVA_AWT_GRAPHICS_H */

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