Commit e8f983d1 authored by Robert Smith's avatar Robert Smith
Browse files

Merge branch 'Robert/UnifiedVizRefactor3' into


Robert/UnifiedVizRefactor4

Conflicts:
	org.eclipse.ice.client.widgets/src/org/eclipse/ice/client/widgets/ICEMeshPage.java
	org.eclipse.ice.client.widgets/src/org/eclipse/ice/client/widgets/MeshElementTreeView.java
	org.eclipse.ice.datastructures/src/org/eclipse/ice/datastructures/form/MeshComponent.java
	org.eclipse.ice.nek5000/src/org/eclipse/ice/nek5000/NekReader.java
	org.eclipse.ice.viz.service.geometry/src/org/eclipse/ice/viz/service/geometry/scene/base/IGeometry.java
	org.eclipse.ice.viz.service.mesh/META-INF/MANIFEST.MF
	org.eclipse.ice.viz.service.mesh/src/org/eclipse/ice/viz/service/mesh/javafx/FXMeshVizService.java
	org.eclipse.ice.viz.service/src/org/eclipse/ice/viz/service/modeling/Face.java
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parents 6709175f feb047f0
......@@ -34,10 +34,9 @@ Import-Package: com.jme3.app,
org.eclipse.ice.viz.service.geometry.shapes,
org.eclipse.ice.viz.service.geometry.widgets,
org.eclipse.ice.viz.service.internal,
org.eclipse.ice.viz.service.jme3.application,
org.eclipse.ice.viz.service.jme3.geometry,
org.eclipse.ice.viz.service.jme3.mesh,
org.eclipse.ice.viz.service.mesh.datastructures,
org.eclipse.ice.viz.service.mesh.javafx,
org.eclipse.ice.viz.service.mesh.properties,
org.eclipse.ice.viz.service.modeling,
org.eclipse.ice.viz.service.widgets,
......
......@@ -47,10 +47,6 @@ import org.eclipse.ice.iclient.uiwidgets.IProcessEventListener;
import org.eclipse.ice.iclient.uiwidgets.ISimpleResourceProvider;
import org.eclipse.ice.iclient.uiwidgets.IUpdateEventListener;
import org.eclipse.ice.viz.service.IVizServiceFactory;
import org.eclipse.ice.viz.service.jme3.geometry.JME3ControllerFactory;
import org.eclipse.ice.viz.service.modeling.IControllerFactory;
import org.eclipse.ice.viz.service.modeling.Shape;
import org.eclipse.ice.viz.service.modeling.ShapeComponent;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
......@@ -223,7 +219,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
staticLogger.info("ICEFormEditor Message: IVizServiceFactory set!");
IConfigurationElement[] elements = Platform.getExtensionRegistry()
.getConfigurationElementsFor("org.eclipse.ice.viz.service.IVizServiceFactory");
.getConfigurationElementsFor(
"org.eclipse.ice.viz.service.IVizServiceFactory");
staticLogger.info("ICEFormEditor: Available configuration elements");
for (IConfigurationElement element : elements) {
staticLogger.info(element.getName());
......@@ -254,9 +251,11 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Push a message to the message manager
if (getHeaderForm() != null) {
final IMessageManager messageManager = getHeaderForm().getMessageManager();
final IMessageManager messageManager = getHeaderForm()
.getMessageManager();
if (dirty) {
messageManager.addMessage("statusUpdate", "There are unsaved changes on the form.", null,
messageManager.addMessage("statusUpdate",
"There are unsaved changes on the form.", null,
IMessageProvider.WARNING);
} else {
messageManager.removeMessage("statusUpdate");
......@@ -322,10 +321,12 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// should
// only be one output page.
if (!(componentMap.get("output").isEmpty())) {
resourceComponent = (ResourceComponent) (componentMap.get("output").get(0));
resourceComponent = (ResourceComponent) (componentMap.get("output")
.get(0));
if (resourceComponent != null) {
// Make the page
resourceComponentPage = new ICEResourcePage(this, resourceComponent.getName(),
resourceComponentPage = new ICEResourcePage(this,
resourceComponent.getName(),
resourceComponent.getName());
// Set the ResourceComponent
resourceComponentPage.setResourceComponent(resourceComponent);
......@@ -359,15 +360,18 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Get the MasterDetailsComponent and create the MasterDetails page.
if (!(componentMap.get("masterDetails").isEmpty())) {
masterDetailsComponent = (MasterDetailsComponent) (componentMap.get("masterDetails").get(0));
masterDetailsComponent = (MasterDetailsComponent) (componentMap
.get("masterDetails").get(0));
if (masterDetailsComponent != null) {
// Get the name
String name = masterDetailsComponent.getName();
// Make the page
ICEMasterDetailsPage iCEMasterDetailsPage = new ICEMasterDetailsPage(this, "MDPid", name);
ICEMasterDetailsPage iCEMasterDetailsPage = new ICEMasterDetailsPage(
this, "MDPid", name);
// Set the MasterDetailsComponent
iCEMasterDetailsPage.setMasterDetailsComponent(masterDetailsComponent);
iCEMasterDetailsPage
.setMasterDetailsComponent(masterDetailsComponent);
masterDetailsPages.add(iCEMasterDetailsPage);
}
......@@ -396,8 +400,10 @@ public class ICEFormEditor extends SharedHeaderFormEditor
public void run() {
// Post the message to the update manager
if (getHeaderForm() != null) {
final IMessageManager messageManager = getHeaderForm().getMessageManager();
messageManager.addMessage("statusUpdate", message, null, IMessageProvider.INFORMATION);
final IMessageManager messageManager = getHeaderForm()
.getMessageManager();
messageManager.addMessage("statusUpdate", message, null,
IMessageProvider.INFORMATION);
}
}
});
......@@ -416,17 +422,20 @@ public class ICEFormEditor extends SharedHeaderFormEditor
GeometryComponent geometryComponent = new GeometryComponent();
// TODO Get the right factory from a service, instead of hard coding
IControllerFactory factory = new JME3ControllerFactory();
geometryComponent.setGeometry((Shape) factory.createController(new ShapeComponent()));
// IControllerFactory factory = new JME3ControllerFactory();
// geometryComponent.setGeometry((Shape) factory.createController(new
// ShapeComponent()));
// Get the GeometryComponent and create the GeometryPage.
if (!(componentMap.get("geometry").isEmpty())) {
geometryComponent = (GeometryComponent) (componentMap.get("geometry").get(0));
geometryComponent = (GeometryComponent) (componentMap
.get("geometry").get(0));
if (geometryComponent != null) {
// Make the GeometryPage
geometryPage = new ICEGeometryPage(this, "GPid", geometryComponent.getName());
geometryPage = new ICEGeometryPage(this, "GPid",
geometryComponent.getName());
// Set the GeometryComponent
geometryPage.setGeometry(geometryComponent);
......@@ -455,7 +464,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
if (meshComponent != null) {
// Make the MeshPage
meshPage = new ICEMeshPage(this, "MeshPid", meshComponent.getName());
meshPage = new ICEMeshPage(this, "MeshPid",
meshComponent.getName());
// Set the MeshComponent
meshPage.setMeshComponent(meshComponent);
......@@ -483,7 +493,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
emfComponent = (EMFComponent) comp;
if (emfComponent != null) {
// Make the EMFSectionPage
emfPage = new EMFSectionPage(this, emfComponent.getName(), emfComponent.getName());
emfPage = new EMFSectionPage(this, emfComponent.getName(),
emfComponent.getName());
// Set the EMFComponent
emfPage.setEMFComponent(emfComponent);
pages.add(emfPage);
......@@ -515,7 +526,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// a collection
if (list != null) {
// Create a new page for the list
ListComponentSectionPage page = new ListComponentSectionPage(this, list.getName(), list.getName());
ListComponentSectionPage page = new ListComponentSectionPage(
this, list.getName(), list.getName());
page.setList(list);
// Add the page to the return list
pages.add(page);
......@@ -537,7 +549,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
if (!trees.isEmpty()) {
// Show the view
try {
getSite().getWorkbenchWindow().getActivePage().showView(getTreeCompositeViewerID());
getSite().getWorkbenchWindow().getActivePage()
.showView(getTreeCompositeViewerID());
} catch (PartInitException e) {
logger.error(getClass().getName() + " Exception!", e);
}
......@@ -560,7 +573,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
}
// Get the TreeCompositeViewer
TreeCompositeViewer treeView = (TreeCompositeViewer) getSite().getWorkbenchWindow().getActivePage()
TreeCompositeViewer treeView = (TreeCompositeViewer) getSite()
.getWorkbenchWindow().getActivePage()
.findView(getTreeCompositeViewerID());
// Set the tree as input to the tree view
treeView.setInput(tree, this);
......@@ -639,7 +653,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
managedForm = headerForm;
// Get the Form that provides the common header and decorate it.
org.eclipse.ui.forms.widgets.Form form = managedForm.getForm().getForm();
org.eclipse.ui.forms.widgets.Form form = managedForm.getForm()
.getForm();
managedForm.getToolkit().decorateFormHeading(form);
// Create a composite for the overall head layout.
......@@ -674,15 +689,16 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Create the process label, button and dropdown if the action list is
// available.
if (iceDataForm.getActionList() != null && !iceDataForm.getActionList().isEmpty()) {
if (iceDataForm.getActionList() != null
&& !iceDataForm.getActionList().isEmpty()) {
// Create a label for the process buttons
Label processLabel = new Label(headClient, SWT.NONE);
processLabel.setText("Process:");
// Create the dropdown menu
processDropDown = new Combo(headClient,
SWT.DROP_DOWN | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
processDropDown = new Combo(headClient, SWT.DROP_DOWN | SWT.SINGLE
| SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
for (String i : iceDataForm.getActionList()) {
processDropDown.add(i);
}
......@@ -694,7 +710,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
@Override
public void widgetSelected(SelectionEvent e) {
// Set the action value to use when processing
processName = processDropDown.getItem(processDropDown.getSelectionIndex());
processName = processDropDown
.getItem(processDropDown.getSelectionIndex());
}
});
......@@ -778,8 +795,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
if (numComponents == 1) {
pageName = ((ICEObject) (comps.get(0))).getName();
} else {
pageName = ((ICEObject) (comps.get(0))).getName() + ", " + ((ICEObject) (comps.get(1))).getName()
+ ", etc.";
pageName = ((ICEObject) (comps.get(0))).getName() + ", "
+ ((ICEObject) (comps.get(1))).getName() + ", etc.";
}
// Instantiate the page
tmpPage = new ICESectionPage(this, pageName, pageName);
......@@ -792,11 +809,12 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Otherwise, if there are more components than the number of
// components per page, add them all with numCompsPerPage Components
// per page. This loop adds all of the full pages.
for (i = 0; i < (numComponents / numCompsPerPage) * numCompsPerPage; i = i + numCompsPerPage) {
for (i = 0; i < (numComponents / numCompsPerPage)
* numCompsPerPage; i = i + numCompsPerPage) {
// Set a name for the page that is a combination of the first
// two components
pageName = ((ICEObject) (comps.get(i))).getName() + ", " + ((ICEObject) (comps.get(i + 1))).getName()
+ ", etc.";
pageName = ((ICEObject) (comps.get(i))).getName() + ", "
+ ((ICEObject) (comps.get(i + 1))).getName() + ", etc.";
// Create the page
tmpPage = new ICESectionPage(this, pageName, pageName);
// Add the components
......@@ -816,7 +834,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
pageName = ((ICEObject) (comps.get(i))).getName();
} else {
pageName = ((ICEObject) (comps.get(i))).getName() + ", "
+ ((ICEObject) (comps.get(i + 1))).getName() + ", etc.";
+ ((ICEObject) (comps.get(i + 1))).getName()
+ ", etc.";
}
// Create the page
tmpPage = new ICESectionPage(this, pageName, pageName);
......@@ -843,7 +862,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
* the input for this editor
*/
@Override
public void init(IEditorSite site, IEditorInput input) throws RuntimeException {
public void init(IEditorSite site, IEditorInput input)
throws RuntimeException {
// Set the part name
setPartName(input.getName());
......@@ -876,8 +896,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
} else {
// Throw errors if the type is wrong
logger.error("Unable to load Form Editor!");
throw new RuntimeException(
"Input passed to ICEFormEditor.init()" + " is not of type ICEFormInput or FileEditorInput.");
throw new RuntimeException("Input passed to ICEFormEditor.init()"
+ " is not of type ICEFormInput or FileEditorInput.");
}
iceDataForm.register(this);
......@@ -929,7 +949,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
}
// Refresh the parts on the selected page
for (IFormPart part : ((ICEFormPage) this.getSelectedPage()).getManagedForm().getParts()) {
for (IFormPart part : ((ICEFormPage) this.getSelectedPage())
.getManagedForm().getParts()) {
part.refresh();
}
......@@ -943,7 +964,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Get the first MasterDetailsComponent (The current code only
// allows one master details to be implemented at this time
MasterDetailsComponent comp = (MasterDetailsComponent) (componentMap.get("masterDetails").get(0));
MasterDetailsComponent comp = (MasterDetailsComponent) (componentMap
.get("masterDetails").get(0));
// Get the name of the component
String name = comp.getName();
......@@ -975,7 +997,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
if (!(componentMap.get("emf")).isEmpty()) {
for (int i = 0; i < this.getPageCount(); i++) {
FormPage formPage = (FormPage) this.pages.get(i);
EMFComponent comp = (EMFComponent) componentMap.get("emf").get(0);
EMFComponent comp = (EMFComponent) componentMap.get("emf")
.get(0);
if (formPage.getPartName().equals(comp.getName())) {
formPage.doSave(null);
}
......@@ -1025,12 +1048,14 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Loop over the components and get them into the map
for (Component i : iceDataForm.getComponents()) {
logger.info("ICEFormEditor Message: Adding component " + i.getName() + " " + i.getId());
logger.info("ICEFormEditor Message: Adding component "
+ i.getName() + " " + i.getId());
i.accept(this);
}
// Create pages for the DataComponents and add them to the list
if (!(componentMap.get("data").isEmpty()) || !(componentMap.get("table").isEmpty())
if (!(componentMap.get("data").isEmpty())
|| !(componentMap.get("table").isEmpty())
|| !(componentMap.get("matrix").isEmpty())) {
formPages.addAll(createDataTableAndMatrixComponentPages());
}
......@@ -1069,7 +1094,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Create the page for Reactors
if (!(componentMap.get("reactor").isEmpty())) {
logger.info("ICEFormEditor Message: " + componentMap.get("reactor").size()
logger.info("ICEFormEditor Message: "
+ componentMap.get("reactor").size()
+ " IReactorComponents not rendered.");
}
......@@ -1277,7 +1303,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
// Notify the update listeners
for (IUpdateEventListener eventListener : updateListeners) {
System.out.println("Updating " + eventListener.getClass().toString());
System.out
.println("Updating " + eventListener.getClass().toString());
eventListener.formUpdated(iceDataForm);
}
......@@ -1340,7 +1367,8 @@ public class ICEFormEditor extends SharedHeaderFormEditor
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
managedForm.getForm().getForm().setText(iceDataForm.getName() + " " + iceDataForm.getId());
managedForm.getForm().getForm().setText(
iceDataForm.getName() + " " + iceDataForm.getId());
managedForm.getForm().getForm().redraw();
}
});
......
......@@ -20,7 +20,6 @@ import org.eclipse.ice.viz.service.IVizService;
import org.eclipse.ice.viz.service.IVizServiceFactory;
import org.eclipse.ice.viz.service.geometry.widgets.ShapeTreeView;
import org.eclipse.ice.viz.service.geometry.widgets.TransformationView;
import org.eclipse.ice.viz.service.jme3.geometry.JME3ControllerFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
......@@ -40,7 +39,8 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
*
* @author Jay Jay Billings
*/
public class ICEGeometryPage extends ICEFormPage implements IUpdateableListener {
public class ICEGeometryPage extends ICEFormPage
implements IUpdateableListener {
/**
* <p>
* The property that determines whether there is a need to Save.
......@@ -122,9 +122,10 @@ public class ICEGeometryPage extends ICEFormPage implements IUpdateableListener
*/
public void getFocus() {
ShapeTreeView shapeTreeView = (ShapeTreeView) getSite().getWorkbenchWindow().getActivePage()
ShapeTreeView shapeTreeView = (ShapeTreeView) getSite()
.getWorkbenchWindow().getActivePage()
.findView(ShapeTreeView.ID);
shapeTreeView.setFactory(new JME3ControllerFactory());
// shapeTreeView.setFactory(new JME3ControllerFactory());
shapeTreeView.setGeometry(geometryComp.getGeometry());
return;
......@@ -148,21 +149,25 @@ public class ICEGeometryPage extends ICEFormPage implements IUpdateableListener
// Setup the layout and layout data
layout.numColumns = 1;
form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
form.getBody().setLayoutData(
new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
form.getBody().setLayout(new FillLayout());
// Opening the views in order to interact with the geometryEditor
try {
getSite().getWorkbenchWindow().getActivePage().showView(ShapeTreeView.ID);
getSite().getWorkbenchWindow().getActivePage().showView(TransformationView.ID);
getSite().getWorkbenchWindow().getActivePage()
.showView(ShapeTreeView.ID);
getSite().getWorkbenchWindow().getActivePage()
.showView(TransformationView.ID);
} catch (PartInitException e) {
logger.error(getClass().getName() + " Exception!", e);
}
// Create the geometry composite - get the parent
org.eclipse.ui.forms.widgets.Form pageForm = managedForm.getForm().getForm();
org.eclipse.ui.forms.widgets.Form pageForm = managedForm.getForm()
.getForm();
Composite parent = pageForm.getBody();
// Get JME3 Geometry service from factory
......@@ -171,11 +176,13 @@ public class ICEGeometryPage extends ICEFormPage implements IUpdateableListener
// Create and draw geometry canvas
try {
IVizCanvas vizCanvas = service.createCanvas(geometryComp.getGeometry());
IVizCanvas vizCanvas = service
.createCanvas(geometryComp.getGeometry());
vizCanvas.draw(parent);
} catch (Exception e) {
logger.error("Error creating Geometry Canvas with Geometry Service.", e);
logger.error(
"Error creating Geometry Canvas with Geometry Service.", e);
}
getFocus();
......
......@@ -22,15 +22,6 @@ import org.eclipse.ice.datastructures.form.MeshComponent;
import org.eclipse.ice.viz.service.IVizService;
import org.eclipse.ice.viz.service.geometry.widgets.TransformationView;
import org.eclipse.ice.viz.service.jme3.mesh.IMeshSelectionListener;
import org.eclipse.ice.viz.service.jme3.mesh.JME3MeshCanvas;
import org.eclipse.ice.viz.service.jme3.mesh.MeshAppStateMode;
import org.eclipse.ice.viz.service.jme3.mesh.MeshAppStateModeFactory;
import org.eclipse.ice.viz.service.jme3.mesh.MeshAppStateModeFactory.Mode;
import org.eclipse.ice.viz.service.jme3.mesh.MeshSelectionManager;
import org.eclipse.ice.viz.service.mesh.properties.MeshSelection;
import org.eclipse.ice.viz.service.modeling.Edge;
import org.eclipse.ice.viz.service.modeling.Face;
import org.eclipse.ice.viz.service.modeling.Vertex;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.ToolBarManager;
......@@ -117,7 +108,7 @@ public class ICEMeshPage extends ICEFormPage
*/
private ArrayList<ICEObject> selectedMeshParts;
private JME3MeshCanvas canvas;
private IMeshVizCanvas canvas;
/**
* The constructor
......@@ -222,14 +213,17 @@ public class ICEMeshPage extends ICEFormPage
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
// Get the JME3 viz service for meshes
IVizService service = editor.getVizServiceFactory()
.get("JME3 Mesh Service");
// IVizService service = editor.getVizServiceFactory()
// .get("JME3 Mesh Service");
// TODO Get this service through OSGI
IVizService service = new FXMeshVizService();
// Create the VizCanvas
canvas = null;
try {
// canvas = (JME3MeshCanvas)
// service.createCanvas(meshComp.getMesh());
canvas = (FXMeshCanvas) service.createCanvas(meshComp.getMesh());
} catch (Exception e) {
logger.error("Mesh Viz Service failed to create mesh Viz Canvas.");
}
......@@ -244,7 +238,9 @@ public class ICEMeshPage extends ICEFormPage
// The MeshPage should also listen for changes to the MeshApplication's
// current selection.
canvas.registerListener(this);
// FIXME This currently isn't doing anything as it just invokes the stub
// function selectionChanged() when an update triggers
// canvas.registerListener(this);
// Now that we have a MeshApplication, we need to create the Actions
// that fill the ToolBar with configuration settings for the
......@@ -279,36 +275,49 @@ public class ICEMeshPage extends ICEFormPage
// Create the drop down for switching between add and modify modes
modesActionTree = new ActionTree("Mode");
// Use a MeshAppStateModeFactory to get the available modes and create
// ActionTrees for each one to go in the Mode menu.
MeshAppStateModeFactory factory = canvas.getMeshAppStateModeFactory();
for (Mode type : factory.getAvailableModes()) {
final MeshAppStateMode mode = factory.getMode(type);
action = new Action() {
@Override
public void run() {
canvas.setMode(mode);
}
};
// Set the Action's text and tool tip.
action.setText(mode.getName());
action.setToolTipText(mode.getDescription());
modesActionTree.add(new ActionTree(action));
}
// Create the option to set edit mode
action = new Action() {
@Override
public void run() {
canvas.setEditMode(true);
}
};
// Set the Action's text
action.setText("Edit Elements");
modesActionTree.add(new ActionTree(action));
// Create the option to set add mode
action = new Action() {
@Override
public void run() {
canvas.setEditMode(false);
}
};
// Set the Action's text
action.setText("Add Elements");
modesActionTree.add(new ActionTree(action));
actions.add(modesActionTree);
// Create the drop down to reset the camera placement or zoom
// TODO create the camera reset action
// TODO Add actions for toggling the hud based on JME3/JavaFX specific
// implementation
// Create the toggle switch to show or hide the heads-up display
action = new org.eclipse.ice.viz.service.jme3.mesh.ToggleHUDAction(
canvas.getMeshAppState());
canvas);
toggleHUDActionTree = new ActionTree(action);
actions.add(toggleHUDActionTree);
// TODO Add the action for toggling the axes based on JME3/JavaFX
// specific implementation
// Create the toggle switch to show or hide the axes.
action = new org.eclipse.ice.viz.service.jme3.mesh.ToggleAxesAction(
canvas.getMeshAppState());
canvas);
toggleAxesActionTree = new ActionTree(action);
actions.add(toggleAxesActionTree);
......@@ -316,8 +325,7 @@ public class ICEMeshPage extends ICEFormPage
action = new Action() {
@Override
public void run() {
canvas.getMeshAppState().getSelectionManager()
.deleteSelection();
canvas.deleteSelection();
}
};
action.setText("Delete");
......@@ -371,49 +379,11 @@ public class ICEMeshPage extends ICEFormPage
// Get the selection made in the MeshElementTreeView.
if (part.getSite().getId().equals(MeshElementTreeView.ID)) {
// Get the mesh selection manager from the app.
MeshSelectionManager selectionManager = canvas.getMeshAppState()
.getSelectionManager();
// Reset any existing selection data in the MeshApplication
selectionManager.clearSelection();
// Get the array of all selections in the Mesh Elements view
Object[] treeSelections = ((ITreeSelection) selection).toArray();
// Initialize lists of IDs for vertices, edges, and polygons.
final List<Integer> vertexIds = new ArrayList<Integer>();
final List<Integer> edgeIds = new ArrayList<Integer>();
final List<Integer> polygonIds = new ArrayList<Integer>();
// Get each element from the selection and add the ID for the
// corresponding vertex/edge/polygon to one of the above lists.
// These lists will be sent to the selection manager later.
for (Object element : treeSelections) {
if (element instanceof MeshSelection) {
MeshSelection meshSelection = (MeshSelection) element;
if (meshSelection.selectedMeshPart instanceof Vertex) {