From: niemisto Date: Thu, 12 Jan 2012 12:38:13 +0000 (+0000) Subject: Removed ConnectionVariable, LiteralVariable, HasParameter and DirectedConnectionRelat... X-Git-Tag: simantics-1.6~60 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=80e9a2dfd9bbcd9283325adf0b6ffb4672eb8758;p=simantics%2Fsysdyn.git Removed ConnectionVariable, LiteralVariable, HasParameter and DirectedConnectionRelation from Structural -ontology. They are now replaced by a direct HasDomain -statement from the relation to the type. DirectedConnectionRelation is replaced by ConnectionRelation. Also HasConnectionVariable is now replaced by HasConnectionPoint that points directly to the relation. fixes #3080 git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@23933 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ontology/graph.tg b/org.simantics.sysdyn.ontology/graph.tg index f4d5faa1..fd8fe64a 100644 Binary files a/org.simantics.sysdyn.ontology/graph.tg and b/org.simantics.sysdyn.ontology/graph.tg differ diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java index 0670d0d4..0f8234e2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/actions/NewModuleTypeAction.java @@ -9,6 +9,7 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.adapter.ActionFactory; import org.simantics.db.layer0.adapter.Template; import org.simantics.diagram.stubs.DiagramResource; +import org.simantics.diagram.synchronization.graph.DiagramGraphUtil; import org.simantics.layer0.Layer0; import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.modeling.ModelingResources; @@ -82,20 +83,11 @@ public class NewModuleTypeAction implements ActionFactory{ Resource terminal = g.newResource(); g.claim(terminal, l0.InstanceOf, sr.SysdynTerminal); - Resource connectionVariable = g.newResource(); - g.claim(connectionVariable, l0.InstanceOf, sr2.ConnectionVariable); - g.claim(connectionVariable, sr2.Binds, sr.IsHeadOfTerminal); - g.claim(connectionVariable, sr2.IsParameterOf, moduleSymbol); - g.claim(terminal, dr.HasConnectionVariable, connectionVariable); - + DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal, sr.IsHeadOfTerminal); Resource terminal2 = g.newResource(); g.claim(terminal2, l0.InstanceOf, sr.SysdynTerminal); - Resource connectionVariable2 = g.newResource(); - g.claim(connectionVariable2, l0.InstanceOf, sr2.ConnectionVariable); - g.claim(connectionVariable2, sr2.Binds, sr.IsTailOfTerminal); - g.claim(connectionVariable2, sr2.IsParameterOf, moduleSymbol); - g.claim(terminal2, dr.HasConnectionVariable, connectionVariable2); + DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal2, sr.IsTailOfTerminal); g.claim(moduleSymbol, sr2.IsDefinedBy, OrderedSetUtils.create(g, sr2.Composite, terminal, terminal2)); diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java index e21d6abb..dbabc430 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/editor/SysdynConnectionAdvisor.java @@ -88,8 +88,7 @@ public class SysdynConnectionAdvisor implements IConnectionAdvisor { Resource terminal2 = ((ResourceTerminal) term2).getResource(); SysdynResource sr = SysdynResource.getInstance(g); - Resource connectionVariable = g.getPossibleObject(terminal2, dr.HasConnectionVariable); - if(!g.hasStatement(connectionVariable, str2.Binds, sr.IsHeadOfTerminal)) { + if(!g.hasStatement(terminal2, dr.HasConnectionPoint, sr.IsHeadOfTerminal)) { return null; } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/newComponents/NewModuleNodeHandler.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/newComponents/NewModuleNodeHandler.java index 9c2e98e4..4c16319b 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/newComponents/NewModuleNodeHandler.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/handlers/newComponents/NewModuleNodeHandler.java @@ -24,6 +24,7 @@ import org.simantics.db.common.utils.OrderedSetUtils; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.adapter.Template; import org.simantics.diagram.stubs.DiagramResource; +import org.simantics.diagram.synchronization.graph.DiagramGraphUtil; import org.simantics.layer0.Layer0; import org.simantics.layer0.utils.direct.GraphUtils; import org.simantics.modeling.ModelingResources; @@ -130,21 +131,12 @@ public class NewModuleNodeHandler extends AbstractHandler { Resource terminal = g.newResource(); g.claim(terminal, l0.InstanceOf, sr.SysdynTerminal); - Resource connectionVariable = g.newResource(); - g.claim(connectionVariable, l0.InstanceOf, sr2.ConnectionVariable); - g.claim(connectionVariable, sr2.Binds, sr.IsHeadOfTerminal); - g.claim(connectionVariable, sr2.IsParameterOf, moduleSymbol); - g.claim(terminal, dr.HasConnectionVariable, connectionVariable); - + DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal, sr.IsHeadOfTerminal); Resource terminal2 = g.newResource(); g.claim(terminal2, l0.InstanceOf, sr.SysdynTerminal); - Resource connectionVariable2 = g.newResource(); - g.claim(connectionVariable2, l0.InstanceOf, sr2.ConnectionVariable); - g.claim(connectionVariable2, sr2.Binds, sr.IsTailOfTerminal); - g.claim(connectionVariable2, sr2.IsParameterOf, moduleSymbol); - g.claim(terminal2, dr.HasConnectionVariable, connectionVariable2); - + DiagramGraphUtil.addConnectionPoint(g, moduleSymbol, terminal2, sr.IsTailOfTerminal); + g.claim(moduleSymbol, sr2.IsDefinedBy, OrderedSetUtils.create(g, sr2.Composite, terminal, terminal2));