/******************************************************************************* * 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 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); } }