]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/threedee/WindowFactory.java
Moved source into separate src directory due to popular request
[GpsPrune.git] / tim / prune / threedee / WindowFactory.java
diff --git a/tim/prune/threedee/WindowFactory.java b/tim/prune/threedee/WindowFactory.java
deleted file mode 100644 (file)
index 42ff8a4..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-package tim.prune.threedee;
-
-import javax.swing.JFrame;
-
-/**
- * Factory class for getting a Window
- */
-public abstract class WindowFactory
-{
-       private static Java3DWindow _window = null;
-
-       /**
-        * Get a Window object
-        * @param inFrame parent frame
-        * @return object if available, otherwise null
-        */
-       public static ThreeDWindow getWindow(JFrame inFrame)
-       {
-               if (isJava3dEnabled())
-               {
-                       if (_window == null) {
-                               _window = new Java3DWindow(inFrame);
-                       }
-                       else {
-                               _window.dispose();
-                       }
-                       return _window;
-               }
-               return null;
-       }
-
-
-       /**
-        * @return true if 3d capability is installed
-        */
-       public static boolean isJava3dEnabled()
-       {
-               boolean has3d = false;
-               try
-               {
-                       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;
-       }
-
-}