From e9e61421ef6009e6788998c471d1d3d30aaefea6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 26 Mar 2012 15:16:34 +0200 Subject: Platform: Add AWT_AVAILABLE 'knowledge'; RunnableExecutor: Add AWTEDT impl. / API doc cleanup; DynamicLibraryBundle: Add getDefaultRunnableExecutor() --- src/java/com/jogamp/common/os/DynamicLibraryBundle.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/java/com/jogamp/common/os/DynamicLibraryBundle.java') diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java index efb6d89..b86a701 100755 --- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java +++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java @@ -33,7 +33,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; +import jogamp.common.awt.AWTEDTExecutor; + import com.jogamp.common.jvm.JNILibLoaderBase; +import com.jogamp.common.util.RunnableExecutor; /** * Provides bundling of:
@@ -69,6 +72,15 @@ public class DynamicLibraryBundle implements DynamicLookupHelper { private HashSet toolGetProcAddressFuncNameSet; private List toolGetProcAddressFuncNameList; + /** Returns an AWT-EDT {@link RunnableExecutor} implementation if AWT is available, otherwise {@link RunnableExecutor#currentThreadExecutor}. */ + public static RunnableExecutor getDefaultRunnableExecutor() { + if(Platform.AWT_AVAILABLE) { + return AWTEDTExecutor.singleton; + } else { + return RunnableExecutor.currentThreadExecutor; + } + } + /** Instantiates and loads all {@link NativeLibrary}s incl. JNI libraries. */ public DynamicLibraryBundle(DynamicLibraryBundleInfo info) { if(null==info) { -- cgit v1.2.3