From 3c9277277d91ba24006cb1dc336067a3a3f4bdf8 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 3 Feb 2013 02:26:09 +0000 Subject: [PATCH] SDK: - 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 --- .../core/assets/ExternalChangeScanner.java | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java index 28ac295c7..e3677a4d2 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/ExternalChangeScanner.java +++ b/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() { 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; } });