Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Generating ecore diagram image file programmatically
Generating ecore diagram image file programmatically [message #758707] Thu, 24 November 2011 10:45 Go to next message
Paulius  is currently offline Paulius Friend
Messages: 3
Registered: November 2011
Junior Member
Hi,

I have a m2m tool which output is ecore metamodel. It works outside eclipse as a command line tool.

I would like to generate class diagram (in svg, png, or some other format) file from the newly created ecore metamodel. I looked at org.eclipse.emf.ecoretools.diagram packages, but haven't been able to figure out how to use it.

I would really appreciate any tips or hints on how to best achieve this task. Thank you.



Paulius
Re: Generating ecore diagram image file programmatically [message #758724 is a reply to message #758707] Thu, 24 November 2011 12:00 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Paulius,

I don't know the answer, but what I'd do to find it myself is set a
breakpoint in the constructor of some notation model class that I know
is created and used in the final diagram that the wizard produces. Then
I would look up the stack to see what leads to the creation of the diagram.


On 24/11/2011 11:45 AM, Paulius wrote:
> Hi,
>
> I have a m2m tool which output is ecore metamodel. It works outside
> eclipse as a command line tool.
>
> I would like to generate class diagram (in svg, png, or some other
> format) file from the newly created ecore metamodel. I looked at
> org.eclipse.emf.ecoretools.diagram packages, but haven't been able to
> figure out how to use it.
> I would really appreciate any tips or hints on how to best achieve
> this task. Thank you.
>
>
>
> Paulius


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generating ecore diagram image file programmatically [message #758973 is a reply to message #758724] Fri, 25 November 2011 12:42 Go to previous messageGo to next message
Paulius  is currently offline Paulius Friend
Messages: 3
Registered: November 2011
Junior Member
Thanks!
I debugged and saw that diagram notation instance is created in ViewService.createDiagram(...). Then I can export image using OffscreenEditPartFactory and CopyToImageUtil.

However ViewService needs to have a plugin activated (in this case I guess its EcoreDiagramEditorPlugin). I am not sure how to embed Plugin in my headless application. Any ideas?


Paulius
Re: Generating ecore diagram image file programmatically [message #759008 is a reply to message #758973] Fri, 25 November 2011 14:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Paulius,

I don't know anything about ViewService other that it's part of the GMF
runtime and hence it's more of a GMF question. I don't see why it needs
to use EcoreDiagramEditorPlugin.


On 25/11/2011 1:42 PM, Paulius wrote:
> Thanks! I debugged and saw that diagram notation instance is created
> in ViewService.createDiagram(...). Then I can export image using
> OffscreenEditPartFactory and CopyToImageUtil.
>
> However ViewService needs to have a plugin activated (in this case I
> guess its EcoreDiagramEditorPlugin). I am not sure how to embed Plugin
> in my headless application. Any ideas?
>
>
> Paulius


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Generating ecore diagram image file programmatically [message #759087 is a reply to message #758973] Sat, 26 November 2011 08:42 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 25.11.2011 13:42, schrieb Paulius:
> Thanks! I debugged and saw that diagram notation instance is created in ViewService.createDiagram(...). Then I can
> export image using OffscreenEditPartFactory and CopyToImageUtil.
>
> However ViewService needs to have a plugin activated (in this case I guess its EcoreDiagramEditorPlugin). I am not
> sure how to embed Plugin in my headless application. Any ideas?
That's what I found out a couple of weeks ago and gave up on this goal ;-(

If you find a solution please report it here!

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:[Teneo] How to store an existing model from XMI to MySQL database
Next Topic:[Teneo] Change the default DDL created by Teneo
Goto Forum:
  


Current Time: Sat Apr 20 04:22:02 GMT 2024

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

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

Back to the top