- Fix threading in SceneExplorer while opening scene

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8033 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 5cf01fcffe
commit c3b870fae3
  1. 7
      sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/SceneExplorerTopComponent.java

@ -266,16 +266,21 @@ public final class SceneExplorerTopComponent extends TopComponent implements Exp
public void sceneRequested(SceneRequest request) { public void sceneRequested(SceneRequest request) {
this.request = request; this.request = request;
JmeNode node = request.getJmeNode(); final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) { for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next(); MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners(); provider.clearMaterialChangeListeners();
} }
if (node != null) { if (node != null) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
explorerManager.setRootContext(node); explorerManager.setRootContext(node);
explorerManager.getRootContext().setDisplayName(node.getName()); explorerManager.getRootContext().setDisplayName(node.getName());
requestVisible(); requestVisible();
} }
});
}
} }
public boolean sceneClose(SceneRequest request) { public boolean sceneClose(SceneRequest request) {

Loading…
Cancel
Save