package org.simantics.g3d.jme.system; import java.util.logging.Level; import com.jme3.app.Application; import com.jme3.system.AppSettings; import com.jme3.system.JmeContext; import com.jme3.system.JmeSystem; public class SWTApplication extends Application { SWTCanvas canvas; public SWTApplication(SWTCanvas canvas) { this.canvas = canvas; } 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); } }