import org.simantics.g2d.diagram.participant.pointertool.PointerInteractor;
import org.simantics.g2d.element.ElementClassProviders;
import org.simantics.g2d.element.ElementClasses;
+import org.simantics.g2d.element.IElementClassProvider;
import org.simantics.g2d.element.handler.impl.StaticObjectAdapter;
import org.simantics.g2d.multileveldiagram.TransitionFunction;
import org.simantics.g2d.multileveldiagram.ZoomTransitionParticipant;
import org.simantics.scenegraph.g2d.events.command.CommandKeyBinding;
import org.simantics.structural.stubs.StructuralResource2;
import org.simantics.structural2.modelingRules.IModelingRules;
-import org.simantics.ui.SimanticsUI;
import org.simantics.utils.datastructures.hints.HintContext;
import org.simantics.utils.datastructures.hints.IHintContext;
import org.simantics.utils.page.PageDesc;
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 = new GraphToDiagramSynchronizer(graph, ctx,createElementClassProvider(graph));
+
sync.set(ModelingSynchronizationHints.MODELING_RESOURCE, ModelingResources.getInstance(graph));
diagram = sync.loadDiagram(new NullProgressMonitor(), graph, null, resource, runtimeDiagramManager.getRuntimeDiagram(), structuralPath, initialHints); // FIXME
return sync;
return ctx.getSceneGraph();
}
+
+ protected IElementClassProvider createElementClassProvider(ReadGraph graph) throws DatabaseException {
+ DiagramResource dr = DiagramResource.getInstance(graph);
+ return ElementClassProviders.mappedProvider(
+ ElementClasses.CONNECTION, DefaultConnectionClassFactory.CLASS.newClassWith(new StaticObjectAdapter(dr.Connection)),
+ ElementClasses.FLAG, FlagClassFactory.createFlagClass(dr.Flag, dr.Flag_Terminal)
+ );
+
+ }
@Override
public void dispose() {