import org.simantics.g3d.vtk.common.NodeSelectionProvider2;
import org.simantics.g3d.vtk.common.VTKContentOutlinePage;
import org.simantics.plant3d.Activator;
+import org.simantics.plant3d.ontology.Plant3D;
import org.simantics.plant3d.scenegraph.EndComponent;
import org.simantics.plant3d.scenegraph.Equipment;
import org.simantics.plant3d.scenegraph.Nozzle;
import org.simantics.plant3d.scenegraph.TurnComponent;
import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint;
-public class P3DContentOutlinePage extends VTKContentOutlinePage<Resource, Object>{
+public class P3DContentOutlinePage extends VTKContentOutlinePage<Resource, INode>{
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
protected Menu contextMenu;
private LocalResourceManager manager = new LocalResourceManager(JFaceResources.getResources());
private Image elbowImage;
private Image componentImage;
- public P3DContentOutlinePage(ParentNode<? extends INode> rootNode, NodeSelectionProvider2<Resource,Object> provider) {
+ public P3DContentOutlinePage(ParentNode<? extends INode> rootNode, NodeSelectionProvider2<Resource,INode> provider) {
super(rootNode,provider);
nozzleImage = manager.createImage(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/Nozzle.png"));
return ((P3DRootNode)parentElement).getChild().toArray();
}
if (parentElement instanceof PipeRun) {
- if (DEBUG) {
- List<Object> list = new ArrayList<Object>();
- list.addAll(((PipeRun)parentElement).getControlPoints());
- list.addAll(((PipeRun)parentElement).getSortedChild());
- return list.toArray();
- }
- return ((PipeRun)parentElement).getSortedChild().toArray();
- }
+ if (DEBUG) {
+ List<Object> list = new ArrayList<Object>();
+ list.addAll(((PipeRun)parentElement).getControlPoints());
+ list.addAll(((PipeRun)parentElement).getSortedChild());
+ return list.toArray();
+ }
+ return ((PipeRun)parentElement).getSortedChild().toArray();
+ }
if (DEBUG) {
if (parentElement instanceof PipelineComponent) {
return new Object[]{((PipelineComponent) parentElement).getControlPoint()};
}
+ @Override
+ public void propertyChanged(INode node, String id) {
+ // TODO Auto-generated method stub
+ if (node instanceof PipelineComponent) {
+ if (Plant3D.URIs.HasNext.equals(id) || Plant3D.URIs.HasPrevious.equals(id)) {
+ refershViewer(node.getParent());
+ return;
+ }
+ }
+ super.propertyChanged(node, id);
+ }
+
@Override
public void dispose() {
manager.dispose();
}
protected void hookContextMenu(TreeViewer viewer) {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- createContextMenu(manager);
- }
- });
- contextMenu = menuMgr.createContextMenu(viewer.getTree());
+ MenuManager menuMgr = new MenuManager("#PopupMenu");
+ menuMgr.setRemoveAllWhenShown(true);
+ menuMgr.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ createContextMenu(manager);
+ }
+ });
+ contextMenu = menuMgr.createContextMenu(viewer.getTree());
}
protected void createContextMenu(IMenuManager manager) {