import org.simantics.db.layer0.adapter.ActionFactory;\r
import org.simantics.db.layer0.adapter.Template;\r
import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.diagram.synchronization.graph.DiagramGraphUtil;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
\r
Resource terminal = g.newResource();\r
g.claim(terminal, l0.InstanceOf, sr.SysdynTerminal);\r
- Resource connectionVariable = g.newResource();\r
- g.claim(connectionVariable, l0.InstanceOf, sr2.ConnectionVariable);\r
- g.claim(connectionVariable, sr2.Binds, sr.IsHeadOfTerminal);\r
- g.claim(connectionVariable, sr2.IsParameterOf, moduleSymbol);\r
- g.claim(terminal, dr.HasConnectionVariable, connectionVariable);\r
- \r
+ DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal, sr.IsHeadOfTerminal);\r
\r
Resource terminal2 = g.newResource();\r
g.claim(terminal2, l0.InstanceOf, sr.SysdynTerminal);\r
- Resource connectionVariable2 = g.newResource();\r
- g.claim(connectionVariable2, l0.InstanceOf, sr2.ConnectionVariable);\r
- g.claim(connectionVariable2, sr2.Binds, sr.IsTailOfTerminal);\r
- g.claim(connectionVariable2, sr2.IsParameterOf, moduleSymbol);\r
- g.claim(terminal2, dr.HasConnectionVariable, connectionVariable2);\r
+ DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal2, sr.IsTailOfTerminal);\r
\r
g.claim(moduleSymbol, sr2.IsDefinedBy, OrderedSetUtils.create(g, sr2.Composite, terminal, terminal2));\r
\r
Resource terminal2 = ((ResourceTerminal) term2).getResource();\r
SysdynResource sr = SysdynResource.getInstance(g);\r
\r
- Resource connectionVariable = g.getPossibleObject(terminal2, dr.HasConnectionVariable);\r
- if(!g.hasStatement(connectionVariable, str2.Binds, sr.IsHeadOfTerminal)) {\r
+ if(!g.hasStatement(terminal2, dr.HasConnectionPoint, sr.IsHeadOfTerminal)) {\r
return null;\r
}\r
\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.db.layer0.adapter.Template;\r
import org.simantics.diagram.stubs.DiagramResource;\r
+import org.simantics.diagram.synchronization.graph.DiagramGraphUtil;\r
import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
import org.simantics.modeling.ModelingResources;\r
\r
Resource terminal = g.newResource();\r
g.claim(terminal, l0.InstanceOf, sr.SysdynTerminal);\r
- Resource connectionVariable = g.newResource();\r
- g.claim(connectionVariable, l0.InstanceOf, sr2.ConnectionVariable);\r
- g.claim(connectionVariable, sr2.Binds, sr.IsHeadOfTerminal);\r
- g.claim(connectionVariable, sr2.IsParameterOf, moduleSymbol);\r
- g.claim(terminal, dr.HasConnectionVariable, connectionVariable);\r
- \r
+ DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal, sr.IsHeadOfTerminal); \r
\r
Resource terminal2 = g.newResource();\r
g.claim(terminal2, l0.InstanceOf, sr.SysdynTerminal);\r
- Resource connectionVariable2 = g.newResource();\r
- g.claim(connectionVariable2, l0.InstanceOf, sr2.ConnectionVariable);\r
- g.claim(connectionVariable2, sr2.Binds, sr.IsTailOfTerminal);\r
- g.claim(connectionVariable2, sr2.IsParameterOf, moduleSymbol);\r
- g.claim(terminal2, dr.HasConnectionVariable, connectionVariable2);\r
- \r
+ DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal2, sr.IsTailOfTerminal);\r
+ \r
g.claim(moduleSymbol, sr2.IsDefinedBy, OrderedSetUtils.create(g, sr2.Composite, terminal, terminal2));\r
\r
\r