]> gerrit.simantics Code Review - simantics/interop.git/blobdiff - org.simantics.interop.update/src/org/simantics/interop/update/model/ModelUpdate.java
Applying enumeration (or SCL value) with model specific relation.
[simantics/interop.git] / org.simantics.interop.update / src / org / simantics / interop / update / model / ModelUpdate.java
index 2cb2883ce4f0773e6fd9e5f37dabd0bfa81b0f1b..aabe29d58c59d5e09ec2cdf8f017dc6df46a1113 100644 (file)
@@ -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());