Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Save Diagram Image Programmatically
Save Diagram Image Programmatically [message #1269095] Tue, 11 March 2014 11:21 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
I've been trying to save, PROGRAMMAtically,a graphiti diagram .

I found DefaultSaveImageFeature, which uses ExportDiagramDialog, and after analysing it, I notice there is not a easy way to do that,i.e., I don't use exportdiagramdialog, but it is used to get the figure and configure other parameters. The parameters may passed to exporter in a easy way, but to get the figure it is used the dialog, so I needed to extract the code to get the figure from that.

Is there an easy way or better way. Am I over thinking, or this must be done in this way?

Thanks.
Re: Save Diagram Image Programmatically [message #1270814 is a reply to message #1269095] Thu, 13 March 2014 14:44 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Rui,

if you don't have an editor that surely is not easy.

When you have an open editor showing the diagram you could simply reuse the
GEF figures from that. The DiagramBehavior instance holds a map of pictogram
elements to edit parts and figures and you can simply call
getFigureForPictogramElement() to get the figure for a pictogram element.

Does that help?

Michael
Re: Save Diagram Image Programmatically [message #1281704 is a reply to message #1270814] Tue, 01 April 2014 08:33 Go to previous messageGo to next message
steve dobbs is currently offline steve dobbsFriend
Messages: 15
Registered: March 2014
Junior Member
Michael,

I need to save graphiti diagram as an image programmatically as well.Can you give a snippet of the code that would use getFigureForPictogramElement() ?.

Thanks
Steve
Re: Save Diagram Image Programmatically [message #1287234 is a reply to message #1270814] Mon, 07 April 2014 15:04 Go to previous message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
HI Michael. Thanks for your answer.
I understant it wouldn't be easy, if I've no editor. But is it possible?
Can you elaborate a bit on how to get in the right Path? If you know how.

I believe I have to generate edit parts like in OffScreenFactory of GMF, but for now I didnt think about how to start.

Thanks in advance
rui
Previous Topic:Changing the default color and default size of components in Graphiti Diagram editor
Next Topic:Saving graphiti diagram as xpdl from command line.
Goto Forum:
  


Current Time: Fri Apr 26 16:52:40 GMT 2024

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

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

Back to the top