Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Export Graphiti diagram image via API
Export Graphiti diagram image via API [message #985611] Thu, 15 November 2012 14:33 Go to next message
Eclipse UserFriend
Hi,

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?

Regards
Ralf
Re: Export Graphiti diagram image via API [message #985809 is a reply to message #985611] Fri, 16 November 2012 08:58 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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.

Michael
Re: Export Graphiti diagram image via API [message #986500 is a reply to message #985809] Tue, 20 November 2012 16:33 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior 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.
Re: Export Graphiti diagram image via API [message #986738 is a reply to message #986500] Wed, 21 November 2012 13:50 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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...

Michael
Previous Topic:Create graphical elements by create new diagram
Next Topic:AddGraphicalRepresentation doesn't carry properties
Goto Forum:
  


Current Time: Sat Apr 20 01:39:41 GMT 2024

Powered by FUDForum. Page generated in 0.02911 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top