Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Ecore model instance to Eugenia
Ecore model instance to Eugenia [message #1793230] Wed, 01 August 2018 20:23 Go to next message
Maude Sabourin is currently offline Maude SabourinFriend
Messages: 11
Registered: May 2018
Junior Member
I need to have the Eugenia GMF Editor open up with a programatically given diagram.

So far I've been able to do the following

- From XText grammar, generate Ecore
- Create an Emfatic file (and regen Ecore)
- Generate GenModel
- Generate a GMF Editor with Eugenia

The next step is to

- In the diagram editor, with the mouse, select entities, make links, etc.

Ex : I could create 2 entities A and B and have a link between each.

However, I would like the diagram editor to show up with this configuration already.

I'm looking for guides, tutorials, information on how I could code this configuration prior to generating the GMF Editor.

I currently have an ecore model instance that has something similar to
Entity A
Entity B
Link (A,B)


So I could just pull the information from that file and code the diagram. I still need the editor because the end user could afterwards modify this diagram.

Note : I am very new to these tools so beginner explanations or references are preferred.

Thanks a lot







Re: Ecore model instance to Eugenia [message #1793258 is a reply to message #1793230] Thu, 02 August 2018 09:15 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Maude,

Assuming I understand your question, if you right-click on your model file in the package/project explorer, you should find an "Initialize ... diagram" menu item which does what you're asking for.

Cheers,
Dimitris
Re: Ecore model instance to Eugenia [message #1793277 is a reply to message #1793258] Thu, 02 August 2018 16:21 Go to previous messageGo to next message
Maude Sabourin is currently offline Maude SabourinFriend
Messages: 11
Registered: May 2018
Junior Member
Hi Dimitris,

Thank you for your answer.

However, the steps you defined are not what I need

1. The diagram obtained is the Ecore diagram. I need a diagram for an instance of the Ecore model.

2. I need a diagram editor with the diagram, not just the diagram

3. I need the steps to do this task programatically (i.e. using code) since the end goal is to have a script take an instance and make it into an Eugenia graph editor


Let me try to specify what I need


Suppose the Ecore Diagram given in attachment 1

I then have a file with the following content
Block A
Block B


An image of that model instance in Eclipse is shown in attachment 2

When I open the Eugenia GMF Editor, I would like to see this already there : see attachment 3

I don't want to have to make it by hand using my mouse.

----------------------------------------------------------------------------------
Update : I have noticed that the code to make the graph seems to be in a XML file.

That file contains the following

<?xml version="1.0" encoding="UTF-8"?> 
<canNoEx:Domainmodel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:canNoEx="http://www.xtext.org/example/canardNoExtends/CanNoEx"> 
  <elements xsi:type="canNoEx:Block" name="A"/> 
  <elements xsi:type="canNoEx:Block" name="B"/> 
</canNoEx:Domainmodel> 


I tried to test by adding
  <elements xsi:type="canNoEx:Block" name="C"/> 

But the Editor did not update the Diagram
Re: Ecore model instance to Eugenia [message #1793278 is a reply to message #1793277] Thu, 02 August 2018 16:34 Go to previous messageGo to next message
Maude Sabourin is currently offline Maude SabourinFriend
Messages: 11
Registered: May 2018
Junior Member
I did another test with a new project and this time, adding the C Block line worked. The diagram editor was updated!

The last step I need to do is find out how to automate all of these tasks.
Re: Ecore model instance to Eugenia [message #1793281 is a reply to message #1793278] Thu, 02 August 2018 22:41 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Maude,

> 1. The diagram obtained is the Ecore diagram. I need a diagram for an instance of the Ecore model.

To initialise a diagram for your model (My.canNoEx) you should right-click on it and select "Initialize ... diagram"

> 3. You can find the code that initialises a diagram from a model (i.e. the code behind the "Initialize ... diagram" menu item) in the generated .diagram plugin. I don't remember the name of the class off the top of my head but if you can't find it, please let me know and I'll have a look.

Cheers,
Dimitris
Previous Topic:redistribute to non-mde users
Next Topic:Cannot find Java class from standalone EOL plugin
Goto Forum:
  


Current Time: Tue Apr 23 15:33:53 GMT 2024

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

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

Back to the top