]> gerrit.simantics Code Review - simantics/sysdyn.git/commitdiff
OBJMap update to support recognizing if something has changed (refs #4183)
authorlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 21 Mar 2013 11:36:14 +0000 (11:36 +0000)
committerlempinen <lempinen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Thu, 21 Mar 2013 11:36:14 +0000 (11:36 +0000)
git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27185 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.objmap/src/org/simantics/objmap/impl/Mapping.java
org.simantics.objmap/src/org/simantics/objmap/impl/RangeUpdateRequest.java

index cf4c33c9c6ea0a45d37cd655bed2671daa2cb35a..abb726e7b61c5bff3b5c8b0459bdcbad4f754492 100644 (file)
@@ -275,12 +275,14 @@ public class Mapping implements IMapping {
                        if(listensDomain) {\r
                            RangeUpdateRequest request = new RangeUpdateRequest(link, map, this);\r
                            try {\r
-                    g.syncRequest(request, request);\r
+                    boolean modified = g.syncRequest(request, request);\r
+                    if(modified) {\r
+                        updated.add(link.rangeElement);\r
+                    }\r
                 } catch (DatabaseException e) {\r
                     throw new MappingException(e);\r
                 }\r
-                           // TODO check if really modified\r
-                           updated.add(link.rangeElement);\r
+\r
                        }\r
                        else\r
                            if(link.type.updateRange(g, map, link.domainElement, link.rangeElement))\r
index 3268d9e266d75d1ad0ebe77391b905432225fd3f..4c1906589f9e1cb12f45506259962fb065f6bcc8 100644 (file)
@@ -38,9 +38,9 @@ public class RangeUpdateRequest implements Read<Boolean>, SyncListener<Boolean>
     @Override\r
     public Boolean perform(ReadGraph g) throws DatabaseException {\r
         if(map != null) {\r
-            link.type.updateRange(g, map, link.domainElement, link.rangeElement);\r
+            boolean updated = link.type.updateRange(g, map, link.domainElement, link.rangeElement);\r
             map = null;\r
-            return Boolean.TRUE;\r
+            return updated;\r
         }\r
         else if(mapping != null) {\r
             mapping.domainModified(link);\r