]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
Removed ConnectionVariable, LiteralVariable, HasParameter and DirectedConnectionRelat...
authorniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 12 Jan 2012 12:38:13 +0000 (12:38 +0000)
committerniemisto <niemisto@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 12 Jan 2012 12:38:13 +0000 (12:38 +0000)
fixes #3080

git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23933 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.sysdyn.ontology/graph.tg
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java
org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/newComponents/NewModuleNodeHandler.java

index f4d5faa1c94b4c86b8d67aa24e0263e03d4fa43b..fd8fe64a2e1bd93fdb157d02f38f55328b4280d2 100644 (file)
Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ
index 0670d0d487a5e392883d8bc54eb166f7d3546669..0f8234e25cf7f9e1a4651d26bd7f8e05a3d9b7fb 100644 (file)
@@ -9,6 +9,7 @@ import org.simantics.db.exception.DatabaseException;
 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
@@ -82,20 +83,11 @@ public class NewModuleTypeAction implements ActionFactory{
                         \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
index e21d6abb6d0d081659ffba18e5d7c3cb89cf0ae4..dbabc430621fcaf944d0d0e23a9caae81ee01728 100644 (file)
@@ -88,8 +88,7 @@ public class SysdynConnectionAdvisor  implements IConnectionAdvisor {
                                                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
index 9c2e98e4ad5b670a7f10df901b7c248ea37d9c6f..4c16319ba83f1f044a6c35e5bbb984c1cca78741 100644 (file)
@@ -24,6 +24,7 @@ import org.simantics.db.common.utils.OrderedSetUtils;
 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
@@ -130,21 +131,12 @@ public class NewModuleNodeHandler extends AbstractHandler {
                 \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