diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetData.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetData.java index 24e70dda4..33710c3b4 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetData.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetData.java @@ -48,6 +48,7 @@ import org.openide.util.Exceptions; * * @author normenhansen */ +@SuppressWarnings("unchecked") public class AssetData extends Properties { private AssetDataObject file; @@ -82,6 +83,10 @@ public class AssetData extends Properties { return file.getAssetList(); } + public List getAssetKeyList(){ + return file.getAssetKeyList(); + } + public List getFailedList() { return file.getFailedList(); } diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java index 6381d0e1f..928a72555 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java @@ -96,6 +96,7 @@ public class AssetDataObject extends MultiDataObject { protected AbstractLookup contentLookup; protected AssetListListener listListener; protected List assetList = new LinkedList(); + protected List assetKeyList = new LinkedList(); protected List failedList = new LinkedList(); public AssetDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { @@ -103,7 +104,7 @@ public class AssetDataObject extends MultiDataObject { contentLookup = new AbstractLookup(getLookupContents()); lookupContents.add(new AssetData(this)); lookup = new ProxyLookup(getCookieSet().getLookup(), contentLookup); - listListener = new AssetListListener(this, assetList, failedList); + listListener = new AssetListListener(this, assetList, assetKeyList, failedList); setSaveCookie(saveCookie); findAssetManager(); } @@ -252,6 +253,10 @@ public class AssetDataObject extends MultiDataObject { return assetList; } + public List getAssetKeyList() { + return assetKeyList; + } + public List getFailedList() { return failedList; } @@ -260,12 +265,14 @@ public class AssetDataObject extends MultiDataObject { private AssetDataObject obj; private List assetList; + private List assetKeyList; private List failedList; private Thread loadingThread; - public AssetListListener(AssetDataObject obj, List assetList, List failedList) { + public AssetListListener(AssetDataObject obj, List assetList, List assetKeyList, List failedList) { this.obj = obj; this.assetList = assetList; + this.assetKeyList = assetKeyList; this.failedList = failedList; } @@ -280,6 +287,7 @@ public class AssetDataObject extends MultiDataObject { FileObject obj = pm.getAssetFolder().getFileObject(ak.getName()); if (obj != null) { assetList.add(obj); + assetKeyList.add(ak); } } @@ -299,6 +307,7 @@ public class AssetDataObject extends MultiDataObject { ProjectAssetManager pm = obj.getLookup().lookup(ProjectAssetManager.class); loadingThread = Thread.currentThread(); assetList.clear(); + assetKeyList.clear(); failedList.clear(); if (pm == null) { return; diff --git a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java index 3518c3dbd..f26b92e15 100644 --- a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java +++ b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java @@ -6,7 +6,6 @@ package com.jme3.gde.modelimporter; import com.jme3.asset.AssetKey; import com.jme3.asset.TextureKey; -import com.jme3.export.binary.BinaryExporter; import com.jme3.gde.core.assets.AssetData; import com.jme3.gde.core.assets.ProjectAssetManager; import com.jme3.gde.core.assets.SpatialAssetDataObject; diff --git a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java index 75b19cb96..b630bc1a4 100644 --- a/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java +++ b/sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java @@ -4,7 +4,6 @@ */ package com.jme3.gde.modelimporter; -import com.jme3.asset.AssetEventListener; import com.jme3.asset.AssetKey; import com.jme3.gde.core.assets.AssetData; import com.jme3.gde.core.assets.AssetDataObject; @@ -13,7 +12,6 @@ import com.jme3.gde.core.scene.OffScenePanel; import com.jme3.math.Vector3f; import com.jme3.scene.Spatial; import java.io.File; -import java.util.LinkedList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import javax.swing.JPanel; @@ -25,19 +23,20 @@ import org.openide.NotifyDescriptor.Message; import org.openide.WizardDescriptor; import org.openide.explorer.propertysheet.PropertySheet; import org.openide.filesystems.FileChooserBuilder; +import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; import org.openide.loaders.DataObject; import org.openide.nodes.Node; import org.openide.util.Exceptions; @SuppressWarnings({"unchecked", "serial"}) -public final class ModelImporterVisualPanel1 extends JPanel implements AssetEventListener { +public final class ModelImporterVisualPanel1 extends JPanel { private OffScenePanel offPanel; private String currentPath; private String currentModelPath; private Spatial currentModel; - private List requestedAssets = new LinkedList(); + private List keys; private AssetKey mainKey; private PropertySheet ps; private AtomicBoolean loading = new AtomicBoolean(false); @@ -64,7 +63,7 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven public void applySettings(WizardDescriptor wiz) { wiz.putProperty("path", currentPath); - wiz.putProperty("assetlist", requestedAssets); + wiz.putProperty("assetlist", keys); wiz.putProperty("mainkey", mainKey); if (mainKey != null) { wiz.putProperty("destpath", "Models/" + mainKey.getName().replaceAll(mainKey.getExtension(), "").replaceAll("\\.", "") + "/"); @@ -77,10 +76,9 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven public synchronized void loadModel(File path, AssetKey modelKey) { ProjectAssetManager manager = new ProjectAssetManager(FileUtil.toFileObject(path).getParent()); - manager.setAssetEventListener(this); try { if (modelKey != mainKey) { - requestedAssets.clear(); + keys = null; } if (currentModel != null) { offPanel.detach(currentModel); @@ -95,10 +93,12 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven ((AssetDataObject) obj).getLookupContents().add(manager); modelKey = data.getAssetKey(); currentModel = (Spatial) data.loadAsset(); + keys = data.getAssetKeyList(); } else { ((AssetDataObject) obj).getLookupContents().add(manager); data.setAssetKey(modelKey); currentModel = (Spatial) data.loadAsset(); + keys = data.getAssetKeyList(); } } mainKey = modelKey; @@ -137,23 +137,6 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven } - public void assetRequested(AssetKey ak) { - if (!"j3md".equalsIgnoreCase(ak.getExtension()) - && !"glsllib".equalsIgnoreCase(ak.getExtension()) - && !"frag".equalsIgnoreCase(ak.getExtension()) - && !"vert".equalsIgnoreCase(ak.getExtension())) { - if (!requestedAssets.contains(ak)) { - requestedAssets.add(ak); - } - } - } - - public void assetLoaded(AssetKey ak) { - } - - public void assetDependencyNotFound(AssetKey ak, AssetKey ak1) { - } - public void cleanup() { offPanel.stopPreview(); }