- add workaround for previews (SceneViewer opens when preview is needed)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7134 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent e4cc9d1482
commit 67adc1737c
  1. 9
      sdk/jme3-core/src/com/jme3/gde/core/scene/OffScenePanel.java
  2. 6
      sdk/jme3-materialeditor/src/com/jme3/gde/materials/multiview/MaterialOpenSupport.java
  3. 3
      sdk/jme3-model-importer/src/com/jme3/gde/modelimporter/ModelImporterVisualPanel1.java

@ -37,6 +37,7 @@
*/
package com.jme3.gde.core.scene;
import com.jme3.gde.core.sceneviewer.SceneViewerTopComponent;
import com.jme3.light.PointLight;
import com.jme3.math.ColorRGBA;
import com.jme3.math.FastMath;
@ -125,6 +126,14 @@ public class OffScenePanel extends javax.swing.JPanel implements SceneProcessor
}
public void startPreview() {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
if(!SceneViewerTopComponent.findInstance().isOpened()){
SceneViewerTopComponent.findInstance().open();
}
}
});
SceneApplication.getApplication().enqueue(new Callable<Object>() {
public Object call() throws Exception {

@ -2,9 +2,9 @@
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.jme3.gde.materials.multiview;
import com.jme3.gde.core.sceneviewer.SceneViewerTopComponent;
import com.jme3.gde.materials.JMEMaterialDataObject;
import org.openide.cookies.CloseCookie;
import org.openide.cookies.OpenCookie;
@ -22,9 +22,11 @@ public class MaterialOpenSupport extends OpenSupport implements OpenCookie, Clos
}
protected CloneableTopComponent createCloneableTopComponent() {
if (!SceneViewerTopComponent.findInstance().isOpened()) {
SceneViewerTopComponent.findInstance().open();
}
JMEMaterialDataObject dobj = (JMEMaterialDataObject) entry.getDataObject();
MaterialEditorTopComponent tc = new MaterialEditorTopComponent(dobj);
return tc;
}
}

@ -77,7 +77,7 @@ public final class ModelImporterVisualPanel1 extends JPanel implements AssetEven
currentModel = (Spatial) manager.loadAsset(mainKey);
if (currentModel != null) {
offPanel.attach(currentModel);
}else{
} else {
Message msg = new NotifyDescriptor.Message(
"Cannot import this file!",
NotifyDescriptor.ERROR_MESSAGE);
@ -104,6 +104,7 @@ 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())) {
requestedAssets.add(ak);

Loading…
Cancel
Save