161
162 if (! isLocalSet) {
163 jclass geCls = (*env)->FindClass(env, "java/awt/GraphicsEnvironment");
164 CHECK_NULL_RETURN(geCls, JNI_FALSE);
165 jmethodID getLocalGE = (*env)->GetStaticMethodID(env, geCls,
166 "getLocalGraphicsEnvironment",
167 "()Ljava/awt/GraphicsEnvironment;");
168 CHECK_NULL_RETURN(getLocalGE, JNI_FALSE);
169 jobject ge = (*env)->CallStaticObjectMethod(env, geCls, getLocalGE);
170 JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
171
172 jclass sgeCls = (*env)->FindClass(env,
173 "sun/java2d/SunGraphicsEnvironment");
174 CHECK_NULL_RETURN(sgeCls, JNI_FALSE);
175 if ((*env)->IsInstanceOf(env, ge, sgeCls)) {
176 jmethodID isDisplayLocal = (*env)->GetMethodID(env, sgeCls,
177 "isDisplayLocal",
178 "()Z");
179 JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
180 isLocal = (*env)->CallBooleanMethod(env, ge, isDisplayLocal);
181 } else {
182 isLocal = True;
183 }
184 isLocalSet = True;
185 }
186
187 return isLocal;
188 }
189
190 static void AddFontsToX11FontPath ( fDirRecord *fDirP )
191 {
192 char *onePath;
193 int index, nPaths;
194 int origNumPaths, length;
195 int origIndex;
196 int totalDirCount;
197 char **origFontPath;
198 char **tempFontPath;
199 int doNotAppend;
200 int *appendDirList;
|
161
162 if (! isLocalSet) {
163 jclass geCls = (*env)->FindClass(env, "java/awt/GraphicsEnvironment");
164 CHECK_NULL_RETURN(geCls, JNI_FALSE);
165 jmethodID getLocalGE = (*env)->GetStaticMethodID(env, geCls,
166 "getLocalGraphicsEnvironment",
167 "()Ljava/awt/GraphicsEnvironment;");
168 CHECK_NULL_RETURN(getLocalGE, JNI_FALSE);
169 jobject ge = (*env)->CallStaticObjectMethod(env, geCls, getLocalGE);
170 JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
171
172 jclass sgeCls = (*env)->FindClass(env,
173 "sun/java2d/SunGraphicsEnvironment");
174 CHECK_NULL_RETURN(sgeCls, JNI_FALSE);
175 if ((*env)->IsInstanceOf(env, ge, sgeCls)) {
176 jmethodID isDisplayLocal = (*env)->GetMethodID(env, sgeCls,
177 "isDisplayLocal",
178 "()Z");
179 JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
180 isLocal = (*env)->CallBooleanMethod(env, ge, isDisplayLocal);
181 JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
182 } else {
183 isLocal = True;
184 }
185 isLocalSet = True;
186 }
187
188 return isLocal;
189 }
190
191 static void AddFontsToX11FontPath ( fDirRecord *fDirP )
192 {
193 char *onePath;
194 int index, nPaths;
195 int origNumPaths, length;
196 int origIndex;
197 int totalDirCount;
198 char **origFontPath;
199 char **tempFontPath;
200 int doNotAppend;
201 int *appendDirList;
|