- remove invokeLater from TerrainEditor
- add isOgl() and isAwt() for asserting threading to SceneApplication

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8622 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 10ce82f423
commit 818a8bdaab
  1. 13
      sdk/jme3-core/src/com/jme3/gde/core/scene/SceneApplication.java
  2. 7
      sdk/jme3-terrain-editor/src/com/jme3/gde/terraineditor/TerrainEditorTopComponent.java

@ -75,8 +75,7 @@ import org.openide.util.NbPreferences;
import org.openide.util.lookup.Lookups;
/**
* <p/> <p/> <p/> <p/>
* <p/>
*
* @author normenhansen
*/
@SuppressWarnings("unchecked")
@ -115,6 +114,7 @@ public class SceneApplication extends Application implements LookupProvider {
private ViewPort overlayView;
boolean useCanvas = false;
private BulletAppState physicsState;
private Thread thread;
public SceneApplication() {
progressHandle.start(7);
@ -200,6 +200,7 @@ public class SceneApplication extends Application implements LookupProvider {
@Override
public void initialize() {
thread = Thread.currentThread();
try {
super.initialize();
{
@ -600,4 +601,12 @@ public class SceneApplication extends Application implements LookupProvider {
public void setActiveCameraController(AbstractCameraController activeCamController) {
this.activeCamController = activeCamController;
}
public boolean isOgl() {
return Thread.currentThread() == thread;
}
public boolean isAwt() {
return java.awt.EventQueue.isDispatchThread();
}
}

@ -1087,9 +1087,6 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
private void setSceneInfo(final JmeNode jmeNode, final boolean active) {
final TerrainEditorTopComponent inst = this;
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if (jmeNode != null) {
} else {
}
@ -1102,17 +1099,13 @@ public final class TerrainEditorTopComponent extends TopComponent implements Sce
requestActive();
}
}
});
}
public void sceneClosed(SceneRequest request) {
if (request.equals(currentRequest)) {
// if (checkSaved()) {
SceneApplication.getApplication().removeSceneListener(this);
setSceneInfo(null, false);
currentRequest = null;
cleanupControllers();
// }
}
}

Loading…
Cancel
Save