- display status bar in case of long external change updates 

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10324 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 4c8e1dedd8
commit 3c9277277d
  1. 20
      sdk/jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java

@ -40,6 +40,8 @@ import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.filesystems.FileAttributeEvent;
@ -94,11 +96,19 @@ public class ExternalChangeScanner implements AssetDataPropertyChangeListener, F
}
SceneApplication.getApplication().enqueue(new Callable<Void>() {
public Void call() throws Exception {
Spatial original = loadOriginalSpatial();
Spatial spat = (Spatial) assetDataObject.loadAsset();
SpatialUtil.updateMeshDataFromOriginal(spat, original);
closeOriginalSpatial();
assetDataObject.saveAsset();
ProgressHandle handle = ProgressHandleFactory.createHandle("Updating file data");
handle.start();
try {
Spatial original = loadOriginalSpatial();
Spatial spat = (Spatial) assetDataObject.loadAsset();
SpatialUtil.updateMeshDataFromOriginal(spat, original);
closeOriginalSpatial();
assetDataObject.saveAsset();
} catch (Exception e) {
logger.log(Level.SEVERE, "Exception when trying to update external data.", e);
} finally {
handle.finish();
}
return null;
}
});

Loading…
Cancel
Save