]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java
Allow adding adjustable length components in the middle of a pipe
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / editor / P3DContentOutlinePage.java
index 24a141e464141f27ba4ff41ed068dee654cea1a3..893a07300cd2c95db095123c3794e7dbfdf53a54 100644 (file)
@@ -19,6 +19,7 @@ import org.simantics.g3d.scenegraph.base.ParentNode;
 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;
@@ -28,9 +29,9 @@ import org.simantics.plant3d.scenegraph.PipelineComponent;
 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());
@@ -41,7 +42,7 @@ public class P3DContentOutlinePage extends VTKContentOutlinePage<Resource, Objec
        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"));
@@ -117,6 +118,18 @@ public class P3DContentOutlinePage extends VTKContentOutlinePage<Resource, Objec
                
        }
        
+       @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();