import org.simantics.db.common.utils.OrderedSetUtils;\r
import org.simantics.db.exception.DatabaseException;\r
import org.simantics.diagram.DiagramConstants;\r
+import org.simantics.diagram.stubs.DiagramResource;\r
import org.simantics.diagram.synchronization.graph.layer.GraphLayer;\r
import org.simantics.diagram.synchronization.graph.layer.GraphLayerUtil;\r
+import org.simantics.layer0.Layer0;\r
import org.simantics.layer0.utils.direct.GraphUtils;\r
-import org.simantics.modeling.ModelingUtils;\r
+import org.simantics.modeling.ModelingResources;\r
+import org.simantics.structural.stubs.StructuralResource2;\r
import org.simantics.sysdyn.SysdynResource;\r
import org.simantics.sysdyn.ui.browser.nodes.ModulesNode;\r
import org.simantics.ui.SimanticsUI;\r
public void perform(WriteGraph g) throws DatabaseException {\r
// Same as in SysdynProject.java. Should use the same code, not copy.\r
SysdynResource sr = SysdynResource.getInstance(g);\r
- ModelingUtils mu = new ModelingUtils(g);\r
+ Layer0 l0 = Layer0.getInstance(g);\r
+ ModelingResources mr = ModelingResources.getInstance(g);\r
+ StructuralResource2 sr2 = StructuralResource2.getInstance(g);\r
+ DiagramResource dr = DiagramResource.getInstance(g);\r
\r
- String name = GraphUtils.findFreshName(g, "ModuleType", model, mu.b.ConsistsOf, "%s%d");\r
+ String name = GraphUtils.findFreshName(g, "ModuleType", model, l0.ConsistsOf, "%s%d");\r
\r
Resource moduleType = g.newResource();\r
- g.claimLiteral(moduleType, mu.b.HasName, name);\r
- g.claim(moduleType, mu.b.Inherits, sr.Module);\r
- g.claim(moduleType, mu.b.PartOf, model);\r
+ g.claimLiteral(moduleType, l0.HasName, name);\r
+ g.claim(moduleType, l0.Inherits, sr.Module);\r
+ g.claim(moduleType, l0.PartOf, model);\r
\r
Resource diagram = OrderedSetUtils.create(g, sr.ConfigurationDiagram);\r
GraphLayer l = new GraphLayerUtil(g).createLayer(DiagramConstants.DEFAULT_LAYER_NAME, true);\r
- g.claim(diagram, mu.dr.HasLayer, l.getLayer());\r
+ g.claim(diagram, dr.HasLayer, l.getLayer());\r
Resource mapping = g.newResource();\r
- g.claim(mapping, mu.b.InstanceOf, null, sr.DiagramToCompositeMapping);\r
- g.claim(diagram, mu.b.HasTrigger, mapping);\r
+ g.claim(mapping, l0.InstanceOf, null, sr.DiagramToCompositeMapping);\r
+ g.claim(diagram, l0.HasTrigger, mapping);\r
\r
\r
Resource configuration = GraphUtils.create2(g, \r
sr.Configuration,\r
- mu.b.HasName, name + "Configuration",\r
- mu.mr.CompositeToDiagram, diagram,\r
- mu.b.PartOf, model);\r
+ l0.HasName, name + "Configuration",\r
+ mr.CompositeToDiagram, diagram,\r
+ l0.PartOf, model);\r
\r
- g.claim(moduleType, mu.sr.IsDefinedBy , configuration);\r
+ g.claim(moduleType, sr2.IsDefinedBy , configuration);\r
\r
\r
Resource moduleSymbol = g.newResource();\r
- g.claimLiteral(moduleSymbol, mu.b.HasName, name + " Symbol");\r
- g.claimLiteral(moduleSymbol, mu.b.HasLabel, name);\r
- g.claim(moduleSymbol, mu.b.Inherits, sr.ModuleSymbol);\r
- g.claim(moduleSymbol, mu.mr.SymbolToComponentType, moduleType);\r
- g.claim(moduleSymbol, mu.b.PartOf, model);\r
+ g.claimLiteral(moduleSymbol, l0.HasName, name + " Symbol");\r
+ g.claimLiteral(moduleSymbol, l0.HasLabel, name);\r
+ g.claim(moduleSymbol, l0.Inherits, sr.ModuleSymbol);\r
+ g.claim(moduleSymbol, mr.SymbolToComponentType, moduleType);\r
+ g.claim(moduleSymbol, l0.PartOf, model);\r
\r
Resource terminal = g.newResource();\r
- g.claim(terminal, mu.b.InstanceOf, sr.SysdynTerminal);\r
+ g.claim(terminal, l0.InstanceOf, sr.SysdynTerminal);\r
Resource connectionVariable = g.newResource();\r
- g.claim(connectionVariable, mu.b.InstanceOf, mu.sr.ConnectionVariable);\r
- g.claim(connectionVariable, mu.sr.Binds, sr.IsHeadOfTerminal);\r
- g.claim(connectionVariable, mu.sr.IsParameterOf, sr.ModuleSymbol);\r
- g.claim(terminal, mu.dr.HasConnectionVariable, connectionVariable);\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
\r
Resource terminal2 = g.newResource();\r
- g.claim(terminal2, mu.b.InstanceOf, sr.SysdynTerminal);\r
+ g.claim(terminal2, l0.InstanceOf, sr.SysdynTerminal);\r
Resource connectionVariable2 = g.newResource();\r
- g.claim(connectionVariable2, mu.b.InstanceOf, mu.sr.ConnectionVariable);\r
- g.claim(connectionVariable2, mu.sr.Binds, sr.IsTailOfTerminal);\r
- g.claim(connectionVariable2, mu.sr.IsParameterOf, sr.ModuleSymbol);\r
- g.claim(terminal2, mu.dr.HasConnectionVariable, connectionVariable2);\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
- g.claim(moduleSymbol, mu.sr.IsDefinedBy, OrderedSetUtils.create(g, mu.sr.Composite, terminal, terminal2));\r
+ g.claim(moduleSymbol, sr2.IsDefinedBy, OrderedSetUtils.create(g, sr2.Composite, terminal, terminal2));\r
\r
\r
}\r