]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Changing L0.ConsistsOf to Interop.HasImportData
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Wed, 23 Feb 2011 14:07:39 +0000 (14:07 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:12 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@19824 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop/graph.tg
org.simantics.interop/graph/Interop.pgraph
org.simantics.interop/src/org/simantics/interop/browsing/ImportNode.java
org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java
org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java

index e136802731656e653d0fb7cc468ade063d2b520b..537da89056c25c010df240e87acf72edd63af6d3 100644 (file)
Binary files a/org.simantics.interop/graph.tg and b/org.simantics.interop/graph.tg differ
index 4a6fc85eafd5efa7c9540d6c681a14f8e3e9fbe5..ae2fd712048624e91f8dbf2b3ed78d29aa9a3ce0 100644 (file)
@@ -6,6 +6,8 @@ INTEROP = <http://www.simantics.org/Interop-1.0> : L0.Ontology
     L0.HasResourceClass "org.simantics.interop.stubs.InteropResource"\r
     @L0.new\r
    \r
+INTEROP.HasImportData <R L0.IsWeaklyRelatedTo\r
+    L0.InverseOf INTEROP.ImportDataOf <R L0.IsWeaklyRelatedTo\r
    \r
 INTEROP.ImportLibrary <T L0.Library\r
 \r
index 9ed9392054650128299d0e1879a993c1a76abcde..9719169fad1e5015b1b7ac8594acec13210e8f8e 100644 (file)
@@ -15,6 +15,7 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.Activator;\r
 import org.simantics.interop.stubs.InteropResource;\r
+import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
 public class ImportNode implements INode {\r
@@ -73,7 +74,7 @@ public class ImportNode implements INode {
        @Override\r
        public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
                List<INode> nodes = new ArrayList<INode>();\r
-               Builtins b = graph.getBuiltins();\r
+               Layer0 l0 = Layer0.getInstance(graph);\r
                InteropResource i = InteropResource.getInstance(graph);\r
 //             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
 //             for (Resource m : models) {\r
@@ -85,7 +86,8 @@ public class ImportNode implements INode {
 //                             }\r
 //                     }\r
 //             }\r
-               Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+               //Collection<Resource> objs = graph.getObjects(model, b.ConsistsOf);\r
+               Collection<Resource> objs = graph.getObjects(model, i.HasImportData);\r
                for (Resource o : objs) {\r
                        if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
                                INode node = graph.adapt(o, INode.class);\r
index 38fb562b540f2b601684590e8a6bf38b594e7e0b..d4122cc0682eedfe9cb7020bfa29f570ca53335d 100644 (file)
@@ -15,6 +15,7 @@ import org.simantics.db.WriteGraph;
 import org.simantics.db.exception.DatabaseException;\r
 import org.simantics.interop.Activator;\r
 import org.simantics.interop.stubs.InteropResource;\r
+import org.simantics.layer0.Layer0;\r
 import org.simantics.modeling.ui.modelBrowser.model.INode;\r
 \r
 public class ImportNode2 implements INode {\r
@@ -72,7 +73,7 @@ public class ImportNode2 implements INode {
        @Override\r
        public Collection<?> getChildren(ReadGraph graph) throws DatabaseException {\r
                List<INode> nodes = new ArrayList<INode>();\r
-               Builtins b = graph.getBuiltins();\r
+               Layer0 l0 = Layer0.getInstance(graph);\r
                InteropResource i = InteropResource.getInstance(graph);\r
 //             Collection<Resource> models = graph.getObjects(project, b.ConsistsOf);\r
 //             for (Resource m : models) {\r
@@ -84,7 +85,8 @@ public class ImportNode2 implements INode {
 //                             }\r
 //                     }\r
 //             }\r
-               Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+               //Collection<Resource> objs = graph.getObjects(project, b.ConsistsOf);\r
+               Collection<Resource> objs = graph.getObjects(project, i.HasImportData);\r
                for (Resource o : objs) {\r
                        if (graph.isInstanceOf(o, i.ImportLibrary)) {\r
                                INode node = graph.adapt(o, INode.class);\r
index a2b7f148597a817ab3c5192fcfcb023d25505abd..de2e123892720e91f4017bc99166798a0b2e7ca6 100644 (file)
@@ -9,12 +9,16 @@ import org.simantics.db.exception.DatabaseException;
 public class InteropResource {\r
     \r
     public final Resource HasDestination;\r
+    public final Resource HasImportData;\r
     public final Resource HasSource;\r
+    public final Resource ImportDataOf;\r
     public final Resource ImportLibrary;\r
         \r
     public static class URIs {\r
         public static final String HasDestination = "http://www.simantics.org/Interop-1.0/HasDestination";\r
+        public static final String HasImportData = "http://www.simantics.org/Interop-1.0/HasImportData";\r
         public static final String HasSource = "http://www.simantics.org/Interop-1.0/HasSource";\r
+        public static final String ImportDataOf = "http://www.simantics.org/Interop-1.0/ImportDataOf";\r
         public static final String ImportLibrary = "http://www.simantics.org/Interop-1.0/ImportLibrary";\r
     }\r
     \r
@@ -29,7 +33,9 @@ public class InteropResource {
     \r
     public InteropResource(ReadGraph graph) {\r
         HasDestination = getResourceOrNull(graph, URIs.HasDestination);\r
+        HasImportData = getResourceOrNull(graph, URIs.HasImportData);\r
         HasSource = getResourceOrNull(graph, URIs.HasSource);\r
+        ImportDataOf = getResourceOrNull(graph, URIs.ImportDataOf);\r
         ImportLibrary = getResourceOrNull(graph, URIs.ImportLibrary);\r
     }\r
     \r