export ecore model to an image [message #219630] |
Sat, 21 February 2009 06:06  |
Eclipse User |
|
|
|
Hello!
I'm developing an application, that handles ecore models and diagrams. One
part should be, that diagrams are exported to image files automatically by
the application. There should be no diagram editor visible to the user. So
the solution with the context menu doesn't work.
I have a model and a diagram file and what I want to get is an image file.
Is there a possibility to use parts of gmf and emft to do this?
Sebastian
|
|
|
|
|
Re: export ecore model to an image [message #219677 is a reply to message #219660] |
Sat, 21 February 2009 14:21  |
Eclipse User |
|
|
|
To get to Diagram object I tried to use the EcoreTools Plugin.
Resource resource =
EcoreDiagramEditorUtil.createDiagram(diagramURI,
modelURI, new SilentProgressMonitor());
Diagram diagram = (Diagram) resource.getContents().get(0);
With this I get a Diagram, but the export to an SVG-Imgae results only in
a SVG-Document with no graphical elements in it.
DiagramEditPart diagramEditPart = OffscreenEditPartFactory
.getInstance().createDiagramEditPart(diagram, new Shell());
CopyToImageUtil copyToImageUtil = new CopyToImageUtil();
copyToImageUtil.copyToImage(diagramEditPart, destination,
ImageFileFormat.SVG, new SilentProgressMonitor());
Where could be a mistake?
regards
Sebastian
|
|
|
Powered by
FUDForum. Page generated in 0.07447 seconds