Color.h

Go to the documentation of this file.
00001 #ifndef JAVA_AWT_COLOR_H
00002 #define JAVA_AWT_COLOR_H 1
00003 
00004 #ifndef JAVA_AWT_TRANSPARENCY_H
00005 #include <java_awt/Transparency.h>
00006 #endif /* JAVA_AWT_TRANSPARENCY_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 
00040     class JAVA_AWT_SPEC Color : virtual public Object, virtual public Transparency {
00041 
00042     public:
00043         
00044       static const Color WHITE;
00045       static const Color LIGHT_GRAY;
00046       static const Color GRAY;
00047       static const Color DARK_GRAY;
00048       static const Color BLACK;
00049       static const Color RED;
00050       static const Color PINK;
00051       static const Color ORANGE;
00052       static const Color YELLOW;
00053       static const Color GREEN;
00054       static const Color MAGENTA;
00055       static const Color CYAN;
00056       static const Color BLUE;
00057 
00072       Color(jint rgb = 0);
00073 
00090       Color(jint rgba, jboolean hasalpha);
00091 
00105       Color(jint r, jint g, jint b, jint a = 255);
00106 
00122       Color(jfloat r, jfloat g, jfloat b, jfloat a = 1.0f);
00123 
00130       virtual jint getRed() const;
00131 
00138       virtual jint getGreen() const;
00139 
00146       virtual jint getBlue() const;
00147 
00153       virtual jint getAlpha() const;
00154 
00168       virtual jint getRGB() const;
00169 
00185       virtual Ref<Color> brighter() const;
00186 
00202       virtual Ref<Color> darker() const;
00203 
00209       virtual jint hashCode() const;
00210 
00224       virtual jboolean equals(const Object& obj) const;
00225 
00235       virtual String toString() const;
00236 
00250       static Ref<Color> decode(const String& nm);
00251 
00272       static Ref<Color> getColor(const String& nm, const Ref<Color>& v = 0);
00273 
00301       static jint HSBtoRGB(jfloat hue, jfloat saturation, jfloat brightness);
00302 
00325       static Array<jfloat> RGBtoHSB(jint r, jint g, jint b);
00326 
00345       static Ref<Color> getHSBColor(jfloat h, jfloat s, jfloat b);
00346 
00359       Array<jfloat> getRGBComponents() const;
00360 
00372       Array<jfloat> getRGBColorComponents() const;
00373 
00390       Array<jfloat> getComponents() const;
00391 
00407       Array<jfloat> getColorComponents() const;
00408 
00417       virtual jint getTransparency() const;
00418 
00419     private:
00420 
00421       ObjectRef impl;
00422       REGISTER_MEMBERS;
00423 
00424     };
00425 
00426   } // namespace awt
00427 } // namespace java
00428 
00429 #endif /* JAVA_AWT_COLOR_H */

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