}
}
+ public GraphToDiagramSynchronizer getGraphToDiagramSynchronizer() {
+ return synchronizer;
+ }
+
protected CopyPasteStrategy getCopyPasteStrategy() {
try {
CopyPasteStrategy cpStrategy = Simantics.getSession().syncRequest(new PossibleAdapter<CopyPasteStrategy>(resource, CopyPasteStrategy.class));
ctx.add( new ElementInteractor() );
ctx.add( new Selection() );
ctx.add( new DiagramParticipant() );
- ctx.add( new ElementPainter(false) );
+ ctx.add( new ElementPainter(true) );
//ctx.add( new ElementHeartbeater() );
ctx.add( new ZOrderHandler() );
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.Connection)),
- 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;
try {
// FIXME: I have no idea if this works or not..
- diagram = SimanticsUI.getSession().syncRequest(new Read<IDiagram>() {
+ diagram = Simantics.getSession().syncRequest(new Read<IDiagram>() {
@Override
public IDiagram perform(ReadGraph graph) throws DatabaseException {
IDiagram d = synchronizer.loadDiagram(new NullProgressMonitor(), graph, null, structuralPath.resources[0], null, structuralPath.removeFromBeginning(0), hints);