import org.simantics.db.common.procedure.adapter.ProcedureAdapter;
import org.simantics.db.common.request.AsyncReadRequest;
import org.simantics.db.common.request.ReadRequest;
+import org.simantics.db.common.request.UniqueAsyncRead;
import org.simantics.db.common.session.SessionEventListenerAdapter;
import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.CancelTransactionException;
ArrayMap.keys(ProfileKeys.DIAGRAM, ProfileKeys.CANVAS, ProfileKeys.NODE_MAP).values(GraphToDiagramSynchronizer.this.diagram, canvas, dn),
new CanvasNotification(canvas));
- profileObserver.listen(g, GraphToDiagramSynchronizer.this);
+ g.getSession().asyncRequest(new AsyncReadRequest() {
+
+ @Override
+ public void run(AsyncReadGraph graph) {
+ profileObserver.listen(graph, GraphToDiagramSynchronizer.this);
+ }
+ });
return d;
return;
}
- // NOTICE: Layer information is loaded from the connection entity resource
- // that is shared by all segments of the same connection.
- ElementFactoryUtil.loadLayersForElement(graph, layerManager, diagram, edge, info.connection,
- new AsyncProcedureAdapter<IElement>() {
- @Override
- public void exception(AsyncReadGraph graph, Throwable t) {
- error("failed to load layers for connection segment", t);
- }
- });
+ graph.syncRequest(new AsyncReadRequest() {
+ @Override
+ public void run(AsyncReadGraph graph) {
+ // NOTICE: Layer information is loaded from the connection entity resource
+ // that is shared by all segments of the same connection.
+ ElementFactoryUtil.loadLayersForElement(graph, layerManager, diagram, edge, info.connection,
+ new AsyncProcedureAdapter<IElement>() {
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable t) {
+ error("failed to load layers for connection segment", t);
+ }
+ });
+ }
+ });
edge.setHintWithoutNotification(KEY_CONNECTION_BEGIN_PLACEHOLDER, new PlaceholderConnection(
EdgeEnd.Begin,