00001
00013 #include "component.h"
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00029 void setSize(jobject obj, jint width, jint height) {
00030 callVoidMethodByName(obj, "setSize", "(II)V", width, height);
00031 }
00032
00043 jint getWidth(jobject obj) {
00044 return callIntMethodByName(obj, "getWidth", "()I");
00045 }
00046
00057 jint getHeight(jobject obj) {
00058 return callIntMethodByName(obj, "getHeight", "()I");
00059 }
00060
00071 jint getX(jobject obj) {
00072 return callIntMethodByName(obj, "getX", "()I");
00073 }
00074
00085 jint getY(jobject obj) {
00086 return callIntMethodByName(obj, "getY", "()I");
00087 }
00088
00099 void setLocation(jobject obj, jint x, jint y) {
00100 callVoidMethodByName(obj, "setLocation", "(II)V", x, y);
00101 }
00102
00111 void setForeground(jobject obj, const Color c) {
00112 jobject jcolor = convertColor(&c);
00113 callVoidMethodByName(obj,"setForeground", "(Ljava/awt/Color;)V", jcolor);
00114 deleteGlobalReference(jcolor);
00115 }
00116
00126 Color getForeground(jobject obj) {
00127 Color c;
00128 jobject jcolor = callObjectMethodByName(obj, "getForeground", "()Ljava/awt/Color;");
00129 c = convertJavaColor(jcolor);
00130 deleteLocalReference(jcolor);
00131 return c;
00132 }
00133
00142 void setBackground(jobject obj, const Color c) {
00143 jobject jcolor = convertColor(&c);
00144 callVoidMethodByName(obj,"setBackground", "(Ljava/awt/Color;)V", jcolor);
00145 deleteGlobalReference(jcolor);
00146 }
00147
00157 Color getBackground(jobject obj) {
00158 Color c;
00159 jobject jcolor = callObjectMethodByName(obj, "getBackground", "()Ljava/awt/Color;");
00160 c = convertJavaColor(jcolor);
00161 deleteLocalReference(jcolor);
00162 return c;
00163 }
00164
00165 #ifdef __cplusplus
00166 }
00167 #endif
00168
00169
00170