package org.simantics.g3d.jme.system; import com.jme3.app.SimpleApplication; import com.jme3.system.AppSettings; import com.jme3.system.JmeContext; public abstract class SimpleSWTApplication extends SimpleApplication { SWTCanvas canvas; public SimpleSWTApplication(SWTCanvas canvas) { this.canvas = canvas; showSettings = false; } @Override public void setShowSettings(boolean showSettings) { } public void createCanvas(){ if (settings == null){ settings = new AppSettings(true); } context.setSystemListener(this); } public void start(JmeContext.Type contextType){ if (context != null && context.isCreated()){ //logger.warning("start() called when application already created!"); return; } if (settings == null){ settings = new AppSettings(true); } //logger.log(Level.FINE, "Starting application: {0}", getClass().getName()); context = canvas;//JmeSystem.newContext(settings, contextType); context.setSystemListener(this); context.create(false); } }