SDK:
- 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
This commit is contained in:
parent
97558ab94f
commit
0a1356a7bd
@ -84,7 +84,6 @@ public final class ImportModel implements ActionListener {
|
|||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
dialog.toFront();
|
dialog.toFront();
|
||||||
boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION;
|
boolean cancelled = wiz.getValue() != WizardDescriptor.FINISH_OPTION;
|
||||||
((ModelImporterWizardPanel3) panels[1]).cleanup();
|
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -11,6 +11,8 @@ import com.jme3.gde.core.scene.OffScenePanel;
|
|||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.scene.Spatial;
|
import com.jme3.scene.Spatial;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import java.util.logging.Level;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import org.openide.DialogDisplayer;
|
import org.openide.DialogDisplayer;
|
||||||
import org.openide.NotifyDescriptor;
|
import org.openide.NotifyDescriptor;
|
||||||
@ -21,6 +23,7 @@ import org.openide.util.Exceptions;
|
|||||||
@SuppressWarnings({"unchecked", "serial"})
|
@SuppressWarnings({"unchecked", "serial"})
|
||||||
public final class ModelImporterVisualPanel3 extends JPanel {
|
public final class ModelImporterVisualPanel3 extends JPanel {
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(ModelImporterVisualPanel3.class.getName());
|
||||||
private ModelImporterWizardPanel3 panel;
|
private ModelImporterWizardPanel3 panel;
|
||||||
private OffScenePanel offPanel;
|
private OffScenePanel offPanel;
|
||||||
private ProjectAssetManager manager;
|
private ProjectAssetManager manager;
|
||||||
@ -38,7 +41,6 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
initComponents();
|
initComponents();
|
||||||
this.panel = panel;
|
this.panel = panel;
|
||||||
offPanel = new OffScenePanel(320, 320);
|
offPanel = new OffScenePanel(320, 320);
|
||||||
offPanel.startPreview();
|
|
||||||
jPanel1.add(offPanel);
|
jPanel1.add(offPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +50,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadSettings(WizardDescriptor wiz) {
|
public void loadSettings(WizardDescriptor wiz) {
|
||||||
|
offPanel.startPreview();
|
||||||
jList1.setListData(new Object[0]);
|
jList1.setListData(new Object[0]);
|
||||||
jList2.setListData(new Object[0]);
|
jList2.setListData(new Object[0]);
|
||||||
manager = (ProjectAssetManager) wiz.getProperty("manager");
|
manager = (ProjectAssetManager) wiz.getProperty("manager");
|
||||||
@ -58,6 +61,7 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
failedKeys = null;
|
failedKeys = null;
|
||||||
loadModel(mainKey);
|
loadModel(mainKey);
|
||||||
if (currentModel != null) {
|
if (currentModel != null) {
|
||||||
|
logger.log(Level.INFO, "Attaching model {0}", currentModel);
|
||||||
offPanel.attach(currentModel);
|
offPanel.attach(currentModel);
|
||||||
} else {
|
} else {
|
||||||
jList2.setListData(new Object[]{mainKey});
|
jList2.setListData(new Object[]{mainKey});
|
||||||
@ -70,21 +74,16 @@ public final class ModelImporterVisualPanel3 extends JPanel {
|
|||||||
wiz.putProperty("failedlist", failedKeys);
|
wiz.putProperty("failedlist", failedKeys);
|
||||||
wiz.putProperty("model", currentModel);
|
wiz.putProperty("model", currentModel);
|
||||||
if (currentModel != null) {
|
if (currentModel != null) {
|
||||||
|
logger.log(Level.INFO, "Detaching model {0}", currentModel);
|
||||||
offPanel.detach(currentModel);
|
offPanel.detach(currentModel);
|
||||||
}
|
}
|
||||||
|
offPanel.stopPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean checkValid() {
|
public boolean checkValid() {
|
||||||
return currentModel != null;
|
return currentModel != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanup() {
|
|
||||||
if (currentModel != null) {
|
|
||||||
offPanel.detach(currentModel);
|
|
||||||
}
|
|
||||||
offPanel.stopPreview();
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void loadModel(AssetKey modelKey) {
|
public synchronized void loadModel(AssetKey modelKey) {
|
||||||
try {
|
try {
|
||||||
currentModel = (Spatial) data.loadAsset();
|
currentModel = (Spatial) data.loadAsset();
|
||||||
|
@ -85,7 +85,4 @@ public class ModelImporterWizardPanel3 implements WizardDescriptor.Panel {
|
|||||||
component.applySettings((WizardDescriptor) settings);
|
component.applySettings((WizardDescriptor) settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void cleanup() {
|
|
||||||
component.cleanup();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user