]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/threedee/WindowFactory.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / threedee / WindowFactory.java
index 4aef1f613a66fee384e49eaae0948bcdd720d658..42ff8a46b906c3030903eb0064ca6a5eac31f4c4 100644 (file)
@@ -2,8 +2,6 @@ package tim.prune.threedee;
 
 import javax.swing.JFrame;
 
-import tim.prune.App;
-
 /**
  * Factory class for getting a Window
  */
@@ -13,16 +11,15 @@ public abstract class WindowFactory
 
        /**
         * Get a Window object
-        * @param inApp App object
         * @param inFrame parent frame
         * @return object if available, otherwise null
         */
-       public static ThreeDWindow getWindow(App inApp, JFrame inFrame)
+       public static ThreeDWindow getWindow(JFrame inFrame)
        {
                if (isJava3dEnabled())
                {
                        if (_window == null) {
-                               _window = new Java3DWindow(inApp, inFrame);
+                               _window = new Java3DWindow(inFrame);
                        }
                        else {
                                _window.dispose();
@@ -41,13 +38,21 @@ public abstract class WindowFactory
                boolean has3d = false;
                try
                {
-                       Class universeClass = Class.forName("com.sun.j3d.utils.universe.SimpleUniverse");
+                       Class<?> universeClass = Class.forName("com.sun.j3d.utils.universe.SimpleUniverse");
                        has3d = (universeClass != null);
                }
                catch (ClassNotFoundException e)
                {
                        // no java3d classes available
                }
+               catch (NoClassDefFoundError nfe)
+               {
+                       // no java3d classes available
+               }
+               catch (UnsatisfiedLinkError ule)
+               {
+                       // java3d classes found but no native components
+               }
                return has3d;
        }