|
|
@ -27,7 +27,6 @@ package com.jme3.gde.core.scene; |
|
|
|
import com.jme3.app.Application; |
|
|
|
import com.jme3.app.Application; |
|
|
|
import com.jme3.app.StatsView; |
|
|
|
import com.jme3.app.StatsView; |
|
|
|
import com.jme3.asset.AssetManager; |
|
|
|
import com.jme3.asset.AssetManager; |
|
|
|
import com.jme3.audio.AudioContext; |
|
|
|
|
|
|
|
import com.jme3.bullet.BulletAppState; |
|
|
|
import com.jme3.bullet.BulletAppState; |
|
|
|
import com.jme3.font.BitmapFont; |
|
|
|
import com.jme3.font.BitmapFont; |
|
|
|
import com.jme3.font.BitmapText; |
|
|
|
import com.jme3.font.BitmapText; |
|
|
@ -70,8 +69,6 @@ import java.util.concurrent.Callable; |
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue; |
|
|
|
import java.util.concurrent.ConcurrentLinkedQueue; |
|
|
|
import java.util.logging.Level; |
|
|
|
import java.util.logging.Level; |
|
|
|
import java.util.logging.Logger; |
|
|
|
import java.util.logging.Logger; |
|
|
|
import org.netbeans.api.progress.ProgressHandle; |
|
|
|
|
|
|
|
import org.netbeans.api.progress.ProgressHandleFactory; |
|
|
|
|
|
|
|
import org.netbeans.spi.project.LookupProvider; |
|
|
|
import org.netbeans.spi.project.LookupProvider; |
|
|
|
import org.openide.DialogDisplayer; |
|
|
|
import org.openide.DialogDisplayer; |
|
|
|
import org.openide.NotifyDescriptor; |
|
|
|
import org.openide.NotifyDescriptor; |
|
|
@ -125,7 +122,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
private ScenePreviewProcessor previewProcessor; |
|
|
|
private ScenePreviewProcessor previewProcessor; |
|
|
|
private ApplicationLogHandler logHandler = new ApplicationLogHandler(); |
|
|
|
private ApplicationLogHandler logHandler = new ApplicationLogHandler(); |
|
|
|
private WireProcessor wireProcessor; |
|
|
|
private WireProcessor wireProcessor; |
|
|
|
private ProgressHandle progressHandle = ProgressHandleFactory.createHandle("Opening SceneViewer.."); |
|
|
|
|
|
|
|
private String lastError = ""; |
|
|
|
private String lastError = ""; |
|
|
|
private boolean started = false; |
|
|
|
private boolean started = false; |
|
|
|
private boolean initFailed = false; |
|
|
|
private boolean initFailed = false; |
|
|
@ -139,7 +135,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
|
|
|
|
|
|
|
|
public SceneApplication() { |
|
|
|
public SceneApplication() { |
|
|
|
Logger.getLogger("com.jme3").addHandler(logHandler); |
|
|
|
Logger.getLogger("com.jme3").addHandler(logHandler); |
|
|
|
progressHandle.start(7); |
|
|
|
|
|
|
|
useCanvas = "true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false")); |
|
|
|
useCanvas = "true".equals(NbPreferences.forModule(Installer.class).get("use_lwjgl_canvas", "false")); |
|
|
|
try { |
|
|
|
try { |
|
|
|
AppSettings newSetting = new AppSettings(true); |
|
|
|
AppSettings newSetting = new AppSettings(true); |
|
|
@ -158,7 +153,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
fakeApp = new FakeApplication(rootNode, guiNode, assetManager, cam); |
|
|
|
fakeApp = new FakeApplication(rootNode, guiNode, assetManager, cam); |
|
|
|
nodeSync = new NodeSyncAppState(); |
|
|
|
nodeSync = new NodeSyncAppState(); |
|
|
|
stateManager.attach(nodeSync); |
|
|
|
stateManager.attach(nodeSync); |
|
|
|
progressHandle.progress("initialize Base Application", 1); |
|
|
|
|
|
|
|
if (!useCanvas) { |
|
|
|
if (!useCanvas) { |
|
|
|
start(); |
|
|
|
start(); |
|
|
|
} |
|
|
|
} |
|
|
@ -167,7 +161,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
} catch (Error e) { |
|
|
|
} catch (Error e) { |
|
|
|
showStartupErrorMessage(e); |
|
|
|
showStartupErrorMessage(e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
getProgressHandle().finish(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -228,33 +221,26 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
overlayView.setClearFlags(false, true, false); |
|
|
|
overlayView.setClearFlags(false, true, false); |
|
|
|
guiViewPort.setClearFlags(false, false, false); |
|
|
|
guiViewPort.setClearFlags(false, false, false); |
|
|
|
} |
|
|
|
} |
|
|
|
getProgressHandle().progress("Setup Camera Controller", 2); |
|
|
|
|
|
|
|
//create camera controller
|
|
|
|
//create camera controller
|
|
|
|
camController = new SceneCameraController(cam, inputManager); |
|
|
|
camController = new SceneCameraController(cam, inputManager); |
|
|
|
//create preview view
|
|
|
|
//create preview view
|
|
|
|
getProgressHandle().progress("Setup Preview Scene", 3); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
previewProcessor = new ScenePreviewProcessor(); |
|
|
|
previewProcessor = new ScenePreviewProcessor(); |
|
|
|
previewProcessor.setupPreviewView(); |
|
|
|
previewProcessor.setupPreviewView(); |
|
|
|
|
|
|
|
|
|
|
|
getProgressHandle().progress("Prepare Camera", 4); |
|
|
|
|
|
|
|
camLight = new PointLight(); |
|
|
|
camLight = new PointLight(); |
|
|
|
camLight.setColor(ColorRGBA.White); |
|
|
|
camLight.setColor(ColorRGBA.White); |
|
|
|
|
|
|
|
|
|
|
|
getProgressHandle().progress("Prepare Stats View", 5); |
|
|
|
|
|
|
|
guiNode.setQueueBucket(Bucket.Gui); |
|
|
|
guiNode.setQueueBucket(Bucket.Gui); |
|
|
|
guiNode.setCullHint(CullHint.Never); |
|
|
|
guiNode.setCullHint(CullHint.Never); |
|
|
|
loadFPSText(); |
|
|
|
loadFPSText(); |
|
|
|
loadStatsView(); |
|
|
|
loadStatsView(); |
|
|
|
getProgressHandle().progress("Attach Scene to Viewport", 6); |
|
|
|
|
|
|
|
viewPort.attachScene(rootNode); |
|
|
|
viewPort.attachScene(rootNode); |
|
|
|
viewPort.attachScene(toolsNode); |
|
|
|
viewPort.attachScene(toolsNode); |
|
|
|
guiViewPort.attachScene(guiNode); |
|
|
|
guiViewPort.attachScene(guiNode); |
|
|
|
cam.setLocation(new Vector3f(0, 0, 10)); |
|
|
|
cam.setLocation(new Vector3f(0, 0, 10)); |
|
|
|
|
|
|
|
|
|
|
|
getProgressHandle().progress("Create", 6); |
|
|
|
|
|
|
|
wireProcessor = new WireProcessor(assetManager); |
|
|
|
wireProcessor = new WireProcessor(assetManager); |
|
|
|
getProgressHandle().finish(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inputManager.addMapping("MouseAxisX", new MouseAxisTrigger(MouseInput.AXIS_X, false)); |
|
|
|
inputManager.addMapping("MouseAxisX", new MouseAxisTrigger(MouseInput.AXIS_X, false)); |
|
|
|
inputManager.addMapping("MouseAxisY", new MouseAxisTrigger(MouseInput.AXIS_Y, false)); |
|
|
|
inputManager.addMapping("MouseAxisY", new MouseAxisTrigger(MouseInput.AXIS_Y, false)); |
|
|
@ -273,7 +259,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
fakeApp.stopFakeApp(); |
|
|
|
fakeApp.stopFakeApp(); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
getProgressHandle().finish(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -627,7 +612,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void handleError(String msg, Throwable t) { |
|
|
|
public void handleError(String msg, Throwable t) { |
|
|
|
progressHandle.finish(); |
|
|
|
|
|
|
|
if (msg == null) { |
|
|
|
if (msg == null) { |
|
|
|
msg = t.getMessage(); |
|
|
|
msg = t.getMessage(); |
|
|
|
} |
|
|
|
} |
|
|
@ -677,10 +661,6 @@ public class SceneApplication extends Application implements LookupProvider { |
|
|
|
return guiNode; |
|
|
|
return guiNode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ProgressHandle getProgressHandle() { |
|
|
|
|
|
|
|
return progressHandle; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractCameraController getActiveCameraController() { |
|
|
|
public AbstractCameraController getActiveCameraController() { |
|
|
|
return activeCamController; |
|
|
|
return activeCamController; |
|
|
|
} |
|
|
|
} |
|
|
|