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;h=f3fbdda5b13877a3705b55901e1057aab3bb726a;hb=refs%2Fchanges%2F43%2F4643%2F1;hp=2cb2883ce4f0773e6fd9e5f37dabd0bfa81b0f1b;hpb=7f27fe15240dbb56d9525671c44468cdbc934199;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 2cb2883..f3fbdda 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 @@ -348,12 +348,13 @@ public abstract class ModelUpdate { public void applySelected(WriteGraph graph) throws DatabaseException { Layer0Utils.addCommentMetadata(graph, "Apply selected model updates"); graph.markUndoPoint(); + + updateTree.getUpdateOps().applySelected(graph); + for (PropertyChange mod : updateList.getChanges()) { if (mod.selected()) mod.apply(graph); } - - updateTree.getUpdateOps().applySelected(graph); } @@ -490,6 +491,8 @@ public abstract class ModelUpdate { @Override public boolean accept(ReadGraph g, Modification change) throws DatabaseException { //filter floating point values that have less than 1% difference. + if (change.getLeftStm() == null || change.getRightStm() == null) + return true; if (!g.hasValue(change.getLeftStm().getObject()) || !g.hasValue(change.getRightStm().getObject())) return true; Object v1 = g.getValue(change.getLeftStm().getObject()); @@ -583,4 +586,19 @@ public abstract class ModelUpdate { public void removeListener(WarningListener listener) { warningListeners.remove(listener); } + + public void dispose() { + changes = null; + changes2 = null; + changes3 = null; + filters = null; + userFilters = null; + updateList = null; + updateList2 = null; + updateList3 = null; + updateTree = null; + updateTree2 = null; + updateTree3 = null; + updateNode3 = null; + } }