X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FModelUpdate.java;fp=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FModelUpdate.java;h=cbdfc8f48f5cefe15c5b2ffe570b0201b269c509;hb=3c9703b0855a8d19d515ae38fa16b4d2bea645df;hp=e736e22e8747758bf2aa640936ae788d102b4c07;hpb=fad28e2a01ee43b7448cffaef1bc6ba2eed84e39;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java index e736e22..cbdfc8f 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java @@ -71,7 +71,7 @@ public abstract class ModelUpdate { showWarning(result2.second); comparator2.test(getSession()); changes2 = comparator2.getChanges(); - changes2 = getSession().syncRequest(new FilterChangesRead(changes2, filters)); + changes2 = getSession().syncRequest(createFilterRead(changes2, filters)); updateTree2 = getUpdateTree(changes2); updateList2 = getUpdateList(changes2); @@ -82,7 +82,7 @@ public abstract class ModelUpdate { showWarning(result3.second); comparator3.test(getSession()); changes3 = comparator3.getChanges(); - changes3 = getSession().syncRequest(new FilterChangesRead(changes3, filters)); + changes3 = getSession().syncRequest(createFilterRead(changes3, filters)); } Pair result = getChanges(oldModel,newModel); @@ -124,7 +124,7 @@ public abstract class ModelUpdate { } comparator.test(getSession()); changes = comparator.getChanges(); - changes = getSession().syncRequest(new FilterChangesRead(changes, filters)); + changes = getSession().syncRequest(createFilterRead(changes, filters)); updateTree = getUpdateTree(changes); updateList = getUpdateList(changes); if (userFilters.size() != 0) { @@ -194,7 +194,7 @@ public abstract class ModelUpdate { // Create filtered changes List combined = new ArrayList<>(filters); combined.addAll(userFilters); - GraphChanges filteredChanges = getSession().syncRequest(new FilterChangesRead(changes, combined)); + GraphChanges filteredChanges = getSession().syncRequest(createFilterRead(changes, combined)); UpdateTree updateTreeF = getUpdateTree(filteredChanges); UpdateList updateListF = getUpdateList(filteredChanges); // hide changes that are not contained within the filtered changes. @@ -339,6 +339,10 @@ public abstract class ModelUpdate { return Simantics.getSession(); } + public Read createFilterRead(GraphChanges changes, List filters) { + return new FilterChangesRead(changes, filters); + } + public static class FilterChangesRead implements Read {