Commit 77549fb1 authored by Robert Smith's avatar Robert Smith
Browse files

Removed JME3 dependencies



Removed all dependencies on com.jme3.* from non-jme3 ICE bundles.
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parent 6b901de3
......@@ -4,8 +4,7 @@ Bundle-Name: ICE Moose Widgets
Bundle-SymbolicName: org.eclipse.ice.client.widgets.moose;singleton:=true
Bundle-Version: 2.1.8
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: com.jme3.math,
org.apache.commons.io;version="2.0.1",
Import-Package: org.apache.commons.io;version="2.0.1",
org.eclipse.cdt.core,
org.eclipse.cdt.core.model,
org.eclipse.cdt.core.model.util,
......
......@@ -6,109 +6,7 @@ Bundle-Version: 2.1.8
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.eclipse.ice.client.widgets.jme,
org.eclipse.ice.client.widgets.reactoreditor.plant
Import-Package: com.jme3.animation,
com.jme3.app,
com.jme3.app.state,
com.jme3.asset,
com.jme3.asset.cache,
com.jme3.asset.plugins,
com.jme3.audio,
com.jme3.audio.lwjgl,
com.jme3.audio.plugins,
com.jme3.bounding,
com.jme3.bullet,
com.jme3.bullet.collision,
com.jme3.bullet.collision.shapes,
com.jme3.bullet.collision.shapes.infos,
com.jme3.bullet.control,
com.jme3.bullet.control.ragdoll,
com.jme3.bullet.debug,
com.jme3.bullet.joints,
com.jme3.bullet.joints.motors,
com.jme3.bullet.objects,
com.jme3.bullet.objects.infos,
com.jme3.bullet.util,
com.jme3.cinematic,
com.jme3.cinematic.events,
com.jme3.collision,
com.jme3.collision.bih,
com.jme3.cursors.plugins,
com.jme3.effect,
com.jme3.effect.influencers,
com.jme3.effect.shapes,
com.jme3.export,
com.jme3.export.binary,
com.jme3.export.xml,
com.jme3.font,
com.jme3.font.plugins,
com.jme3.input,
com.jme3.input.awt,
com.jme3.input.controls,
com.jme3.input.dummy,
com.jme3.input.event,
com.jme3.input.lwjgl,
com.jme3.light,
com.jme3.material,
com.jme3.material.plugins,
com.jme3.math,
com.jme3.post,
com.jme3.post.filters,
com.jme3.post.ssao,
com.jme3.renderer,
com.jme3.renderer.lwjgl,
com.jme3.renderer.queue,
com.jme3.scene,
com.jme3.scene.control,
com.jme3.scene.debug,
com.jme3.scene.mesh,
com.jme3.scene.plugins,
com.jme3.scene.plugins.blender,
com.jme3.scene.plugins.blender.animations,
com.jme3.scene.plugins.blender.cameras,
com.jme3.scene.plugins.blender.constraints,
com.jme3.scene.plugins.blender.constraints.definitions,
com.jme3.scene.plugins.blender.curves,
com.jme3.scene.plugins.blender.file,
com.jme3.scene.plugins.blender.lights,
com.jme3.scene.plugins.blender.materials,
com.jme3.scene.plugins.blender.meshes,
com.jme3.scene.plugins.blender.modifiers,
com.jme3.scene.plugins.blender.objects,
com.jme3.scene.plugins.blender.particles,
com.jme3.scene.plugins.blender.textures,
com.jme3.scene.plugins.blender.textures.blending,
com.jme3.scene.plugins.blender.textures.generating,
com.jme3.scene.plugins.blender.textures.io,
com.jme3.scene.plugins.ogre,
com.jme3.scene.plugins.ogre.matext,
com.jme3.scene.shape,
com.jme3.shader,
com.jme3.shader.plugins,
com.jme3.shadow,
com.jme3.system,
com.jme3.system.awt,
com.jme3.system.lwjgl,
com.jme3.terrain,
com.jme3.terrain.geomipmap,
com.jme3.terrain.geomipmap.grid,
com.jme3.terrain.geomipmap.lodcalc,
com.jme3.terrain.geomipmap.lodcalc.util,
com.jme3.terrain.geomipmap.picking,
com.jme3.terrain.heightmap,
com.jme3.terrain.noise,
com.jme3.terrain.noise.basis,
com.jme3.terrain.noise.filter,
com.jme3.terrain.noise.fractal,
com.jme3.terrain.noise.modulator,
com.jme3.texture,
com.jme3.texture.image,
com.jme3.texture.plugins,
com.jme3.ui,
com.jme3.util,
com.jme3.util.blockparser,
com.jme3.util.xml,
com.jme3.water,
org.eclipse.core.resources,
Import-Package: org.eclipse.core.resources,
org.eclipse.core.runtime;version="3.4.0",
org.eclipse.core.runtime.jobs,
org.eclipse.ice.datastructures.ICEObject,
......
/*******************************************************************************
* Copyright (c) 2014 UT-Battelle, LLC.
* 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:
* Jordan Deyton (UT-Battelle, LLC.) - initial API and implementation and/or
* initial documentation
*
*******************************************************************************/
package org.eclipse.ice.client.widgets.jme;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.ice.datastructures.ICEObject.ICEObject;
import org.eclipse.ice.datastructures.ICEObject.IUpdateable;
import org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;
import org.eclipse.ice.viz.service.jme3.application.IRenderQueue;
import org.eclipse.ice.viz.service.jme3.widgets.AbstractView;
import com.jme3.scene.Node;
/**
* This class provides a base implementation for a controller that manages an
* {@link IUpdateable} model and an {@link AbstractView} associated with that
* model. It ensures that changes to the model or features provided by the
* controller itself are synchronized with the view through the parent
* SimpleApplication's simpleUpdate() thread.
*
* @author Jordan Deyton
*
*/
public abstract class AbstractController implements IUpdateableListener {
/*
* Note: We previously had an IControllerListener interface whereby objects
* could listen for changes to an AbstractController. If this interface is
* required for future work, this package (widgets.jme) and the plant
* package (widgets.reactoreditor.plant) should be selectively reverted to
* restore IControllerListener, AbstractController, and PipeController to
* their state before 20140903-1600. Also note that this change was
* committed to the branch.
*/
/**
* The model for which this controller provides a view.
*/
protected final IUpdateable model;
/**
* The {@link AbstractView} associated with this controller.
*/
private final AbstractView view;
/**
* The queue responsible for tasks that need to be performed on the jME
* rendering thread.
*/
protected final IRenderQueue renderQueue;
/**
* Whether or not the controller and its view have been disposed.
*/
protected final AtomicBoolean disposed;
// ---- Base Features ---- //
/**
* The current parent node for the {@link #view}.
*/
private Node parentNode;
// ----------------------- //
/**
* The default constructor. If any arguments are invalid (null), an
* {@link IllegalArgumentException} is thrown.
*
* @param model
* The model for which this controller provides a view.
* @param view
* The view associated with this controller. This needs to be
* instantiated by the sub-class.
* @param renderQueue
* The queue responsible for tasks that need to be performed on
* the jME rendering thread.
*/
public AbstractController(IUpdateable model, AbstractView view,
IRenderQueue renderQueue) {
// Set the model and register with it. It should not be null.
this.model = (model != null ? model : new ICEObject());
this.model.register(this);
// Set the view. If it is null, create a new, basic view.
this.view = (view != null ? view : new AbstractView("Invalid View") {
});
// Set the update queue. If it is null, create a new queue.
this.renderQueue = (renderQueue != null ? renderQueue
: new IRenderQueue() {
@Override
public <T> Future<T> enqueue(Callable<T> callable) {
return null;
}
});
// Initialize the disposed boolean.
disposed = new AtomicBoolean(false);
// ---- Initialize any base features. ---- //
parentNode = null;
// --------------------------------------- //
return;
}
/**
* @return The model for which this controller provides a view.
*/
public IUpdateable getModel() {
return model;
}
/**
* Sets the Node to which the associated {@link AbstractView} is attached.
*
* @param node
* The new parent node for the associated {@link AbstractView}.
*/
public void setParentNode(Node node) {
// If the parent node is not null and is different, we can attach the
// view to the new parent.
if (node != null && node != parentNode) {
this.parentNode = node;
// If the controller is not disposed, we should try to attach the
// view to the new parent.
if (!disposed.get()) {
renderQueue.enqueue(new Callable<Boolean>() {
@Override
public Boolean call() {
view.setParentNode(parentNode);
return true;
}
});
}
}
return;
}
/**
* Disposes of the AbstractController and its associated
* {@link AbstractView}.
*/
public void dispose() {
// If we have not already disposed of the controller, we need to
// unregister from the IUpdateable model and, if possible, dispose of
// the AbstractView managed by this controller.
if (disposed.compareAndSet(false, true)) {
// Unregister from the model.
model.unregister(this);
// Add a new update action to remove the view.
renderQueue.enqueue(new Callable<Boolean>() {
@Override
public Boolean call() {
view.dispose();
return true;
}
});
}
return;
}
/**
* Updates the controller and/or view if the {@link #model} has changed.
*/
@Override
public abstract void update(IUpdateable component);
}
/// ********************************************************************************Copyright(c)2014
/// UT-Battelle,LLC.*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:*Jordan Deyton(UT-Battelle,LLC.)-initial API and
/// implementation and/or*initial
/// documentation********************************************************************************/package
/// org.eclipse.ice.client.widgets.jme;
//
// import java.util.concurrent.Callable;import
/// java.util.concurrent.Future;import
/// java.util.concurrent.atomic.AtomicBoolean;
//
// import org.eclipse.ice.datastructures.ICEObject.ICEObject;import
/// org.eclipse.ice.datastructures.ICEObject.IUpdateable;import
/// org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;import
/// org.eclipse.ice.viz.service.jme3.application.IRenderQueue;import
/// org.eclipse.ice.viz.service.jme3.widgets.AbstractView;
//
// import com.jme3.scene.Node;
//
/// ***This
//
// class provides
// a base implementation for
// a controller
// that manages an*
//
// {@link IUpdateable}
//
// model and an
//
// {@link AbstractView}
//
// associated with that*
// model. It ensures
// that changes
// to the
// model or
// features provided
// by the*
// controller itself are
// synchronized with the
// view through
// the parent*SimpleApplication's
//
// simpleUpdate() thread.
// *
// * @author Jordan Deyton
// *
// */
// public abstract class AbstractController implements IUpdateableListener {
// /*
// * Note: We previously had an IControllerListener interface whereby objects
// * could listen for changes to an AbstractController. If this interface is
// * required for future work, this package (widgets.jme) and the plant
// * package (widgets.reactoreditor.plant) should be selectively reverted to
// * restore IControllerListener, AbstractController, and PipeController to
// * their state before 20140903-1600. Also note that this change was
// * committed to the branch.
// */
//
// /**
// * The model for which this controller provides a view.
// */
// protected final IUpdateable model;
// /**
// * The {@link AbstractView} associated with this controller.
// */
// private final AbstractView view;
//
// /**
// * The queue responsible for tasks that need to be performed on the jME
// * rendering thread.
// */
// protected final IRenderQueue renderQueue;
// /**
// * Whether or not the controller and its view have been disposed.
// */
// protected final AtomicBoolean disposed;
//
// // ---- Base Features ---- //
// /**
// * The current parent node for the {@link #view}.
// */
// private Node parentNode;
//
// // ----------------------- //
//
// /**
// * The default constructor. If any arguments are invalid (null), an
// * {@link IllegalArgumentException} is thrown.
// *
// * @param model
// * The model for which this controller provides a view.
// * @param view
// * The view associated with this controller. This needs to be
// * instantiated by the sub-class.
// * @param renderQueue
// * The queue responsible for tasks that need to be performed on
// * the jME rendering thread.
// */
// public AbstractController(IUpdateable model, AbstractView view,
// IRenderQueue renderQueue) {
//
// // Set the model and register with it. It should not be null.
// this.model = (model != null ? model : new ICEObject());
// this.model.register(this);
//
// // Set the view. If it is null, create a new, basic view.
// this.view = (view != null ? view : new AbstractView("Invalid View") {
// });
//
// // Set the update queue. If it is null, create a new queue.
// this.renderQueue = (renderQueue != null ? renderQueue
// : new IRenderQueue() {
// @Override
// public <T> Future<T> enqueue(Callable<T> callable) {
// return null;
// }
// });
//
// // Initialize the disposed boolean.
// disposed = new AtomicBoolean(false);
//
// // ---- Initialize any base features. ---- //
// parentNode = null;
// // --------------------------------------- //
//
// return;
// }
//
// /**
// * @return The model for which this controller provides a view.
// */
// public IUpdateable getModel() {
// return model;
// }
//
// /**
// * Sets the Node to which the associated {@link AbstractView} is attached.
// *
// * @param node
// * The new parent node for the associated {@link AbstractView}.
// */
// public void setParentNode(Node node) {
//
// // If the parent node is not null and is different, we can attach the
// // view to the new parent.
// if (node != null && node != parentNode) {
// this.parentNode = node;
//
// // If the controller is not disposed, we should try to attach the
// // view to the new parent.
// if (!disposed.get()) {
// renderQueue.enqueue(new Callable<Boolean>() {
// @Override
// public Boolean call() {
// view.setParentNode(parentNode);
// return true;
// }
// });
// }
// }
//
// return;
// }
//
// /**
// * Disposes of the AbstractController and its associated
// * {@link AbstractView}.
// */
// public void dispose() {
//
// // If we have not already disposed of the controller, we need to
// // unregister from the IUpdateable model and, if possible, dispose of
// // the AbstractView managed by this controller.
// if (disposed.compareAndSet(false, true)) {
// // Unregister from the model.
// model.unregister(this);
//
// // Add a new update action to remove the view.
// renderQueue.enqueue(new Callable<Boolean>() {
// @Override
// public Boolean call() {
// view.dispose();
// return true;
// }
// });
// }
//
// return;
// }
//
// /**
// * Updates the controller and/or view if the {@link #model} has changed.
// */
// @Override
// public abstract void update(IUpdateable component);
//
// }
/*******************************************************************************
* Copyright (c) 2014 UT-Battelle, LLC.
* 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:
* Jordan Deyton (UT-Battelle, LLC.) - initial API and implementation and/or
* initial documentation
*
*******************************************************************************/
package org.eclipse.ice.client.widgets.jme;
import org.eclipse.ice.client.widgets.reactoreditor.plant.PlantAppState;
import org.eclipse.ice.reactor.plant.PlantComposite;
import org.eclipse.ice.viz.service.jme3.application.MasterApplication;
import org.eclipse.ice.viz.service.jme3.application.ViewAppState;
import org.eclipse.ice.viz.service.jme3.internal.MasterApplicationHolder;
/**
* This factory is used to create custom {@link ViewAppState}s for components
* including <code>GeometryComponent</code>s, <code>MeshComponent</code>s, and
* <code>PlantComposite</code>s. To embed the view in an SWT
* <code>Composite</code>, see
* {@link ViewAppState#createComposite(org.eclipse.swt.widgets.Composite)}.
*
* @author Jordan
*
*/
public class ViewFactory {
// TODO We may want to handle this via an OSGi-based factories and registry.
/**
* The core <code>MasterApplication</code> that renders all of the views.
*/
private final MasterApplication app;
/**
* The default constructor.
*/
public ViewFactory() {
this(false);
}
/**
* A constructor that allows the <code>ViewFactory</code> to create its own
* {@link MasterApplication} if the OSGi-provided
* <code>MasterApplication</code> is not available.
* <p>
* <b>Note:</b> This is <i>not intended</i> for use inside ICE but inside
* static applications. In ICE, the <code>MasterApplication</code> is
* created only via an OSGi-provided factory.
* </p>
* <p>
* <b>Note 2:</b> If you use more than one <code>ViewFactory</code> with
* <code>staticFallBack</code> set to <code>true</code> and without running
* OSGi, then your program may not work properly. jME does not support
* multiple <code>SimpleApplication</code>s running simultaneously.
* </p>
*
* @param staticFallBack
* If true, then this factory will create its own
* <code>MasterApplication</code> when it cannot acquire one via
* OSGi.
*/
public ViewFactory(boolean staticFallBack) {
// Try to get the app via OSGi.
MasterApplication app = MasterApplicationHolder.getApplication();
// If the flag is set to true and we couldn't get the app through OSGi,
// create a new app.
if (app == null && staticFallBack) {
app = MasterApplication.createApplication();
}