]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/Nozzle.java
Processing DB changes could leave control points unsynchronized
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / Nozzle.java
index fec8c08447e539b5f9aa64449352508253aa2226..cbdecc1c09ea2250c4464c003220d3825e3097ea 100644 (file)
@@ -54,30 +54,30 @@ public class Nozzle extends PipelineComponent {
        }
        
        private boolean fixed = false;
-    
-    @RelatedGetValue(Plant3D.URIs.IsFixedNozzle)
-    @GetPropertyValue(name="Fixed", value=Plant3D.URIs.IsFixedNozzle, tabId="Default")
-    public boolean isFixed() {
-        return fixed;
-    }
-    
-    @RelatedSetValue(Plant3D.URIs.IsFixedNozzle)
-    public void setFixed(boolean fixed) {
-        if (fixed == this.fixed)
-            return;
-        this.fixed = fixed;
-        firePropertyChanged(Plant3D.URIs.IsFixedNozzle);
-    }
+       
+       @RelatedGetValue(Plant3D.URIs.IsFixedNozzle)
+       @GetPropertyValue(name="Fixed", value=Plant3D.URIs.IsFixedNozzle, tabId="Default")
+       public boolean isFixed() {
+               return fixed;
+       }
+       
+       @RelatedSetValue(Plant3D.URIs.IsFixedNozzle)
+       public void setFixed(boolean fixed) {
+               if (fixed == this.fixed)
+                       return;
+               this.fixed = fixed;
+               firePropertyChanged(Plant3D.URIs.IsFixedNozzle);
+       }
        
        private void _createCP() throws Exception{
                if (controlPoint != null)
                        return;
-               if (getPipeRun() != null) {
-                       controlPoint = ControlPointFactory.create(this);
-                       // TODO : these should not be needed.
-                       controlPoint.setDeletable(false);
-                       controlPoint.setFixed(true);
-               }
+               controlPoint = ControlPointFactory.create(this);
+               // TODO : these should not be needed.
+               controlPoint.setDeletable(false);
+               controlPoint.setFixed(true);
+               syncNext();
+        syncPrevious();
        }
        
        @RelatedSetObj(Plant3D.URIs.HasPipeRun)
@@ -134,7 +134,7 @@ public class Nozzle extends PipelineComponent {
                
                PipeRun pipeRun = getPipeRun();
                if (pipeRun != null) {
-                       map.put("length", pipeRun.getPipeDiameter() * 2.0);
+                       //map.put("length", pipeRun.getPipeDiameter() * 2.0);
                        map.put("radius", pipeRun.getPipeDiameter() * 0.5);
                }
                return map;