From 82d9794e76d4d3c91d814b7935f24d20fa6e915c Mon Sep 17 00:00:00 2001 From: luukkainen Date: Wed, 23 Feb 2011 14:07:39 +0000 Subject: [PATCH] Changing L0.ConsistsOf to Interop.HasImportData git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@19824 ac1ea38d-2e2b-0410-8846-a27921b304fc --- org.simantics.interop/graph.tg | Bin 862 -> 955 bytes org.simantics.interop/graph/Interop.pgraph | 2 ++ .../simantics/interop/browsing/ImportNode.java | 6 ++++-- .../simantics/interop/browsing/ImportNode2.java | 6 ++++-- .../interop/stubs/InteropResource.java | 6 ++++++ 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/org.simantics.interop/graph.tg b/org.simantics.interop/graph.tg index e136802731656e653d0fb7cc468ade063d2b520b..537da89056c25c010df240e87acf72edd63af6d3 100644 GIT binary patch delta 396 zcmYj~Pfx-y7{=EEE3iMnfH9A1VvHBB#&9GCjEM)haKNORX?AcUT{Yq4&3M%GJNU9-<^?Z9!I@cl z4&606gdU}(%yKTXB8Lx+_y4=MkFYJZAZH|2ALQyfArOpB^4C<9`h`FX+OWd(`$l>C zc04y*Ep@MFq&t-&%b$?jDxt?@poa92c1@+BZJTF3>yseckyz?_q8Nd;gIWTCu;N-CtHGm5U#wdpv>w delta 288 zcmdnZevfU!CsuI=1_rT-->r0bnSm@8PLIUm;QZ2}Bq_d zS%N^!2gD*EQ6T03V%Gma0HlS0m=}nV : L0.Ontology L0.HasResourceClass "org.simantics.interop.stubs.InteropResource" @L0.new +INTEROP.HasImportData getChildren(ReadGraph graph) throws DatabaseException { List nodes = new ArrayList(); - Builtins b = graph.getBuiltins(); + Layer0 l0 = Layer0.getInstance(graph); InteropResource i = InteropResource.getInstance(graph); // Collection models = graph.getObjects(project, b.ConsistsOf); // for (Resource m : models) { @@ -85,7 +86,8 @@ public class ImportNode implements INode { // } // } // } - Collection objs = graph.getObjects(model, b.ConsistsOf); + //Collection objs = graph.getObjects(model, b.ConsistsOf); + Collection objs = graph.getObjects(model, i.HasImportData); for (Resource o : objs) { if (graph.isInstanceOf(o, i.ImportLibrary)) { INode node = graph.adapt(o, INode.class); diff --git a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java index 38fb562..d4122cc 100644 --- a/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java +++ b/org.simantics.interop/src/org/simantics/interop/browsing/ImportNode2.java @@ -15,6 +15,7 @@ import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.Activator; import org.simantics.interop.stubs.InteropResource; +import org.simantics.layer0.Layer0; import org.simantics.modeling.ui.modelBrowser.model.INode; public class ImportNode2 implements INode { @@ -72,7 +73,7 @@ public class ImportNode2 implements INode { @Override public Collection getChildren(ReadGraph graph) throws DatabaseException { List nodes = new ArrayList(); - Builtins b = graph.getBuiltins(); + Layer0 l0 = Layer0.getInstance(graph); InteropResource i = InteropResource.getInstance(graph); // Collection models = graph.getObjects(project, b.ConsistsOf); // for (Resource m : models) { @@ -84,7 +85,8 @@ public class ImportNode2 implements INode { // } // } // } - Collection objs = graph.getObjects(project, b.ConsistsOf); + //Collection objs = graph.getObjects(project, b.ConsistsOf); + Collection objs = graph.getObjects(project, i.HasImportData); for (Resource o : objs) { if (graph.isInstanceOf(o, i.ImportLibrary)) { INode node = graph.adapt(o, INode.class); diff --git a/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java b/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java index a2b7f14..de2e123 100644 --- a/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java +++ b/org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java @@ -9,12 +9,16 @@ import org.simantics.db.exception.DatabaseException; public class InteropResource { public final Resource HasDestination; + public final Resource HasImportData; public final Resource HasSource; + public final Resource ImportDataOf; public final Resource ImportLibrary; public static class URIs { public static final String HasDestination = "http://www.simantics.org/Interop-1.0/HasDestination"; + public static final String HasImportData = "http://www.simantics.org/Interop-1.0/HasImportData"; public static final String HasSource = "http://www.simantics.org/Interop-1.0/HasSource"; + public static final String ImportDataOf = "http://www.simantics.org/Interop-1.0/ImportDataOf"; public static final String ImportLibrary = "http://www.simantics.org/Interop-1.0/ImportLibrary"; } @@ -29,7 +33,9 @@ public class InteropResource { public InteropResource(ReadGraph graph) { HasDestination = getResourceOrNull(graph, URIs.HasDestination); + HasImportData = getResourceOrNull(graph, URIs.HasImportData); HasSource = getResourceOrNull(graph, URIs.HasSource); + ImportDataOf = getResourceOrNull(graph, URIs.ImportDataOf); ImportLibrary = getResourceOrNull(graph, URIs.ImportLibrary); } -- 2.47.1