From 37d994b1cf7a752382fc1471dd553706dadad73e Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Tue, 22 Nov 2011 16:14:29 +0000 Subject: [PATCH] SDK: - fix resolution change in NiftyGUI editor git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8773 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/gui/multiview/NiftyPreviewPanel.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/sdk/jme3-gui/src/com/jme3/gde/gui/multiview/NiftyPreviewPanel.java b/sdk/jme3-gui/src/com/jme3/gde/gui/multiview/NiftyPreviewPanel.java index 394346539..f9a0b515c 100644 --- a/sdk/jme3-gui/src/com/jme3/gde/gui/multiview/NiftyPreviewPanel.java +++ b/sdk/jme3-gui/src/com/jme3/gde/gui/multiview/NiftyPreviewPanel.java @@ -11,7 +11,6 @@ import com.jme3.gde.core.scene.SceneApplication; import com.jme3.gde.gui.NiftyGuiDataObject; import com.jme3.renderer.ViewPort; import de.lessvoid.nifty.Nifty; -import de.lessvoid.nifty.tools.resourceloader.FileSystemLocation; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -20,7 +19,6 @@ import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.concurrent.Callable; @@ -57,6 +55,7 @@ public class NiftyPreviewPanel extends PanelView { private NiftyPreviewInputHandler inputHandler; private NiftyJmeDisplay niftyDisplay; private JScrollPane scrollPanel; + private int width = 640, height = 480; public NiftyPreviewPanel(NiftyGuiDataObject niftyObject, ToolBarDesignEditor comp) { super(); @@ -78,8 +77,6 @@ public class NiftyPreviewPanel extends PanelView { public void itemStateChanged(ItemEvent e) { String string = (String) e.getItem(); - final int width; - final int height; if ("640x480".equals(string)) { width = 640; height = 480; @@ -110,7 +107,7 @@ public class NiftyPreviewPanel extends PanelView { return null; } }); - updatePreView(screen); +// updatePreView(); } }); toolBar.add(comboBox); @@ -260,6 +257,7 @@ public class NiftyPreviewPanel extends PanelView { @Override public void showSelection(Node[] nodes) { this.screen = nodes[0].getName(); + final String screen = this.screen; SceneApplication.getApplication().enqueue(new Callable() { public Object call() throws Exception { @@ -271,12 +269,13 @@ public class NiftyPreviewPanel extends PanelView { public void cleanup() { offPanel.stopPreview(); -// SceneApplication.getApplication().enqueue(new Callable() { -// -// public Object call() throws Exception { -// nifty.exit(); -// return null; -// } -// }); + SceneApplication.getApplication().enqueue(new Callable() { + + public Object call() throws Exception { + ViewPort guiViewPort = offPanel.getViewPort(); + guiViewPort.removeProcessor(niftyDisplay); + return null; + } + }); } }