]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/RouteGraphConnection.java
Disable command based synchronization from RouteGraph Connections
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / synchronization / graph / RouteGraphConnection.java
index 933e28ba47ceb727b24ae1680c4d9f3698568844..d18aa5f8e393f5645561f0c08c91c458efd634e0 100644 (file)
@@ -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);