- fix ModelImportTool not displaying model when going back in wizard

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10183 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 12 years ago
parent 97558ab94f
commit 0a1356a7bd
  1. 1
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ImportModel.java
  2. 17
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel3.java
  3. 3
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterWizardPanel3.java

@ -84,7 +84,6 @@ public final class ImportModel implements ActionListener {
dialog.setVisible(true);
dialog.toFront();
boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION;
((ModelImporterWizardPanel3) panels[1]).cleanup();
if (!cancelled) {
new Thread(new Runnable() {
public void run() {

@ -11,6 +11,8 @@ import com.jme3.gde.core.scene.OffScenePanel;
import com.jme3.math.Vector3f;
import com.jme3.scene.Spatial;
import java.util.List;
import java.util.logging.Logger;
import java.util.logging.Level;
import javax.swing.JPanel;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
@ -21,6 +23,7 @@ import org.openide.util.Exceptions;
@SuppressWarnings({"unchecked", "serial"})
public final class ModelImporterVisualPanel3 extends JPanel {
private static final Logger logger = Logger.getLogger(ModelImporterVisualPanel3.class.getName());
private ModelImporterWizardPanel3 panel;
private OffScenePanel offPanel;
private ProjectAssetManager manager;
@ -38,7 +41,6 @@ public final class ModelImporterVisualPanel3 extends JPanel {
initComponents();
this.panel = panel;
offPanel = new OffScenePanel(320, 320);
offPanel.startPreview();
jPanel1.add(offPanel);
}
@ -48,6 +50,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
}
public void loadSettings(WizardDescriptor wiz) {
offPanel.startPreview();
jList1.setListData(new Object[0]);
jList2.setListData(new Object[0]);
manager = (ProjectAssetManager) wiz.getProperty("manager");
@ -58,8 +61,9 @@ public final class ModelImporterVisualPanel3 extends JPanel {
failedKeys = null;
loadModel(mainKey);
if (currentModel != null) {
logger.log(Level.INFO, "Attaching model {0}", currentModel);
offPanel.attach(currentModel);
}else{
} else {
jList2.setListData(new Object[]{mainKey});
}
}
@ -70,21 +74,16 @@ public final class ModelImporterVisualPanel3 extends JPanel {
wiz.putProperty("failedlist", failedKeys);
wiz.putProperty("model", currentModel);
if (currentModel != null) {
logger.log(Level.INFO, "Detaching model {0}", currentModel);
offPanel.detach(currentModel);
}
offPanel.stopPreview();
}
public boolean checkValid() {
return currentModel != null;
}
public void cleanup() {
if (currentModel != null) {
offPanel.detach(currentModel);
}
offPanel.stopPreview();
}
public synchronized void loadModel(AssetKey modelKey) {
try {
currentModel = (Spatial) data.loadAsset();

@ -85,7 +85,4 @@ public class ModelImporterWizardPanel3 implements WizardDescriptor.Panel {
component.applySettings((WizardDescriptor) settings);
}
public void cleanup() {
component.cleanup();
}
}

Loading…
Cancel
Save