X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fthreedee%2FWindowFactory.java;h=42ff8a46b906c3030903eb0064ca6a5eac31f4c4;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=5a926b76f5d569156acb729b1aca3a25ae94241c;hpb=5625a1abadb5f2ca5f017fe7dbda1d5141cb637b;p=GpsPrune.git diff --git a/tim/prune/threedee/WindowFactory.java b/tim/prune/threedee/WindowFactory.java index 5a926b7..42ff8a4 100644 --- a/tim/prune/threedee/WindowFactory.java +++ b/tim/prune/threedee/WindowFactory.java @@ -2,26 +2,28 @@ package tim.prune.threedee; import javax.swing.JFrame; -import tim.prune.App; - /** * Factory class for getting a Window */ public abstract class WindowFactory { - private static ThreeDWindow _window = null; + private static Java3DWindow _window = null; /** * 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); + if (_window == null) { + _window = new Java3DWindow(inFrame); + } + else { + _window.dispose(); + } return _window; } return null; @@ -36,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; }