Component.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_COMPONENT_H
00002 #define JAVA_AWT_COMPONENT_H 1
00003 
00004 #ifndef JAVA_AWT_RECTANGLE_H
00005 #include <java_awt/Rectangle.h>
00006 #endif /* JAVA_AWT_RECTANGLE_H */
00007 #ifndef JAVA_AWT_DIMENSION_H
00008 #include <java_awt/Dimension.h>
00009 #endif /* JAVA_AWT_DIMENSION_H */
00010 #ifndef JAVA_AWT_POINT_H
00011 #include <java_awt/Point.h>
00012 #endif /* JAVA_AWT_POINT_H */
00013 #ifndef JAVA_AWT_COLOR_H
00014 #include <java_awt/Color.h>
00015 #endif /* JAVA_AWT_COLOR_H */
00016 #ifndef JAVA_AWT_FONT_H
00017 #include <java_awt/Font.h>
00018 #endif /* JAVA_AWT_FONT_H */
00019 #ifndef JAVA_AWT_AWTEVENT_H
00020 #include <java_awt/AWTEvent.h>
00021 #endif /* JAVA_AWT_AWTEVENT_H */
00022 #ifndef JAVA_AWT_GRAPHICS_H
00023 #include <java_awt/Graphics.h>
00024 #endif /* JAVA_AWT_GRAPHICS_H */
00025 #ifndef JAVA_AWT_COMPONENTORIENTATION_H
00026 #include <java_awt/ComponentOrientation.h>
00027 #endif /* JAVA_AWT_COMPONENTORIENTATION_H */
00028 #ifndef JAVA_AWT_TOOLKIT_H
00029 #include <java_awt/Toolkit.h>
00030 #endif /* JAVA_AWT_TOOLKIT_H */
00031 #ifndef JAVA_AWT_IMAGE_COLORMODEL_H
00032 #include <java_awt_image/ColorModel.h>
00033 #endif /* JAVA_AWT_IMAGE_COLORMODEL_H */
00034 #ifndef JAVA_AWT_IMAGE_IMAGEOBSERVER_H
00035 #include <java_awt_image/ImageObserver.h>
00036 #endif /* JAVA_AWT_IMAGE_IMAGEOBSERVER_H */
00037 #ifndef JAVA_AWT_IMAGE_IMAGEPRODUCER_H
00038 #include <java_awt_image/ImageProducer.h>
00039 #endif /* JAVA_AWT_IMAGE_IMAGEPRODUCER_H */
00040 #ifndef JAVA_AWT_EVENT_COMPONENTSOURCE_H
00041 #include <java_awt_event/ComponentSource.h>
00042 #endif /* JAVA_AWT_EVENT_COMPONENTSOURCE_H */
00043 #ifndef JAVA_AWT_EVENT_FOCUSSOURCE_H
00044 #include <java_awt_event/FocusSource.h>
00045 #endif /* JAVA_AWT_EVENT_FOCUSSOURCE_H */
00046 #ifndef JAVA_AWT_EVENT_HIERARCHYSOURCE_H
00047 #include <java_awt_event/HierarchySource.h>
00048 #endif /* JAVA_AWT_EVENT_HIERARCHYSOURCE_H */
00049 #ifndef JAVA_AWT_EVENT_KEYSOURCE_H
00050 #include <java_awt_event/KeySource.h>
00051 #endif /* JAVA_AWT_EVENT_KEYSOURCE_H */
00052 #ifndef JAVA_AWT_EVENT_MOUSESOURCE_H
00053 #include <java_awt_event/MouseSource.h>
00054 #endif /* JAVA_AWT_EVENT_MOUSESOURCE_H */
00055 #ifndef JAVA_AWT_EVENT_PAINTSOURCE_H
00056 #include <java_awt_event/PaintSource.h>
00057 #endif /* JAVA_AWT_EVENT_PAINTSOURCE_H */
00058 #ifndef JAVA_UTIL_PROPERTYCHANGESOURCE_H
00059 #include <java_util/PropertyChangeSource.h>
00060 #endif /* JAVA_UTIL_PROPERTYCHANGESOURCE_H */
00061 #ifndef JAVA_AWT_SPEC
00062 #include <java_awt/Spec.h>
00063 #endif /* JAVA_AWT_SPEC */
00064 
00065 namespace java {
00066   namespace awt {
00067 
00068     class Container;
00069 
00153     class JAVA_AWT_SPEC Component 
00154       : virtual public Object
00155       , virtual public Sync
00156       , virtual public image::ImageObserver
00157       , public event::ComponentSource
00158       , public event::FocusSource
00159       , public event::HierarchySource
00160       , public event::KeySource
00161       , public event::MouseSource
00162       , public event::PaintSource
00163       , public java::util::PropertyChangeSource
00164     {
00165 
00166     public:
00167 
00173       static const jfloat TOP_ALIGNMENT;
00174 
00182       static const jfloat CENTER_ALIGNMENT;
00183 
00189       static const jfloat BOTTOM_ALIGNMENT;
00190 
00196       static const jfloat LEFT_ALIGNMENT;
00197 
00203       static const jfloat RIGHT_ALIGNMENT;
00204 
00208       ObjectRef impl;
00209 
00216       virtual String getName() const;
00217 
00225       virtual void setName(const String& name);
00226 
00232       virtual Ref<Container> getParent() const;
00233 
00240       static Ref<Sync> getTreeLock();
00241 
00250       virtual Ref<Toolkit> getToolkit() const;
00251 
00263       virtual jboolean isValid() const;
00264 
00289       virtual jboolean isDisplayable() const;
00290 
00301       virtual jboolean isVisible() const;
00302 
00309       virtual jboolean isRecursivelyVisible() const;
00310 
00320       virtual jboolean isShowing() const;
00321 
00332       virtual jboolean isEnabled() const;
00333 
00348       virtual void setEnabled(jboolean b);
00349 
00358       virtual jboolean isDoubleBuffered() const;
00359 
00368       virtual void setVisible(jboolean b);
00369 
00380       virtual Ref<Color> getForeground() const;
00381 
00391       virtual void setForeground(const Ref<Color>& c);
00392 
00402       virtual jboolean isForegroundSet() const;
00403 
00412       virtual Ref<Color> getBackground() const;
00413 
00429       virtual void setBackground(const Ref<Color>& c);
00430 
00440       virtual jboolean isBackgroundSet() const;
00441 
00449       virtual Ref<Font> getFont() const;
00450 
00461       virtual void setFont(const Ref<Font>& f);
00462 
00472       virtual jboolean isFontSet() const;
00473 
00483       virtual Ref<ColorModel> getColorModel() const;
00484 
00505       virtual Point getLocation() const;
00506 
00519       virtual Point getLocationOnScreen() const;
00520 
00533       virtual void setLocation(jint x, jint y);
00534 
00546       virtual void setLocation(const Point& p);
00547 
00560       virtual Dimension getSize() const;
00561 
00571       virtual void setSize(jint width, jint height);
00572 
00582       virtual void setSize(const Dimension& d);
00583 
00594       virtual Rectangle getBounds() const;
00595 
00612       virtual void setBounds(jint x, jint y, jint width, jint height);
00613 
00628       virtual void setBounds(const Rectangle& r);
00629 
00640       virtual jint getX() const;
00641 
00652       virtual jint getY() const;
00653 
00664       virtual jint getWidth() const;
00665 
00676       virtual jint getHeight() const;
00677 
00689       virtual Rectangle getBounds(Rectangle& rv);
00690 
00701       virtual Dimension getSize(Dimension& rv);
00702 
00714       virtual Point getLocation(Point& rv);
00715 
00735       virtual jboolean isOpaque() const;
00736 
00753       virtual jboolean isLightweight() const;
00754 
00761       virtual Dimension getPreferredSize() const;
00762 
00769       virtual Dimension getMinimumSize() const;
00770 
00778       virtual Dimension getMaximumSize() const;
00779 
00787       virtual jfloat getAlignmentX() const;
00788 
00796       virtual jfloat getAlignmentY() const;
00797 
00805       virtual void doLayout();
00806 
00816       virtual void validate();
00817 
00827       virtual void invalidate();
00828 
00838       virtual Ref<Graphics> getGraphics();
00839 
00851       virtual Ref<FontMetrics> getFontMetrics(const Ref<Font>& font = 0);
00852 
00877       virtual void paint(Graphics& g);
00878 
00891       virtual void paintAll(Graphics& g);
00892 
00910       virtual void repaint(jlong tm = 0);
00911 
00934       virtual void repaint(jint x, jint y, jint width, jint height, jlong tm = 0);
00935 
00952       virtual void print(Graphics& g);
00953 
00965       virtual void printAll(Graphics& g);
00966 
01013       virtual jboolean imageUpdate
01014         (const Ref<Image>& img, jint infoflags,
01015          jint x, jint y, jint width, jint height);
01016 
01023       virtual Ref<Image> createImage(const Ref<ImageProducer>& producer);
01024 
01039       virtual Ref<Image> createImage(jint width, jint height);
01040 
01059       virtual jboolean prepareImage(const Ref<Image>& image, jint width, jint height, const Ref<ImageObserver>& observer);
01060 
01093       virtual jint checkImage(const Ref<Image>& image, jint width, jint height, const Ref<ImageObserver>& observer);
01094 
01112       virtual void setIgnoreRepaint(jboolean ignoreRepaint);
01113 
01121       virtual jboolean getIgnoreRepaint() const;
01122 
01132       virtual jboolean contains(jint x, jint y) const;
01133 
01142       virtual jboolean contains(const Point& p) const;
01143 
01165       virtual Ref<Component> getComponentAt(jint x, jint y) const;
01166 
01174       virtual Ref<Component> getComponentAt(const Point& p) const;
01175 
01185       virtual void addNotify();
01186 
01196       virtual void removeNotify();
01197 
01204       virtual void dispatchEvent(AWTEvent& e);
01205 
01232       virtual Ref<AWTEvent> coalesceEvents(const Ref<AWTEvent>& existingEvent, const Ref<AWTEvent>& newEvent) const;
01233 
01239       virtual String toString() const;
01240 
01265       virtual void setComponentOrientation(const ComponentOrientation& o);
01266 
01278       virtual void applyComponentOrientation(const ComponentOrientation& o);
01279 
01291       virtual const ComponentOrientation& getComponentOrientation() const;
01292 
01335       virtual Ref<List> getListeners(const Class& type) const;
01336 
01337       /*
01338        * check if the AWT event is enabled either there is a listener 
01339        * or enabled by the mask.
01340        * @param e the event being checked
01341        */
01342       virtual jboolean eventEnabled(const AWTEvent& e) const;
01343 
01364       virtual void processEvent(const AWTEvent& e);
01365 
01374       virtual jboolean isFocusable() const;
01375 
01386       virtual void setFocusable(jboolean focusable);
01387 
01434       virtual void requestFocus(jboolean temporrary = false);
01435 
01481       virtual void requestFocusInWindow(jboolean temporrary = false);
01482 
01497       virtual Ref<Container> getFocusCycleRootAncestor() const;
01498 
01511       virtual jboolean isFocusCycleRoot(const Ref<Container>& container) const;
01512 
01519       virtual void transferFocus();
01520 
01527       virtual void transferFocusBackward();
01528 
01542       virtual void transferFocusUpCycle();
01543 
01552       virtual jboolean isFocusOwner() const;
01553 
01554     private:
01555       REGISTER_MEMBERS;
01556     };
01557 
01558   } // namespace awt
01559 } // namespace java
01560 
01561 #ifndef JAVA_AWT_CONTAINER_H
01562 #include <java_awt/Container.h>
01563 #endif /* JAVA_AWT_CONTAINER_H */
01564 
01565 #endif /* JAVA_AWT_COMPONENT_H */

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