Hi all,
after having created a new diagram with the following code:
// Create the diagram
final Diagram newDiagram = Graphiti.getPeCreateService().createDiagram(componentID, diagramName, true);
I need to programmtically create shapes and connections in it. How can I get the IDiagramContainer instance without opening it?
Until now, what I do is this:
// Create the diagram
final Diagram newDiagram = Graphiti.getPeCreateService().createDiagram(componentID, diagramName, true);
// Create the file
final IFile newDiagramFile = diagramFolder.getFile(diagramName + "." + editorExtension); //$NON-NLS-1$
final URI uri = URI.createPlatformResourceURI(newDiagramFile.getFullPath().toString(), true);
FileService.createEmfFileForDiagram(uri, newDiagram);
// Open and save the diagram
final String providerId = GraphitiUi.getExtensionManager().getDiagramTypeProviderId(newDiagram.getDiagramTypeId());
final IDiagramContainer diagramContainer = EclipseIDEUtils.openDiagramEditor(newDiagram, providerId, editorID);
And after this I can programmtically create shapes in it.
Any idea?
Thanks for your attention
Simone
[Updated on: Wed, 05 November 2014 15:59]
Report message to a moderator