#include <JNIQSwingWrapper.h>
Static Public Member Functions | |
static JNIEnv * | env () |
Returns JNIEnv pointer. | |
static bool | isQSwingThread (JNIEnv *env) |
Returns true if the specified JNIEnv pointer is same as sm_env. | |
static void | checkGUIThread (JNIEnv *env) |
Checks if a GUI object is outside the GUI thread. | |
static void | checkException () |
Checks for JNI exceptions. | |
static bool | testException () |
Test if an exception has occurred. | |
static void | fatalError (const char *errorMessage) |
Prints the error message and terminates virtual machine. | |
static void | throwInternalError (const char *errorMessage=0) |
Throws java's internal error. | |
static void | throwOutOfMemoryError (const char *errorMessage=0) |
Throws java's out of memory error. | |
static void | throwRuntimeExcpetion (const char *exceptionMessage=0) |
Throws java's runtime exception. | |
static jfieldID | getFieldID (jclass cls, const char *name, const char *sig) |
Returns the fieldID for an instance field of a class. | |
static jfieldID | getStaticFieldID (jclass cls, const char *name, const char *sig) |
Returns the field ID for a static field of a class or interface. | |
static jmethodID | getMethodID (jclass cls, const char *name, const char *sig) |
Returns the methodID for an instance method of a class or interface. | |
static jmethodID | getStaticMethodID (jclass cls, const char *name, const char *sig) |
Returns the method ID for a static method of a class. | |
static jobject | getObjectField (jobject obj, jfieldID fieldID) |
Returns the value of the object field of the specified object. | |
static void | setObjectField (jobject obj, jfieldID fieldID, jobject val) |
Sets the value of the object field of the specified object. | |
static jboolean | getBooleanField (jobject obj, jfieldID fieldID) |
Returns the value of the boolean field of the specified object. | |
static void | setBooleanField (jobject obj, jfieldID fieldID, jboolean val) |
Sets the value of the boolean field of the specified object. | |
static jbyte | getByteField (jobject obj, jfieldID fieldID) |
Returns the value of the byte field of the specified object. | |
static void | setByteField (jobject obj, jfieldID fieldID, jbyte val) |
Sets the value of the byte field of the specified object. | |
static jchar | getCharField (jobject obj, jfieldID fieldID) |
Returns the value of the char field of the specified object. | |
static void | setCharField (jobject obj, jfieldID fieldID, jchar val) |
Sets the value of the char field of the specified object. | |
static jshort | getShortField (jobject obj, jfieldID fieldID) |
Returns the value of the short field of the specified object. | |
static void | setShortField (jobject obj, jfieldID fieldID, jshort val) |
Sets the value of the short field of the specified object. | |
static jint | getIntField (jobject obj, jfieldID fieldID) |
Returns the value of the int field of the specified object. | |
static void | setIntField (jobject obj, jfieldID fieldID, jint val) |
Sets the value of the int field of the specified object. | |
static jlong | getLongField (jobject obj, jfieldID fieldID) |
Returns the value of the long field of the specified object. | |
static void | setLongField (jobject obj, jfieldID fieldID, jlong val) |
Sets the value of the long field of the specified object. | |
static jfloat | getFloatField (jobject obj, jfieldID fieldID) |
Returns the value of the float field of the specified object. | |
static void | setFloatField (jobject obj, jfieldID fieldID, jfloat val) |
Sets the value of the float field of the specified object. | |
static jdouble | getDoubleField (jobject obj, jfieldID fieldID) |
Returns the value of the double field of the specified object. | |
static void | setDoubleField (jobject obj, jfieldID fieldID, jdouble val) |
Sets the value of the double field of the specified object. | |
static bool | callObjectMethod (jobject &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI object method. | |
static bool | callObjectMethod (jobject &result, jobject obj, jmethodID methodID,...) |
Calls JNI object method. | |
static bool | callBooleanMethod (jboolean &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI boolean method. | |
static bool | callBooleanMethod (jboolean &result, jobject obj, jmethodID methodID,...) |
Calls JNI boolean method. | |
static bool | callByteMethod (jbyte &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI byte method. | |
static bool | callByteMethod (jbyte &result, jobject obj, jmethodID methodID,...) |
Calls JNI byte method. | |
static bool | callCharMethod (jchar &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI char method. | |
static bool | callCharMethod (jchar &result, jobject obj, jmethodID methodID,...) |
Calls JNI char method. | |
static bool | callShortMethod (jshort &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI short method. | |
static bool | callShortMethod (jshort &result, jobject obj, jmethodID methodID,...) |
Calls JNI short method. | |
static bool | callIntMethod (jint &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI int method. | |
static bool | callIntMethod (jint &result, jobject obj, jmethodID methodID,...) |
Calls JNI int method. | |
static bool | callLongMethod (jlong &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI long method. | |
static bool | callLongMethod (jlong &result, jobject obj, jmethodID methodID,...) |
Calls JNI long method. | |
static bool | callFloatMethod (jfloat &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI float method. | |
static bool | callFloatMethod (jfloat &result, jobject obj, jmethodID methodID,...) |
Calls JNI float method. | |
static bool | callDoubleMethod (jdouble &result, jobject obj, jmethodID methodID, va_list &args) |
Calls JNI double method. | |
static bool | callDoubleMethod (jdouble &result, jobject obj, jmethodID methodID,...) |
Calls JNI double method. | |
static bool | callVoidMethod (jobject obj, jmethodID methodID, va_list &args) |
Calls JNI void method. | |
static bool | callVoidMethod (jobject obj, jmethodID methodID,...) |
Calls JNI void method. | |
static jstring | toString (jobject obj) |
Returns jstring representation of the specified object. | |
static jstring | newString (const jchar *uchars, jsize len) |
Creates new Java string. | |
static jstring | newStringUTF (const char *bytes) |
Creates new Java string. | |
static bool | callStaticVoidMethod (jclass cls, jmethodID methodID, va_list &args) |
Calls JNI static void method. | |
static bool | callStaticVoidMethod (jclass cls, jmethodID methodID,...) |
Calls JNI static void method. | |
static jobject | newObject (jclass cls, jmethodID constructor, va_list &args) |
Creates and constructs new Java object. | |
static jobject | newObject (jclass cls, jmethodID constructor,...) |
Creates and constructs new Java object. | |
static jobjectArray | newObjectArray (jclass cls, jsize len) |
Creates new java object array. | |
static jbyteArray | newByteArray (jsize len) |
Creates new java byte array. | |
static jobject | newGlobalRef (jobject obj) |
Returns new Java global reference to the specified Java object. | |
static jweak | newWeakGlobalRef (jobject obj) |
Returns new Java weak reference to the specified Java object. | |
static void | deleteGlobalRef (jobject &objref) |
Deletes the Java reference. | |
static void | deleteWeakGlobalRef (jweak &wobjref) |
Deletes the Java weak reference. | |
static bool | isLiveRef (jweak wobjref) |
Returns true if the specified weak reference is alive. | |
Friends | |
class | QSwingBridge |
JNIEnv * JNIQSwingWrapper::env | ( | ) | [inline, static] |
Returns JNIEnv pointer.
bool JNIQSwingWrapper::isQSwingThread | ( | JNIEnv * | env | ) | [inline, static] |
Returns true
if the specified JNIEnv pointer is same as sm_env.
env | the JNIEnv pointer |
true
if JNIEnv pointer env is same as sm_env bool JNIQSwingWrapper::testException | ( | ) | [static] |
Test if an exception has occurred.
true
if the exception has occurred void JNIQSwingWrapper::fatalError | ( | const char * | errorMessage | ) | [static] |
Prints the error message and terminates virtual machine.
NOTE: This method does not return.
errorMessage | the error message |
void JNIQSwingWrapper::throwInternalError | ( | const char * | errorMessage = 0 |
) | [static] |
Throws java's internal error.
errorMessage | the error message |
void JNIQSwingWrapper::throwOutOfMemoryError | ( | const char * | errorMessage = 0 |
) | [static] |
Throws java's out of memory error.
errorMessage | the error message |
void JNIQSwingWrapper::throwRuntimeExcpetion | ( | const char * | exceptionMessage = 0 |
) | [static] |
Throws java's runtime exception.
exceptionMessage | the exception message |
jfieldID JNIQSwingWrapper::getFieldID | ( | jclass | cls, | |
const char * | name, | |||
const char * | sig | |||
) | [static] |
Returns the fieldID for an instance field of a class.
cls | the class | |
name | the field name | |
sig | the field signature |
jfieldID JNIQSwingWrapper::getStaticFieldID | ( | jclass | cls, | |
const char * | name, | |||
const char * | sig | |||
) | [static] |
Returns the field ID for a static field of a class or interface.
cls | the class | |
name | the field name | |
sig | the field signature |
jmethodID JNIQSwingWrapper::getMethodID | ( | jclass | cls, | |
const char * | name, | |||
const char * | sig | |||
) | [static] |
Returns the methodID for an instance method of a class or interface.
cls | the class | |
name | the method name | |
sig | the method signature |
jmethodID JNIQSwingWrapper::getStaticMethodID | ( | jclass | cls, | |
const char * | name, | |||
const char * | sig | |||
) | [static] |
Returns the method ID for a static method of a class.
cls | the class | |
name | the method name | |
sig | the method signature |
jobject JNIQSwingWrapper::getObjectField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the object field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setObjectField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jobject | val | |||
) | [static] |
Sets the value of the object field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jboolean JNIQSwingWrapper::getBooleanField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the boolean field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setBooleanField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jboolean | val | |||
) | [static] |
Sets the value of the boolean field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jbyte JNIQSwingWrapper::getByteField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the byte field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setByteField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jbyte | val | |||
) | [static] |
Sets the value of the byte field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jchar JNIQSwingWrapper::getCharField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the char field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setCharField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jchar | val | |||
) | [static] |
Sets the value of the char field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jshort JNIQSwingWrapper::getShortField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the short field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setShortField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jshort | val | |||
) | [static] |
Sets the value of the short field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jint JNIQSwingWrapper::getIntField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the int field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setIntField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jint | val | |||
) | [static] |
Sets the value of the int field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jlong JNIQSwingWrapper::getLongField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the long field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setLongField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jlong | val | |||
) | [static] |
Sets the value of the long field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jfloat JNIQSwingWrapper::getFloatField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the float field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setFloatField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jfloat | val | |||
) | [static] |
Sets the value of the float field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
jdouble JNIQSwingWrapper::getDoubleField | ( | jobject | obj, | |
jfieldID | fieldID | |||
) | [static] |
Returns the value of the double field of the specified object.
obj | the object | |
fieldID | the field ID |
void JNIQSwingWrapper::setDoubleField | ( | jobject | obj, | |
jfieldID | fieldID, | |||
jdouble | val | |||
) | [static] |
Sets the value of the double field of the specified object.
obj | the object | |
fieldID | the field ID | |
val | the new value |
bool JNIQSwingWrapper::callObjectMethod | ( | jobject & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI object method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callObjectMethod | ( | jobject & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI object method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callBooleanMethod | ( | jboolean & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI boolean method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callBooleanMethod | ( | jboolean & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI boolean method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callByteMethod | ( | jbyte & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI byte method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callByteMethod | ( | jbyte & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI byte method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callCharMethod | ( | jchar & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI char method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callCharMethod | ( | jchar & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI char method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callShortMethod | ( | jshort & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI short method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callShortMethod | ( | jshort & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI short method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callIntMethod | ( | jint & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI int method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callIntMethod | ( | jint & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI int method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callLongMethod | ( | jlong & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI long method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callLongMethod | ( | jlong & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI long method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callFloatMethod | ( | jfloat & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI float method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callFloatMethod | ( | jfloat & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI float method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callDoubleMethod | ( | jdouble & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI double method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callDoubleMethod | ( | jdouble & | result, | |
jobject | obj, | |||
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI double method.
result | the result | |
obj | the jobject | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callVoidMethod | ( | jobject | obj, | |
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI void method.
obj | the java object | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callVoidMethod | ( | jobject | obj, | |
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI void method.
obj | the java object | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown jstring JNIQSwingWrapper::toString | ( | jobject | obj | ) | [static] |
Returns jstring representation of the specified object.
obj | the object |
jstring JNIQSwingWrapper::newString | ( | const jchar * | uchars, | |
jsize | len | |||
) | [static] |
Creates new Java string.
uchars | the unicode char array | |
len | the length of the char array |
jstring JNIQSwingWrapper::newStringUTF | ( | const char * | bytes | ) | [static] |
Creates new Java string.
bytes | the UTF-8 char array |
bool JNIQSwingWrapper::callStaticVoidMethod | ( | jclass | cls, | |
jmethodID | methodID, | |||
va_list & | args | |||
) | [static] |
Calls JNI static void method.
cls | the java class | |
methodID | the method ID | |
args | the method arguments |
true
if no exception is thrown bool JNIQSwingWrapper::callStaticVoidMethod | ( | jclass | cls, | |
jmethodID | methodID, | |||
... | ||||
) | [static] |
Calls JNI static void method.
cls | the java class | |
methodID | the method ID | |
... | the method arguments |
true
if no exception is thrown jobject JNIQSwingWrapper::newObject | ( | jclass | cls, | |
jmethodID | constructor, | |||
va_list & | args | |||
) | [static] |
Creates and constructs new Java object.
cls | the object class | |
constructor | the class constructor | |
args | the constructor arguments |
jobject JNIQSwingWrapper::newObject | ( | jclass | cls, | |
jmethodID | constructor, | |||
... | ||||
) | [static] |
Creates and constructs new Java object.
cls | the object class | |
constructor | the class constructor | |
... | the constructor arguments |
jobjectArray JNIQSwingWrapper::newObjectArray | ( | jclass | cls, | |
jsize | len | |||
) | [static] |
Creates new java object array.
cls | the class of the array elements | |
len | the length of the array |
jbyteArray JNIQSwingWrapper::newByteArray | ( | jsize | len | ) | [static] |
Creates new java byte array.
len | the length of the array |
jobject JNIQSwingWrapper::newGlobalRef | ( | jobject | obj | ) | [static] |
Returns new Java global reference to the specified Java object.
obj | the Java object |
jweak JNIQSwingWrapper::newWeakGlobalRef | ( | jobject | obj | ) | [static] |
Returns new Java weak reference to the specified Java object.
obj | the Java object |
void JNIQSwingWrapper::deleteGlobalRef | ( | jobject & | objref | ) | [static] |
Deletes the Java reference.
objref | the Java reference |
void JNIQSwingWrapper::deleteWeakGlobalRef | ( | jweak & | wobjref | ) | [static] |
Deletes the Java weak reference.
wobjref | the Java weak reference |
bool JNIQSwingWrapper::isLiveRef | ( | jweak | wobjref | ) | [static] |
Returns true
if the specified weak reference is alive.
wobjref | the Java weak reference |
true
if the specified weak reference is alive