ctx = new CanvasContext(thread, sg); // By giving the scene graph instance as parameter, we can use external serializer
return initializeSceneGraph(ctx, sg, modelURI, RVI, view);
}
+
+ protected GraphToDiagramSynchronizer createSynchronizer(ReadGraph graph) throws DatabaseException {
+ DiagramResource DIA = DiagramResource.getInstance(graph);
+ return new GraphToDiagramSynchronizer(graph, ctx,
+ ElementClassProviders.mappedProvider(
+ ElementClasses.CONNECTION, DefaultConnectionClassFactory.CLASS.newClassWith(new StaticObjectAdapter(DIA.RouteGraphConnection)),
+ ElementClasses.FLAG, FlagClassFactory.createFlagClass(DIA.Flag, DIA.Flag_Terminal)
+ )
+ );
+ }
/**
* @param sg
if(val != null && navigation == null) { // Set only if navigation has not been set manually
navigation = val;
}
- GraphToDiagramSynchronizer sync = new GraphToDiagramSynchronizer(graph, ctx,
- ElementClassProviders.mappedProvider(
- ElementClasses.CONNECTION, DefaultConnectionClassFactory.CLASS.newClassWith(new StaticObjectAdapter(dr.RouteGraphConnection)),
- ElementClasses.FLAG, FlagClassFactory.createFlagClass(dr.Flag, dr.Flag_Terminal)
- )
- );
+ GraphToDiagramSynchronizer sync = createSynchronizer(graph);
sync.set(ModelingSynchronizationHints.MODELING_RESOURCE, ModelingResources.getInstance(graph));
diagram = sync.loadDiagram(new NullProgressMonitor(), graph, null, resource, runtimeDiagramManager.getRuntimeDiagram(), structuralPath, initialHints); // FIXME
return sync;