]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/PipeRun.java
Handle PipeRun removals with detaching Components.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / PipeRun.java
index 2c334c1f2810f085f0deaad34028ea9d2a28994c..1d199f53f2ec604737d798a3ec074e7978bda485 100644 (file)
@@ -112,8 +112,22 @@ public class PipeRun extends P3DParentNode<IP3DNode> {
        }
        
        @RelatedElementsRem(Plant3D.URIs.children)
+       public void _remChild(PipelineComponent node) {
+               //since we do not now, if DB remove is actually remove or detach, we have to use detach. NodeMap will handle Component removals.
+           deattachNode(Plant3D.URIs.children, node);
+       }
+       
        public void remChild(PipelineComponent node) {
-               removeNode(Plant3D.URIs.children, node);
+           removeNode(Plant3D.URIs.children, node);
+       }
+       
+       @Override
+       public void remove() {
+           // since we do not now, if DB remove is actually remove or detach, we have to use detach. NodeMap will handle Component removals.
+           Collection<PipelineComponent> comps = getChild();
+           for (PipelineComponent c : comps)
+               c.deattach();
+           super.remove();
        }