--- /dev/null
+package org.simantics.plant3d.scenegraph;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.simantics.g3d.scenegraph.base.ParentNode;
+import org.simantics.objmap.graph.annotations.DynamicGraphType;
+import org.simantics.objmap.graph.annotations.GetType;
+import org.simantics.objmap.graph.annotations.SetType;
+import org.simantics.plant3d.ontology.Plant3D;
+import org.simantics.plant3d.scenegraph.controlpoint.PipeControlPoint;
+import org.simantics.plant3d.scenegraph.controlpoint.ControlPointFactory;
+
+@DynamicGraphType(Plant3D.URIs.EndComponent)
+public class EndComponent extends PipelineComponent {
+
+ private String type;
+ PipeControlPoint controlPoint;
+
+ @GetType(Plant3D.URIs.EndComponent)
+ public String getType() {
+ return type;
+ }
+
+ @SetType(Plant3D.URIs.EndComponent)
+ public void setType(String type) throws Exception {
+ this.type = type;
+ controlPoint = ControlPointFactory.create(this);
+
+ }
+
+ @Override
+ public PipeControlPoint getControlPoint() {
+ return controlPoint;
+ }
+
+ @Override
+ public void setParent(ParentNode<?> parent, String name) {
+ super.setParent(parent, name);
+ setPipeRun((PipeRun)parent);
+ }
+
+ @Override
+ public Map<String, Object> updateParameterMap() {
+ Map<String,Object> map = new HashMap<String, Object>();
+
+ PipeRun pipeRun = getPipeRun();
+ if (pipeRun != null) {
+ map.put("radius", pipeRun.getPipeDiameter() * 0.5);
+ }
+ return map;
+ }
+}