Commit 93e00594 authored by Robert Smith's avatar Robert Smith
Browse files

Working Plant View and refactored factories



This commit features a working Plant View in JavaFX. the
IControllerFactories have been refactored to avoid use of instanceof and
to extend from an AbstractControllerFactory.
Signed-off-by: Robert Smith's avatarRobert Smith <SmithRW@ornl.gov>
parent 60810c91
......@@ -12,7 +12,9 @@ Require-Bundle: org.eclipse.ice.datastructures,
org.eclipse.nebula.widgets.nattable.extension.glazedlists;bundle-version="1.3.0",
org.eclipse.remote.ui;bundle-version="2.0.0",
org.eclipse.swt
Import-Package: org.apache.commons.io,
Import-Package: javafx.embed.swt;version="2.2.0",
javafx.scene.image;version="2.2.0",
org.apache.commons.io,
org.eclipse.core.commands.common,
org.eclipse.core.expressions,
org.eclipse.core.filesystem,
......
......@@ -17,7 +17,7 @@
<booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8080 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore;"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Declipse.ignoreApp=true -Dosgi.noShutdown=true -Dorg.osgi.service.http.port=8080 -Dice.projectLocation=/home/bkj/ICEFiles -Dcom.sun.jersey.config.property.packages=org.eclipse.ice.core.iCore -Dosgi.framework.extensions=org.eclipse.fx.osgi;"/>
<stringAttribute key="pde.version" value="3.3"/>
<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="target_bundles" value="com.sun.jersey.jersey-servlet@default:default,org.eclipse.core.expressions@default:default,org.apache.lucene.core@default:default,org.apache.commons.codec@default:default,org.hamcrest.core@default:default,com.sun.jersey.jersey-core@default:default,org.apache.jasper@default:default,org.apache.lucene.highlighter@default:default,org.eclipse.core.commands@default:default,javax.ws.rs.jsr311-api@default:default,org.eclipse.equinox.common@2:true,org.eclipse.core.contenttype@default:default,org.eclipse.osgi@-1:true,javax.activation@default:default,org.apache.lucene.analysis@default:default,org.eclipse.core.resources@default:default,org.apache.lucene.snowball@default:default,org.eclipse.core.runtime.compatibility.registry@default:false,com.sun.jersey.jersey-json@default:default,org.eclipse.equinox.weaving.hook@default:false,org.junit*4.8.2.v4_8_2_v20110321-1705@default:default,jackson-mapper-asl@default:default,org.eclipse.ui@default:default,org.eclipse.core.databinding.observable@default:default,com.sun.jersey.jersey-client@default:default,org.mortbay.jetty.server@default:default,org.eclipse.core.databinding@default:default,jackson-xc@default:default,org.eclipse.equinox.security@default:default,org.eclipse.core.variables@default:default,javax.xml.stream@default:default,org.eclipse.equinox.transforms.hook@default:false,org.eclipse.ant.core@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.equinox.http.servlet@default:default,org.eclipse.ui.workbench@default:default,org.eclipse.ui.forms@default:default,org.eclipse.swt@default:default,javax.xml.bind@default:default,org.eclipse.equinox.app@default:default,org.codehaus.jettison.jettison@default:default,org.eclipse.equinox.servletbridge.extensionbundle@default:false,org.apache.lucene.spellchecker@default:default,org.eclipse.equinox.ds@default:true,org.eclipse.core.databinding.property@default:default,org.eclipse.ui.cheatsheets@default:default,org.eclipse.help.ui@default:default,org.eclipse.equinox.util@default:default,org.apache.commons.logging*1.0.4.v201101211617@default:default,com.jcraft.jsch@default:default,org.objectweb.asm@default:default,org.apache.commons.logging*1.1.1.v201101211721@default:default,org.eclipse.equinox.preferences@default:default,org.apache.ant@default:default,org.eclipse.jface.databinding@default:default,javax.servlet.jsp@default:default,org.eclipse.osgi.services@default:default,org.eclipse.equinox.http.jetty@default:default,org.apache.lucene.queries@default:default,javax.mail@default:default,org.eclipse.jface@default:default,org.eclipse.ui.intro@default:default,commonj.sdo@default:default,javax.persistence@default:default,org.eclipse.core.filesystem@default:default,org.eclipse.equinox.http.registry@default:default,org.eclipse.platform@default:default,org.apache.lucene@default:default,org.eclipse.equinox.http.servletbridge@default:default,org.mortbay.jetty.util@default:default,javax.transaction@default:false,jackson-core-asl@default:default,com.sun.jersey.jersey-server@default:default,com.ibm.icu@default:default,org.eclipse.equinox.servletbridge@default:default,org.eclipse.help.base@default:default,org.eclipse.core.runtime.compatibility.auth@default:default,jackson-jaxrs@default:default,org.eclipse.core.jobs@default:default,org.eclipse.help@default:default,javax.xml@default:default,osgi.enterprise@default:default,org.apache.lucene.misc@default:default,org.eclipse.swt.gtk.linux.x86_64*3.7.2.v3740f@default:false,org.eclipse.core.runtime@default:true,org.apache.commons.el@default:default,org.apache.lucene.memory@default:default,javax.servlet@default:default,org.eclipse.swt.gtk.linux.x86_64*3.7.1.v3738a@default:false"/>
......
......@@ -19,8 +19,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
import org.eclipse.ice.datastructures.ICEObject.IUpdateable;
import org.eclipse.ice.datastructures.ICEObject.IUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.IVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IVizUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
......@@ -37,7 +37,7 @@ import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscripti
*
* @author Jay Jay Billings
*/
public class TestComponentListener implements IManagedVizUpdateableListener, IUpdateableListener,
public class TestComponentListener implements IManagedUpdateableListener, IUpdateableListener,
IVizUpdateableListener {
/**
......@@ -143,14 +143,14 @@ public class TestComponentListener implements IManagedVizUpdateableListener, IUp
* @see org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateableListener#getSubscriptions(org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable)
*/
@Override
public ArrayList<UpdateableSubscriptionType> getSubscriptions(IManagedVizUpdateable source) {
public ArrayList<UpdateableSubscriptionType> getSubscriptions(IManagedUpdateable source) {
ArrayList<UpdateableSubscriptionType> types = new ArrayList<UpdateableSubscriptionType>();
types.add(UpdateableSubscriptionType.All);
return types;
}
@Override
public void update(IManagedVizUpdateable component, UpdateableSubscriptionType[] type) {
public void update(IManagedUpdateable component, UpdateableSubscriptionType[] type) {
// Update the flag
wasNotified.set(true);
......
......@@ -24,8 +24,8 @@ 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.datastructures.componentVisitor.IComponentVisitor;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.modeling.ShapeController;
......@@ -40,7 +40,7 @@ import org.eclipse.ice.viz.service.modeling.ShapeController;
@XmlRootElement(name = "GeometryComponent")
@XmlAccessorType(XmlAccessType.FIELD)
public class GeometryComponent extends ICEObject implements Component,
IUpdateableListener, IManagedVizUpdateableListener {
IUpdateableListener, IManagedUpdateableListener {
/**
* <p>
* The set of ComponentListeners observing the GeometryComponent
......@@ -362,7 +362,7 @@ public class GeometryComponent extends ICEObject implements Component,
* VizObject.IVizUpdateable)
*/
@Override
public void update(IManagedVizUpdateable component,
public void update(IManagedUpdateable component,
UpdateableSubscriptionType[] type) {
notifyListeners();
......@@ -378,7 +378,7 @@ public class GeometryComponent extends ICEObject implements Component,
*/
@Override
public ArrayList<UpdateableSubscriptionType> getSubscriptions(
IManagedVizUpdateable source) {
IManagedUpdateable source) {
// Register for all event types
ArrayList<UpdateableSubscriptionType> types = new ArrayList<UpdateableSubscriptionType>();
......
......@@ -22,8 +22,8 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.eclipse.ice.datastructures.ICEObject.Component;
import org.eclipse.ice.datastructures.ICEObject.ICEObject;
import org.eclipse.ice.datastructures.componentVisitor.IComponentVisitor;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateableListener;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.AbstractController;
......@@ -44,7 +44,7 @@ import org.eclipse.ice.viz.service.modeling.FaceController;
@XmlRootElement(name = "MeshComponent")
@XmlAccessorType(XmlAccessType.FIELD)
public class MeshComponent extends ICEObject
implements Component, IManagedVizUpdateableListener {
implements Component, IManagedUpdateableListener {
/**
* The wrapped VizMeshComponent.
......@@ -328,7 +328,7 @@ public class MeshComponent extends ICEObject
* UpdateableSubscriptionType[])
*/
@Override
public void update(IManagedVizUpdateable component,
public void update(IManagedUpdateable component,
UpdateableSubscriptionType[] types) {
// Only pass on updates for the root part's list of children changing,
......@@ -350,7 +350,7 @@ public class MeshComponent extends ICEObject
*/
@Override
public ArrayList<UpdateableSubscriptionType> getSubscriptions(
IManagedVizUpdateable source) {
IManagedUpdateable source) {
// Register for all event types
ArrayList<UpdateableSubscriptionType> types = new ArrayList<UpdateableSubscriptionType>();
......
This diff is collapsed.
......@@ -113,4 +113,5 @@ public class HeatExchangerController extends AbstractController
public void setWireFrameMode(boolean on) {
((IWireFramePart) view).setWireFrameMode(on);
}
}
......@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-Vendor: Oak Ridge National Laboratory
Eclipse-ExtensibleAPI: true
Import-Package: javafx.scene;version="2.2.0",
Import-Package: javafx.embed.swt;version="2.2.0",
javafx.scene;version="2.2.0",
javafx.scene.image;version="2.2.0",
org.eclipse.ice.viz.service,
org.eclipse.ice.viz.service.datastructures.VizObject,
......
......@@ -146,40 +146,6 @@ public class FXGeometryCanvas extends FXVizCanvas implements IPlantView {
// Take a snapshot of the current scene
WritableImage screenshot = viewer.getCanvas().getScene().snapshot(null);
// FileChooser fileChooser = new FileChooser();
//
// // Set extension filter
// FileChooser.ExtensionFilter extFilter = new
// FileChooser.ExtensionFilter(
// ".png");
// fileChooser.getExtensionFilters().add(extFilter);
// //Get the stage that is displaying the canvas
// Stage stage = (Stage) viewer.getCanvas().getScene().getWindow();
//
// Scene scene = new Scene();
// scene.snapshot(image)
// Show save file dialog
// File file = fileChooser.showSaveDialog();
//
// if (file != null) {
// try {
// WritableImage writableImage = new WritableImage((int)
// Math.round(stage.getWidth()),
// (int) Math.round(stage.getHeight()));
// canvas.snapshot(null, writableImage);
// RenderedImage renderedImage = SwingFXUtils
// .fromFXImage(writableImage, null);
// ImageIO.write(renderedImage, "png", file);
// } catch (IOException ex) {
// Logger.getLogger(JavaFX_DrawOnCanvas.class.getName())
// .log(Level.SEVERE, null, ex);
// }
// }
// }
// Make the array of strings needed to pass to the file dialog.
String[] extensionStrings = new String[] { ".png" };
......
......@@ -13,7 +13,7 @@ package org.eclipse.ice.viz.service.javafx.geometry.datatypes;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.geometry.shapes.OperatorType;
import org.eclipse.ice.viz.service.modeling.AbstractController;
......@@ -253,7 +253,7 @@ public class FXShapeController extends ShapeController
* eclipse.ice.viz.service.datastructures.VizObject.IVizUpdateable)
*/
@Override
public void update(IManagedVizUpdateable component,
public void update(IManagedUpdateable component,
UpdateableSubscriptionType[] type) {
// If the view updated, recursively refresh all children and propagate
......@@ -311,7 +311,7 @@ public class FXShapeController extends ShapeController
*/
@Override
public ArrayList<UpdateableSubscriptionType> getSubscriptions(
IManagedVizUpdateable source) {
IManagedUpdateable source) {
// Create a list of events to subscribe to
ArrayList<UpdateableSubscriptionType> types = new ArrayList<UpdateableSubscriptionType>();
......
......@@ -11,8 +11,8 @@
package org.eclipse.ice.viz.service.javafx.geometry.datatypes;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.AbstractControllerFactory;
import org.eclipse.ice.viz.service.modeling.AbstractMesh;
import org.eclipse.ice.viz.service.modeling.IControllerFactory;
import org.eclipse.ice.viz.service.modeling.ShapeMesh;
/**
......@@ -22,27 +22,25 @@ import org.eclipse.ice.viz.service.modeling.ShapeMesh;
* @author Robert Smith
*
*/
public class FXShapeControllerFactory implements IControllerFactory {
public class FXShapeControllerFactory extends AbstractControllerFactory {
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ice.viz.service.modeling.IControllerFactory#createController(
* org.eclipse.ice.viz.service.modeling.AbstractMeshComponent)
/**
* The default cosntructor.
*/
@Override
public AbstractController createController(AbstractMesh model) {
public FXShapeControllerFactory() {
super();
// Check that the model is a shape component, if not return null
if (model instanceof ShapeMesh) {
// Set the ShapeMesh provider
typeMap.put(ShapeMesh.class, new IControllerProvider() {
@Override
public AbstractController createController(AbstractMesh model) {
// Create an FXShapeView for the model, then wrap them both in a
// shape
FXShapeView view = new FXShapeView((ShapeMesh) model);
return new FXShapeController((ShapeMesh) model, view);
}
return null;
// Create an FXShapeView for the model, then wrap them both in a
// shape controller
FXShapeView view = new FXShapeView((ShapeMesh) model);
return new FXShapeController((ShapeMesh) model, view);
}
});
}
}
......@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.ice.viz.service.javafx.geometry.datatypes;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedVizUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.geometry.shapes.ShapeType;
import org.eclipse.ice.viz.service.javafx.canvas.TransformGizmo;
......@@ -407,7 +407,7 @@ public class FXShapeView extends AbstractView implements IWireFramePart {
}
@Override
public void update(IManagedVizUpdateable component,
public void update(IManagedUpdateable component,
UpdateableSubscriptionType[] type) {
// If the transformation updated, update the JavaFX transformation
......@@ -418,10 +418,7 @@ public class FXShapeView extends AbstractView implements IWireFramePart {
.setAll(Util.convertTransformation(transformation));
}
// Notify own listeners of the change
UpdateableSubscriptionType[] eventTypes = {
UpdateableSubscriptionType.All };
updateManager.notifyListeners(eventTypes);
updateManager.notifyListeners(type);
}
/*
......@@ -443,13 +440,9 @@ public class FXShapeView extends AbstractView implements IWireFramePart {
shape.setDrawMode(DrawMode.FILL);
}
//
// node.getChildren().clear();
// node.getChildren().add(shape);
// Notify listeners of the change
UpdateableSubscriptionType[] eventTypes = {
UpdateableSubscriptionType.Property };
UpdateableSubscriptionType.Wireframe };
updateManager.notifyListeners(eventTypes);
}
......
/*******************************************************************************
* Copyright (c) 2016 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:
* Robert Smith
*******************************************************************************/
package org.eclipse.ice.viz.service.javafx.geometry.plant;
import org.eclipse.ice.viz.service.datastructures.VizObject.IManagedUpdateable;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerController;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerMesh;
import org.eclipse.ice.viz.service.modeling.AbstractView;
/**
* A HeatExchangerController specifically tailored to the functionality of
* JavaFX.
*
* @author Robert Smith
*
*/
public class FXHeatExchangerController extends HeatExchangerController {
/**
* The nullary constructor.
*/
public FXHeatExchangerController() {
super();
}
/**
* The default constructor.
*
* @param model
* The internal representation for the heat exchanger part.
* @param view
* The view containing the graphical representation of this part.
*/
public FXHeatExchangerController(HeatExchangerMesh model,
AbstractView view) {
super(model, view);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.ice.viz.service.datastructures.VizObject.
* IManagedVizUpdateableListener#update(org.eclipse.ice.viz.service.
* datastructures.VizObject.IVizUpdateable,
* org.eclipse.ice.viz.service.datastructures.VizObject.
* UpdateableSubscriptionType[])
*/
@Override
public void update(IManagedUpdateable component,
UpdateableSubscriptionType[] type) {
// Queue any messages from the view refresh
updateManager.enqueue();
// Refresh the view, ignoring wireframe events from anything except this
// object's view
if (type[0] != UpdateableSubscriptionType.Wireframe
|| component == view) {
view.refresh(model);
}
// Notify own listeners of the change.
updateManager.notifyListeners(type);
updateManager.flushQueue();
}
}
......@@ -12,6 +12,7 @@ package org.eclipse.ice.viz.service.javafx.geometry.plant;
import java.util.List;
import org.eclipse.ice.viz.service.datastructures.VizObject.UpdateableSubscriptionType;
import org.eclipse.ice.viz.service.geometry.reactor.Extrema;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerMesh;
import org.eclipse.ice.viz.service.geometry.reactor.JunctionController;
......@@ -75,6 +76,12 @@ public class FXHeatExchangerView extends AbstractView
*/
MeshView outletView;
/**
* Whether to display this part in wireframe mode. It will be displayed as a
* wireframe if true or as a solid if false.
*/
boolean wireframe;
/**
* The nullary constructor.
*/
......@@ -120,10 +127,14 @@ public class FXHeatExchangerView extends AbstractView
* @param view
* A MeshView for JavaFX representation of the new tube. The
* pipe's graphical view will be saved to this object.
* @param wireframe
* Whether or not to render the MeshView as a wireframe. If true,
* it will display as a wireframe, otherwise it will display as a
* solid.
* @return A new tube mesh adhering to the above specifications
*/
private FXTube createTubeToPoint(double[] point, HeatExchangerMesh model,
MeshView view) {
MeshView view, boolean wireframe) {
// Get the primary tube's start point
Extrema start = model.getPrimaryPipe().getLowerExtrema();
......@@ -233,6 +244,9 @@ public class FXHeatExchangerView extends AbstractView
view = new MeshView(tube.getMesh());
view.getTransforms().setAll(rotation, reverseRotation);
view.setMaterial(new PhongMaterial(Color.BLUE));
if (wireframe) {
view.setDrawMode(DrawMode.LINE);
}
node.getChildren().add(view);
// Calculate the vector between the intersection point and the target
......@@ -329,19 +343,19 @@ public class FXHeatExchangerView extends AbstractView
node.getChildren().clear();
try { // The heat exchanger cannot be drawn without a central pipe to
// contain.
if (((HeatExchangerMesh) model).getPrimaryPipe() == null) {
return;
}
} catch (Exception e) {
e.printStackTrace();
// The heat exchanger cannot be drawn without a central pipe to
// contain.
if (((HeatExchangerMesh) model).getPrimaryPipe() == null) {
return;
}
// Get a reference to the primary pipe
FXPipeController primaryPipeController = (FXPipeController) ((HeatExchangerMesh) model)
.getPrimaryPipe();
// Set the primary pipe to the same wireframe mode as this object
primaryPipeController.setWireFrameMode(wireframe);
// Recolor the primary pipe to blue and add its mesh to the node
primaryPipeController.setMaterial(new PhongMaterial(Color.BLUE));
primaryPipe = (Group) primaryPipeController.getRepresentation();
......@@ -354,6 +368,9 @@ public class FXHeatExchangerView extends AbstractView
// Add the wall to the scene
wall.setMaterial(new PhongMaterial(Color.BLUE));
if (wireframe) {
wall.setDrawMode(DrawMode.LINE);
}
node.getChildren().add(wall);
wall.getTransforms().setAll(Util.convertTransformation(transformation));
......@@ -368,7 +385,7 @@ public class FXHeatExchangerView extends AbstractView
.getEntitiesByCategory("Secondary Input").get(0);
secondaryInlet = createTubeToPoint(
((JunctionController) inletJunction).getCenter(),
(HeatExchangerMesh) model, inletView);
(HeatExchangerMesh) model, inletView, wireframe);
// Add the secondary pipes to the scene
inletView = new MeshView(secondaryInlet.getMesh());
......@@ -387,7 +404,7 @@ public class FXHeatExchangerView extends AbstractView
.getEntitiesByCategory("Secondary Output").get(0);
secondaryOutlet = createTubeToPoint(
((JunctionController) outletJunction).getCenter(),
(HeatExchangerMesh) model, outletView);
(HeatExchangerMesh) model, outletView, wireframe);
// Add the secondary pipes to the scene
outletView = new MeshView(secondaryOutlet.getMesh());
......@@ -406,24 +423,34 @@ public class FXHeatExchangerView extends AbstractView
@Override
public void setWireFrameMode(boolean on) {
// If wall exists, the secondary pipe should as well, so set them
// all
if (wall != null) {
// Save the wireframe state
wireframe = on;
// Set each of the pieces to line mode
if (on) {
// Set each of the pieces that exist to line mode
if (on) {
if (wall != null)
wall.setDrawMode(DrawMode.LINE);
if (inletView != null)
inletView.setDrawMode(DrawMode.LINE);
if (outletView != null)
outletView.setDrawMode(DrawMode.LINE);
}
}
// Set each of the pieces to fill mode
} else {
wall.setDrawMode(DrawMode.FILL);
inletView.setDrawMode(DrawMode.FILL);
outletView.setDrawMode(DrawMode.FILL);
// Set each of the pieces to fill mode
else {
if (wall != null)
wall.setDrawMode(DrawMode.FILL);
if (inletView != null)
inletView.setDrawMode(DrawMode.FILL);
if (outletView != null)
outletView.setDrawMode(DrawMode.FILL);
}
// Notify listeners of the change
UpdateableSubscriptionType[] eventTypes = {
UpdateableSubscriptionType.Wireframe };
updateManager.notifyListeners(eventTypes);
}
}
......@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.ice.viz.service.javafx.geometry.plant;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerController;
import org.eclipse.ice.viz.service.geometry.reactor.HeatExchangerMesh;
import org.eclipse.ice.viz.service.geometry.reactor.JunctionController;
import org.eclipse.ice.viz.service.geometry.reactor.JunctionMesh;
......@@ -18,8 +17,8 @@ import org.eclipse.ice.viz.service.geometry.reactor.PipeMesh;
import org.eclipse.ice.viz.service.geometry.reactor.ReactorController;
import org.eclipse.ice.viz.service.geometry.reactor.ReactorMesh;
import org.eclipse.ice.viz.service.modeling.AbstractController;
import org.eclipse.ice.viz.service.modeling.AbstractControllerFactory;
import org.eclipse.ice.viz.service.modeling.AbstractMesh;
import org.eclipse.ice.viz.service.modeling.IControllerFactory;
/**
* A factory for creating JavaFX views and controllers for Reactor Analyzer
......@@ -28,45 +27,58 @@ import org.eclipse.ice.viz.service.modeling.IControllerFactory;