- improve FakeApplication and SceneApplication cleanup

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10105 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 733ad2fdbe
commit 20dce97f5d
  1. 12
      sdk/jme3-core/src/com/jme3/gde/core/scene/FakeApplication.java
  2. 5
      sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java

@ -394,14 +394,14 @@ public class FakeApplication extends SimpleApplication {
private ScheduledThreadPoolExecutor fakeAppThread = new ScheduledThreadPoolExecutor(1); private ScheduledThreadPoolExecutor fakeAppThread = new ScheduledThreadPoolExecutor(1);
public void cleanupFakeApp() { public void cleanupFakeApp() {
if (rootNode == null) { runQueuedFake();
return;
}
clearNode(rootNode);
appStateManager = new FakeAppStateManager(this); appStateManager = new FakeAppStateManager(this);
if (rootNode != null) {
clearNode(rootNode);
}
} }
public void startFakeApp(){ public void startFakeApp() {
fakeAppThread = new ScheduledThreadPoolExecutor(1); fakeAppThread = new ScheduledThreadPoolExecutor(1);
} }
@ -410,7 +410,7 @@ public class FakeApplication extends SimpleApplication {
fakeAppThread.shutdown(); fakeAppThread.shutdown();
} }
public void newAssetManager(AssetManager manager){ public void newAssetManager(AssetManager manager) {
this.assetManager = manager; this.assetManager = manager;
} }

@ -325,8 +325,6 @@ public class SceneApplication extends Application implements LookupProvider {
} }
} }
//TODO: Lookup for Application //TODO: Lookup for Application
public Lookup createAdditionalLookup(Lookup baseContext) { public Lookup createAdditionalLookup(Lookup baseContext) {
return Lookups.fixed(getApplication()); return Lookups.fixed(getApplication());
@ -477,7 +475,7 @@ public class SceneApplication extends Application implements LookupProvider {
} }
private void checkSave(SceneRequest request) { private void checkSave(SceneRequest request) {
if ((request != null) if ((request != null) && request.getDataObject() != null
&& request.getDataObject().isModified()) { && request.getDataObject().isModified()) {
final DataObject req = request.getDataObject(); final DataObject req = request.getDataObject();
Confirmation mesg = new NotifyDescriptor.Confirmation("Scene has not been saved,\ndo you want to save it?", Confirmation mesg = new NotifyDescriptor.Confirmation("Scene has not been saved,\ndo you want to save it?",
@ -658,5 +656,4 @@ public class SceneApplication extends Application implements LookupProvider {
public boolean isAwt() { public boolean isAwt() {
return java.awt.EventQueue.isDispatchThread(); return java.awt.EventQueue.isDispatchThread();
} }
} }

Loading…
Cancel
Save