Resource end = soa.adapt(Resource.class);\r
if(conntype.equals(sr.DependencyConnection)) {\r
if(end.equals(sr.CloudSymbol)) return null;\r
- //if(!(end.equals(sr.AuxiliarySymbol) || end.equals(sr.ValveSymbol))) return null;\r
+ soa = startElement.getElementClass().getSingleItem(StaticObjectAdapter.class);\r
+ Resource start = soa.adapt(Resource.class);\r
+ if(g.isInheritedFrom(start, sr.ModuleSymbol) && !end.equals(sr.InputSymbol)) return null;\r
} else if (conntype.equals(sr.FlowConnection)) {\r
if(!(end.equals(sr.StockSymbol) || end.equals(sr.ValveSymbol) || end.equals(sr.CloudSymbol))) return null;\r
} else {\r
import org.simantics.g2d.utils.GeometryUtils;\r
import org.simantics.sysdyn.ui.elements2.AuxiliaryFactory;\r
import org.simantics.sysdyn.ui.elements2.CloudFactory;\r
+import org.simantics.sysdyn.ui.elements2.InputFactory;\r
+import org.simantics.sysdyn.ui.elements2.ModuleFactory;\r
import org.simantics.sysdyn.ui.elements2.connections.ConnectionClasses;\r
\r
/**\r
connectionClass = elementClassProvider.get(ConnectionClasses.DEPENDENCY);\r
\r
} else if (me.button == MouseEvent.RIGHT_BUTTON) {\r
- if(terminalElement.getElementClass().getId().equals(AuxiliaryFactory.class.getSimpleName())) return false;\r
+ String id = terminalElement.getElementClass().getId();\r
+ if(id.equals(AuxiliaryFactory.class.getSimpleName())\r
+ || id.equals(InputFactory.class.getSimpleName())\r
+ || id.equals(ModuleFactory.class.getSimpleName())) return false;\r
diagram.setHint(DiagramHints.ROUTE_ALGORITHM, RouterFactory.create(true, true));\r
connectionClass = elementClassProvider.get(ConnectionClasses.FLOW);\r
}\r