X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fsynchronization%2Fgraph%2FRouteGraphConnection.java;h=d18aa5f8e393f5645561f0c08c91c458efd634e0;hb=f496d2407d0f78557e323986a04eb2b3020d4eff;hp=933e28ba47ceb727b24ae1680c4d9f3698568844;hpb=fd61dbe6f20acdc85604f83ae50b7a18c08ff5e3;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphConnection.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphConnection.java index 933e28ba4..d18aa5f8e 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphConnection.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphConnection.java @@ -67,8 +67,7 @@ import org.simantics.utils.datastructures.Pair; public class RouteGraphConnection { private static final boolean DEBUG_SYNC = false; - private static final boolean USE_COMMAND_BASED_SYNCHRONIZATION = true; - + public static Write synchronizer(final Resource connection, final RouteGraphChangeEvent event) { return new WriteRequest() { @Override @@ -86,12 +85,14 @@ public class RouteGraphConnection { private DiagramResource DIA; private ConnectionUtil cu; private Resource connection; + private boolean commandBasedSynchronization; - public RouteGraphConnection(WriteGraph graph, Resource connection) { + public RouteGraphConnection(WriteGraph graph, Resource connection) throws DatabaseException { this.L0 = Layer0.getInstance(graph); this.DIA = DiagramResource.getInstance(graph); this.cu = new ConnectionUtil(graph); this.connection = connection; + this.commandBasedSynchronization = graph.hasStatement(connection, DIA.CommandBasedSynchronization); } private static Function ConnectionPoint; @@ -160,7 +161,7 @@ public class RouteGraphConnection { if (DEBUG_SYNC) delta.print(); - if(USE_COMMAND_BASED_SYNCHRONIZATION) { + if(commandBasedSynchronization) { initialize(graph); Layer0 L0 = Layer0.getInstance(graph);