X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.update%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fupdate%2Fmodel%2FUpdateTree.java;h=a2066f4108c33e35a92d10b28ab9314c2153c34f;hb=51ca3975e1d4137e189e5e0beedc4efd137af142;hp=739667228a01291bea2cdf07789e719b72624672;hpb=ea8430990a15eb2820ed85d637cc7db8dd4fc7d4;p=simantics%2Finterop.git diff --git a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateTree.java b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateTree.java index 7396672..a2066f4 100644 --- a/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateTree.java +++ b/org.simantics.interop.update/src/org/simantics/interop/update/model/UpdateTree.java @@ -7,7 +7,6 @@ import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; import org.simantics.interop.test.GraphChanges; -import org.simantics.interop.update.model.UpdateNode.Status; public class UpdateTree { @@ -21,7 +20,7 @@ public class UpdateTree { public UpdateTree(ReadGraph g, GraphChanges changes, UpdateOperations updateOps) throws DatabaseException { this.changes = changes; this.nodes = new HashMap(); - this.rootNode = createNode(g, Status.EXIST, changes.getResource1()); + this.rootNode = createNode(g, UpdateStatus.EXIST, changes.getResource1()); nodes.put(changes.getResource1(), rootNode); nodes.put(changes.getResource2(), rootNode); this.updateOps = updateOps; @@ -41,25 +40,25 @@ public class UpdateTree { return changes; } - protected UpdateNode createNode(ReadGraph g, Status status, Resource r) throws DatabaseException { + protected UpdateNode createNode(ReadGraph g, UpdateStatus status, Resource r) throws DatabaseException { return new UpdateNode(g,status, r); } - protected UpdateNode createNode(ReadGraph g, Status status, UpdateOp op) throws DatabaseException{ + protected UpdateNode createNode(ReadGraph g, UpdateStatus status, UpdateOp op) throws DatabaseException{ return new UpdateNode(g,status, op); } private UpdateNode createNode(ReadGraph g, Resource r1, Resource r2) throws DatabaseException { UpdateNode node = null; if (r1 != null && r2 != null) { - node = createNode(g, Status.EXIST, r1); + node = createNode(g, UpdateStatus.EXIST, r1); nodes.put(r1, node); nodes.put(r2, node); } else if (r1 != null) { - node = createNode(g,Status.DELETED ,updateOps.getUpdateOp(r1)); + node = createNode(g,UpdateStatus.DELETED ,updateOps.getUpdateOp(r1)); nodes.put(r1, node); } else if (r2 != null) { - node = createNode(g,Status.NEW, updateOps.getUpdateOp(r2)); + node = createNode(g,UpdateStatus.NEW, updateOps.getUpdateOp(r2)); nodes.put(r2, node); } return node; @@ -79,7 +78,7 @@ public class UpdateTree { return node; } - protected UpdateNode getNode(Resource r) { + public UpdateNode getNode(Resource r) { return nodes.get(r); }