JNIQSwingWrapper Class Reference

JNI QSwing Wrapper. More...

#include <JNIQSwingWrapper.h>

List of all members.

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


Detailed Description

JNI QSwing Wrapper.

Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)
Version:
0.2.0

Member Function Documentation

JNIEnv * JNIQSwingWrapper::env (  )  [inline, static]

Returns JNIEnv pointer.

Returns:
env JNIEnv pointer

bool JNIQSwingWrapper::isQSwingThread ( JNIEnv *  env  )  [inline, static]

Returns true if the specified JNIEnv pointer is same as sm_env.

Parameters:
env the JNIEnv pointer
Returns:
true if JNIEnv pointer env is same as sm_env

bool JNIQSwingWrapper::testException (  )  [static]

Test if an exception has occurred.

Returns:
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.

Parameters:
errorMessage the error message

void JNIQSwingWrapper::throwInternalError ( const char *  errorMessage = 0  )  [static]

Throws java's internal error.

Parameters:
errorMessage the error message

void JNIQSwingWrapper::throwOutOfMemoryError ( const char *  errorMessage = 0  )  [static]

Throws java's out of memory error.

Parameters:
errorMessage the error message

void JNIQSwingWrapper::throwRuntimeExcpetion ( const char *  exceptionMessage = 0  )  [static]

Throws java's runtime exception.

Parameters:
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.

Parameters:
cls the class
name the field name
sig the field signature
Returns:
the fieldID for an instance field of a class

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.

Parameters:
cls the class
name the field name
sig the field signature
Returns:
the field ID for a static field of a class or interface

jmethodID JNIQSwingWrapper::getMethodID ( jclass  cls,
const char *  name,
const char *  sig 
) [static]

Returns the methodID for an instance method of a class or interface.

Parameters:
cls the class
name the method name
sig the method signature
Returns:
the methodID for an instance method of a class or interface

jmethodID JNIQSwingWrapper::getStaticMethodID ( jclass  cls,
const char *  name,
const char *  sig 
) [static]

Returns the method ID for a static method of a class.

Parameters:
cls the class
name the method name
sig the method signature
Returns:
the method ID for a static method of a class

jobject JNIQSwingWrapper::getObjectField ( jobject  obj,
jfieldID  fieldID 
) [static]

Returns the value of the object field of the specified object.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the object field of the specified object

void JNIQSwingWrapper::setObjectField ( jobject  obj,
jfieldID  fieldID,
jobject  val 
) [static]

Sets the value of the object field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the boolean field of the specified object

void JNIQSwingWrapper::setBooleanField ( jobject  obj,
jfieldID  fieldID,
jboolean  val 
) [static]

Sets the value of the boolean field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the byte field of the specified object

void JNIQSwingWrapper::setByteField ( jobject  obj,
jfieldID  fieldID,
jbyte  val 
) [static]

Sets the value of the byte field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the char field of the specified object

void JNIQSwingWrapper::setCharField ( jobject  obj,
jfieldID  fieldID,
jchar  val 
) [static]

Sets the value of the char field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the short field of the specified object

void JNIQSwingWrapper::setShortField ( jobject  obj,
jfieldID  fieldID,
jshort  val 
) [static]

Sets the value of the short field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the int field of the specified object

void JNIQSwingWrapper::setIntField ( jobject  obj,
jfieldID  fieldID,
jint  val 
) [static]

Sets the value of the int field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the long field of the specified object

void JNIQSwingWrapper::setLongField ( jobject  obj,
jfieldID  fieldID,
jlong  val 
) [static]

Sets the value of the long field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the float field of the specified object

void JNIQSwingWrapper::setFloatField ( jobject  obj,
jfieldID  fieldID,
jfloat  val 
) [static]

Sets the value of the float field of the specified object.

Parameters:
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.

Parameters:
obj the object
fieldID the field ID
Returns:
the value of the double field of the specified object

void JNIQSwingWrapper::setDoubleField ( jobject  obj,
jfieldID  fieldID,
jdouble  val 
) [static]

Sets the value of the double field of the specified object.

Parameters:
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.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callObjectMethod ( jobject &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI object method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callBooleanMethod ( jboolean &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI boolean method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callBooleanMethod ( jboolean &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI boolean method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callByteMethod ( jbyte &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI byte method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callByteMethod ( jbyte &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI byte method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callCharMethod ( jchar &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI char method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callCharMethod ( jchar &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI char method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callShortMethod ( jshort &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI short method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callShortMethod ( jshort &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI short method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callIntMethod ( jint &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI int method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callIntMethod ( jint &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI int method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callLongMethod ( jlong &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI long method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callLongMethod ( jlong &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI long method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callFloatMethod ( jfloat &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI float method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callFloatMethod ( jfloat &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI float method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callDoubleMethod ( jdouble &  result,
jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI double method.

Parameters:
result the result
obj the jobject
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callDoubleMethod ( jdouble &  result,
jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI double method.

Parameters:
result the result
obj the jobject
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callVoidMethod ( jobject  obj,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI void method.

Parameters:
obj the java object
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callVoidMethod ( jobject  obj,
jmethodID  methodID,
  ... 
) [static]

Calls JNI void method.

Parameters:
obj the java object
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

jstring JNIQSwingWrapper::toString ( jobject  obj  )  [static]

Returns jstring representation of the specified object.

Parameters:
obj the object
Returns:
jstring representation of the specified object

jstring JNIQSwingWrapper::newString ( const jchar *  uchars,
jsize  len 
) [static]

Creates new Java string.

Parameters:
uchars the unicode char array
len the length of the char array
Returns:
new Java string object

jstring JNIQSwingWrapper::newStringUTF ( const char *  bytes  )  [static]

Creates new Java string.

Parameters:
bytes the UTF-8 char array
Returns:
new Java string object

bool JNIQSwingWrapper::callStaticVoidMethod ( jclass  cls,
jmethodID  methodID,
va_list &  args 
) [static]

Calls JNI static void method.

Parameters:
cls the java class
methodID the method ID
args the method arguments
Returns:
true if no exception is thrown

bool JNIQSwingWrapper::callStaticVoidMethod ( jclass  cls,
jmethodID  methodID,
  ... 
) [static]

Calls JNI static void method.

Parameters:
cls the java class
methodID the method ID
... the method arguments
Returns:
true if no exception is thrown

jobject JNIQSwingWrapper::newObject ( jclass  cls,
jmethodID  constructor,
va_list &  args 
) [static]

Creates and constructs new Java object.

Parameters:
cls the object class
constructor the class constructor
args the constructor arguments
Returns:
new Java object

jobject JNIQSwingWrapper::newObject ( jclass  cls,
jmethodID  constructor,
  ... 
) [static]

Creates and constructs new Java object.

Parameters:
cls the object class
constructor the class constructor
... the constructor arguments
Returns:
new Java object

jobjectArray JNIQSwingWrapper::newObjectArray ( jclass  cls,
jsize  len 
) [static]

Creates new java object array.

Parameters:
cls the class of the array elements
len the length of the array
Returns:
the java object array

jbyteArray JNIQSwingWrapper::newByteArray ( jsize  len  )  [static]

Creates new java byte array.

Parameters:
len the length of the array
Returns:
the java byte array

jobject JNIQSwingWrapper::newGlobalRef ( jobject  obj  )  [static]

Returns new Java global reference to the specified Java object.

Parameters:
obj the Java object
Returns:
new Java global reference to the specified Java object

jweak JNIQSwingWrapper::newWeakGlobalRef ( jobject  obj  )  [static]

Returns new Java weak reference to the specified Java object.

Parameters:
obj the Java object
Returns:
new Java weak reference to the specified Java object

void JNIQSwingWrapper::deleteGlobalRef ( jobject &  objref  )  [static]

Deletes the Java reference.

Parameters:
objref the Java reference

void JNIQSwingWrapper::deleteWeakGlobalRef ( jweak &  wobjref  )  [static]

Deletes the Java weak reference.

Parameters:
wobjref the Java weak reference

bool JNIQSwingWrapper::isLiveRef ( jweak  wobjref  )  [static]

Returns true if the specified weak reference is alive.

Parameters:
wobjref the Java weak reference
Returns:
true if the specified weak reference is alive


Copyright © 2007 ETF and contributors. All Rights Reserved.