]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/adapter/RouteGraphConnectionClassFactory.java
Bringing layers back to life
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / adapter / RouteGraphConnectionClassFactory.java
index 4e15608a61e0e4da754eea6f9b1d5c3628ade90b..82d24938005c2e542c8eda10422bf9112291c6f5 100644 (file)
@@ -21,6 +21,7 @@ import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.Session;
+import org.simantics.db.common.procedure.guarded.GuardedAsyncProcedureWrapper;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.AsyncProcedure;
 import org.simantics.diagram.adapter.RouteGraphUtils.BackendConnection;
@@ -89,6 +90,14 @@ public class RouteGraphConnectionClassFactory extends SyncElementFactory {
         return DIA.Connection;
     }
 
+    @Override
+    public void load(AsyncReadGraph graph, final ICanvasContext canvas, final IDiagram diagram,
+            final Resource elementResource, final IElement element, final AsyncProcedure<IElement> procedure) {
+        GuardedAsyncProcedureWrapper<IElement> guard = new GuardedAsyncProcedureWrapper<IElement>(procedure, 2);
+        super.load(graph, canvas, diagram, elementResource, element, guard);
+        ElementFactoryUtil.loadLayersForElement(graph, diagram, element, elementResource, guard);
+    }
+
     @Override
     public void load(ReadGraph graph, ICanvasContext canvas, IDiagram diagram, final Resource connection,
             IElement element) throws DatabaseException {