From 57704e2a7c574a45f79a783bc125f90b7543034e Mon Sep 17 00:00:00 2001 From: lempinen Date: Thu, 21 Mar 2013 11:36:14 +0000 Subject: [PATCH] OBJMap update to support recognizing if something has changed (refs #4183) git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@27185 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../src/org/simantics/objmap/impl/Mapping.java | 8 +++++--- .../src/org/simantics/objmap/impl/RangeUpdateRequest.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/org.simantics.objmap/src/org/simantics/objmap/impl/Mapping.java b/org.simantics.objmap/src/org/simantics/objmap/impl/Mapping.java index cf4c33c9..abb726e7 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/impl/Mapping.java +++ b/org.simantics.objmap/src/org/simantics/objmap/impl/Mapping.java @@ -275,12 +275,14 @@ public class Mapping implements IMapping { if(listensDomain) { RangeUpdateRequest request = new RangeUpdateRequest(link, map, this); try { - g.syncRequest(request, request); + boolean modified = g.syncRequest(request, request); + if(modified) { + updated.add(link.rangeElement); + } } catch (DatabaseException e) { throw new MappingException(e); } - // TODO check if really modified - updated.add(link.rangeElement); + } else if(link.type.updateRange(g, map, link.domainElement, link.rangeElement)) diff --git a/org.simantics.objmap/src/org/simantics/objmap/impl/RangeUpdateRequest.java b/org.simantics.objmap/src/org/simantics/objmap/impl/RangeUpdateRequest.java index 3268d9e2..4c190658 100644 --- a/org.simantics.objmap/src/org/simantics/objmap/impl/RangeUpdateRequest.java +++ b/org.simantics.objmap/src/org/simantics/objmap/impl/RangeUpdateRequest.java @@ -38,9 +38,9 @@ public class RangeUpdateRequest implements Read, SyncListener @Override public Boolean perform(ReadGraph g) throws DatabaseException { if(map != null) { - link.type.updateRange(g, map, link.domainElement, link.rangeElement); + boolean updated = link.type.updateRange(g, map, link.domainElement, link.rangeElement); map = null; - return Boolean.TRUE; + return updated; } else if(mapping != null) { mapping.domainModified(link); -- 2.47.1