- commit ideal version of window handling (not working atm)
- Application calls createCanvas() and startCanvas(true) - SceneViewer window calls panel.add(getCanvas()) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7085 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
beeb32c9d4
commit
14bde37391
@ -126,9 +126,20 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|||||||
nodeSelectionResult.addLookupListener(this);
|
nodeSelectionResult.addLookupListener(this);
|
||||||
|
|
||||||
createCanvas();
|
createCanvas();
|
||||||
|
startCanvas(true);
|
||||||
getContext().setAutoFlushFrames(true);
|
getContext().setAutoFlushFrames(true);
|
||||||
getContext().setSystemListener(this);
|
getContext().setSystemListener(this);
|
||||||
progressHandle.progress("initialize Base Application", 1);
|
progressHandle.progress("initialize Base Application", 1);
|
||||||
|
// if (!java.awt.EventQueue.isDispatchThread()) {
|
||||||
|
// java.awt.EventQueue.invokeAndWait(new Runnable() {
|
||||||
|
//
|
||||||
|
// public void run() {
|
||||||
|
// SceneViewerTopComponent.findInstance();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// SceneViewerTopComponent.findInstance();
|
||||||
|
// }
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
getProgressHandle().finish();
|
getProgressHandle().finish();
|
||||||
SceneViewerTopComponent.showOpenGLError(e.toString());
|
SceneViewerTopComponent.showOpenGLError(e.toString());
|
||||||
@ -488,6 +499,9 @@ public class SceneApplication extends Application implements LookupProvider, Loo
|
|||||||
@Override
|
@Override
|
||||||
public void handleError(String msg, Throwable t) {
|
public void handleError(String msg, Throwable t) {
|
||||||
progressHandle.finish();
|
progressHandle.finish();
|
||||||
|
if (msg == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!started) {
|
if (!started) {
|
||||||
SceneViewerTopComponent.showOpenGLError(msg);
|
SceneViewerTopComponent.showOpenGLError(msg);
|
||||||
Exceptions.printStackTrace(t);
|
Exceptions.printStackTrace(t);
|
||||||
|
@ -58,10 +58,10 @@ public final class SceneViewerTopComponent extends TopComponent {
|
|||||||
/** path to the icon used by the component and its open action */
|
/** path to the icon used by the component and its open action */
|
||||||
static final String ICON_PATH = "com/jme3/gde/core/sceneviewer/jme-logo.png";
|
static final String ICON_PATH = "com/jme3/gde/core/sceneviewer/jme-logo.png";
|
||||||
private static final String PREFERRED_ID = "SceneViewerTopComponent";
|
private static final String PREFERRED_ID = "SceneViewerTopComponent";
|
||||||
private JmeCanvasContext ctx;
|
// private JmeCanvasContext ctx;
|
||||||
private SceneApplication app;
|
private SceneApplication app;
|
||||||
private Lookup lookup;
|
// private Lookup lookup;
|
||||||
private final InstanceContent lookupContents = new InstanceContent();
|
// private final InstanceContent lookupContents = new InstanceContent();
|
||||||
private HelpCtx helpContext = new HelpCtx("com.jme3.gde.core.sceneviewer");
|
private HelpCtx helpContext = new HelpCtx("com.jme3.gde.core.sceneviewer");
|
||||||
|
|
||||||
public SceneViewerTopComponent() {
|
public SceneViewerTopComponent() {
|
||||||
@ -75,6 +75,8 @@ public final class SceneViewerTopComponent extends TopComponent {
|
|||||||
// putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
|
// putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE);
|
||||||
try {
|
try {
|
||||||
app = SceneApplication.getApplication();
|
app = SceneApplication.getApplication();
|
||||||
|
// app.createCanvas();
|
||||||
|
// app.startCanvas(true);
|
||||||
oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
|
oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
showOpenGLError(e.toString());
|
showOpenGLError(e.toString());
|
||||||
@ -233,7 +235,8 @@ public final class SceneViewerTopComponent extends TopComponent {
|
|||||||
public void componentOpened() {
|
public void componentOpened() {
|
||||||
super.componentOpened();
|
super.componentOpened();
|
||||||
try {
|
try {
|
||||||
oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
|
// app.startCanvas(true);
|
||||||
|
// oGLPanel.add(((JmeCanvasContext) app.getContext()).getCanvas());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
showOpenGLError(e.toString());
|
showOpenGLError(e.toString());
|
||||||
} catch (Error err) {
|
} catch (Error err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user