/******************************************************************************* * Copyright (c) 2012, 2013 Association for Decentralized Information Management in * Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ 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); } }