we use a Eclipse based tool for our model based requirement and
development process. As part of that we create documentation for models
and diagrams in a generic way (supporting several DSL's and diagram
providers like GMF and Graphiti).
To do that we have the need to export a diagram content as image in a
programatic way from a plugin in Eclipse. This documentation generation
is also available in a headless Eclipse (without UI). Now i have two
problems with Graphiti:
1. Also after migration to 0.9.x i cannot find a API to export a diagram
(model) content as image (JPG, PNG etc.) with public accessable classes.
All functionality to export a diagram as image is hidden in internal
packages strong coupled to the editor.
Is there a plan for more refactorings (like from 0.8. to 0.9) to open a
API for public diagram exports?
2. The complete image export requires a running Eclipse with UI. There
is no chance to export the diagram content without "Display".
It is possible to get the implementation for diagram export a few less
UI dependent?
Michael Wenz Messages: 1270 Registered: July 2009 Location: Walldorf, Germany
Senior Member
Ralf,
this would indeed be nice to have. There is an open feature request for that
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=370888) but currently there
are no concrete plans for this feature, simply because it was not requested
that much. In order to do so please comment on the bug.
I'm not sure if that functionality can be provided without running Eclipse
UI. The feature is internally based upon GEF drawing into a canvas which I
assume will require SWT running. But I'm not fully sure without having a
detailed look into the coding.
Alexander Nyssen Messages: 28 Registered: July 2009 Location: Lünen
Junior Member
GEF's printing support is based on the presence of a GraphicalViewer and all existing implementations of the GraphicalViewer interface (i.e. GraphicalViewerImpl and its subclasses) require an SWT control to render. In order to print offline one would IMHO have to provide a GraphicalViewer implementation that alternatively renders on a printer or into an image.
Michael Wenz Messages: 1270 Registered: July 2009 Location: Walldorf, Germany
Senior Member
Graphiti's export functionality should be based upon such an image renderer.
I put "should" here, because I'm not that familiar with the implementation,
and I'm not sure if there are other pitfalls...