]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/InlineComponent.java
Very crude API for creating pipeline components
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / InlineComponent.java
index e098de63a637303a787aca53f85db0259380f845..1fd83da110d3f36bf8739db214d325444d8e74e9 100644 (file)
@@ -51,6 +51,10 @@ public class InlineComponent extends PipelineComponent {
                return !controlPoint.isFixed();
        }
        
+       public boolean isSizeChange() {
+           return controlPoint.isSizeChange();
+       }
+       
        @RelatedGetValue(Plant3D.URIs.HasRotationAngle)
        @GetPropertyValue(name="Rotation Angle", value=Plant3D.URIs.HasRotationAngle, tabId = "Default")
        public Double getRotationAngle() {
@@ -82,6 +86,34 @@ public class InlineComponent extends PipelineComponent {
                }       
        }
        
+       @RelatedGetValue(Plant3D.URIs.IsReversed)
+       @GetPropertyValue(name="Reverse", value=Plant3D.URIs.IsReversed, tabId = "Default")
+       public Boolean isReversed() {
+               if (!controlPoint.isReverse())
+                       return null;
+               Boolean d = controlPoint.getReversed();
+               if (d == null)
+                       return false;
+               return d;
+       }
+       @RelatedSetValue(Plant3D.URIs.IsReversed)
+       @SetPropertyValue(value=Plant3D.URIs.IsReversed)
+       public void setReversed(Boolean reverse) {
+               if (!controlPoint.isReverse())
+                       return;
+               
+               if (reverse == null) {
+                       return;
+               }
+               controlPoint.setReversed(reverse);
+               try {
+                       PipingRules.requestUpdate(getControlPoint());
+               } catch (Exception e) {
+                       // TODO Auto-generated catch block
+                       e.printStackTrace();
+               }       
+       }
+       
        @Override
        public void updateParameters() {
                super.updateParameters();