]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/threedee/WindowFactory.java
Version 6, October 2008
[GpsPrune.git] / tim / prune / threedee / WindowFactory.java
index 89560efa1b2b7e592c8c7dfa2412bc8bf4b72a23..4aef1f613a66fee384e49eaae0948bcdd720d658 100644 (file)
@@ -9,7 +9,7 @@ import tim.prune.App;
  */
 public abstract class WindowFactory
 {
-       private static ThreeDWindow _window = null;
+       private static Java3DWindow _window = null;
 
        /**
         * Get a Window object
@@ -21,7 +21,12 @@ public abstract class WindowFactory
        {
                if (isJava3dEnabled())
                {
-                       if (_window == null) _window = new Java3DWindow(inApp, inFrame);
+                       if (_window == null) {
+                               _window = new Java3DWindow(inApp, inFrame);
+                       }
+                       else {
+                               _window.dispose();
+                       }
                        return _window;
                }
                return null;
@@ -31,13 +36,13 @@ public abstract class WindowFactory
        /**
         * @return true if 3d capability is installed
         */
-       private static boolean isJava3dEnabled()
+       public static boolean isJava3dEnabled()
        {
                boolean has3d = false;
                try
                {
                        Class universeClass = Class.forName("com.sun.j3d.utils.universe.SimpleUniverse");
-                       has3d = true;
+                       has3d = (universeClass != null);
                }
                catch (ClassNotFoundException e)
                {