]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Added a relation for linking source and destination model
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Tue, 22 Feb 2011 16:54:24 +0000 (16:54 +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@19817 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop/META-INF/MANIFEST.MF
org.simantics.interop/graph.tg
org.simantics.interop/graph/Interop.pgraph
org.simantics.interop/src/org/simantics/interop/issues/AbstractIssue.java
org.simantics.interop/src/org/simantics/interop/stubs/InteropResource.java

index ca01362857d87260bf7738c7571f5dec41a05d2d..003303034e6655b122fc786e778bd39bfe037657 100644 (file)
@@ -18,4 +18,5 @@ Require-Bundle: org.eclipse.ui,
  org.simantics.layer0;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
-Export-Package: org.simantics.interop.issues
+Export-Package: org.simantics.interop.issues,
+ org.simantics.interop.stubs
index cb77177e31da05d4c0db4628e43127cc6f24c6ba..e136802731656e653d0fb7cc468ade063d2b520b 100644 (file)
Binary files a/org.simantics.interop/graph.tg and b/org.simantics.interop/graph.tg differ
index 83428609f000d5c5d62292cfc85f255cd7c9811c..4a6fc85eafd5efa7c9540d6c681a14f8e3e9fbe5 100644 (file)
@@ -5,9 +5,9 @@ PROJ = <http://www.simantics.org/Project-1.0>
 INTEROP = <http://www.simantics.org/Interop-1.0> : L0.Ontology\r
     L0.HasResourceClass "org.simantics.interop.stubs.InteropResource"\r
     @L0.new\r
-    \r
-//INTEROP.InteropFeature : PROJ.Feature\r
-//   L0.HasDescription "Interop feature."\r
    \r
    \r
-INTEROP.ImportLibrary <T L0.Library
\ No newline at end of file
+INTEROP.ImportLibrary <T L0.Library\r
+\r
+INTEROP.HasSource <R L0.IsWeaklyRelatedTo\r
+    L0.InverseOf INTEROP.HasDestination <R L0.IsWeaklyRelatedTo\r
index ae14eedcf58d1f2434c4b4dd39e9458184ae8c9b..01ebb022bcb8052db9216cb1fe06e04330438a2d 100644 (file)
@@ -24,9 +24,12 @@ public abstract class AbstractIssue implements Issue{
                Display.getDefault().asyncExec(new Runnable() {\r
                        @Override\r
                        public void run() {\r
-                               for (IssueListener l : listeners) {\r
-                                       l.updated(AbstractIssue.this);\r
+                               synchronized (listeners) {\r
+                                       for (IssueListener l : listeners) {\r
+                                               l.updated(AbstractIssue.this);\r
+                                       }       \r
                                }\r
+                               \r
                        }\r
                });\r
        }\r
@@ -40,18 +43,23 @@ public abstract class AbstractIssue implements Issue{
                                for (IssueListener l : list) {\r
                                        l.disposed(AbstractIssue.this);\r
                                }\r
+                               listeners.clear();\r
                        }\r
                });\r
        }\r
        \r
        @Override\r
        public void addListener(IssueListener listener) {\r
-               listeners.add(listener);\r
+               synchronized(listeners) {\r
+                       listeners.add(listener);\r
+               }\r
        }\r
        \r
        @Override\r
        public void removeListener(IssueListener listener) {\r
-               listeners.remove(listener);\r
+               synchronized(listeners) {\r
+                       listeners.remove(listener);\r
+               }\r
        }\r
        \r
        @Override\r
index ffa281f1a95a07e8aecb62935dcee8ad7b32be7d..a2b7f148597a817ab3c5192fcfcb023d25505abd 100644 (file)
@@ -1,14 +1,3 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
 package org.simantics.interop.stubs;\r
 \r
 import org.simantics.db.Resource;\r
@@ -19,9 +8,13 @@ import org.simantics.db.exception.DatabaseException;
 \r
 public class InteropResource {\r
     \r
+    public final Resource HasDestination;\r
+    public final Resource HasSource;\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 HasSource = "http://www.simantics.org/Interop-1.0/HasSource";\r
         public static final String ImportLibrary = "http://www.simantics.org/Interop-1.0/ImportLibrary";\r
     }\r
     \r
@@ -35,6 +28,8 @@ public class InteropResource {
     }\r
     \r
     public InteropResource(ReadGraph graph) {\r
+        HasDestination = getResourceOrNull(graph, URIs.HasDestination);\r
+        HasSource = getResourceOrNull(graph, URIs.HasSource);\r
         ImportLibrary = getResourceOrNull(graph, URIs.ImportLibrary);\r
     }\r
     \r