Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Rendering models programmatically(Rendering models programmatically)
Rendering models programmatically [message #1732717] Thu, 19 May 2016 13:31 Go to next message
Rick Bouten is currently offline Rick BoutenFriend
Messages: 2
Registered: May 2016
Junior Member
Hi all,

I am part of a team that is making a tool that supports the migration of meta-models in a (somewhat) user-friendly way. In this tool (which is an eclipse-plugin) we make use of both Edapt and Sirius and add own code to fulfill our needs.

We however have stumbled upon a problem.

We would like to have a perspective with four views in which renders are shown of the models to be migrated. Two of the metamodel (one pre-migration and one post-migration) and two of an example of an instance of this metamodel (one pre- and one post-migration).

Now we know that it is possible to create dynamic instances of a metamodel in the same Eclipseinstance (which is necessary to be able to show all four renders in the same perspective), which gives us a .xmi file in which the model is stored. Another option is to install the metamodel as a plugin in the same instance of Eclipse in which the metamodel is defined to create an instance of that model in that way.

We however don't know how to make a graphical representation (not a tree/hierarchical representation but with rectangles and arrows and the like) of this model programmatically. Preferably we would have some piece of code which either makes the view with the graphical representation in it directly or creates a file which one can open by double-click.

We have looked at creating a generic viewpoint specification model to use for all this model rendering but this clearly isn't made to be generic and we didn't got this working. For our needs a single viewpoints specification would be sufficient.

Does anybody have a suggestion how we could tackle this problem or give us some inspiration such that we ourselves could solve this? If anything is still unclear, feel free to ask.

Kind regards,
Rick Bouten
Re: Rendering models programmatically [message #1733070 is a reply to message #1732717] Tue, 24 May 2016 08:32 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Le 23/05/2016 à 14:39, Rick Bouten a écrit :
> Hi all,
Hello
>
> I am part of a team that is making a tool that supports the migration of
> meta-models in a (somewhat) user-friendly way. In this tool (which is an
> eclipse-plugin) we make use of both Edapt and Sirius and add own code to
> fulfill our needs.
>
> We however have stumbled upon a problem.
>
> We would like to have a perspective with four views in which renders are
> shown of the models to be migrated. Two of the metamodel (one
> pre-migration and one post-migration) and two of an example of an
> instance of this metamodel (one pre- and one post-migration).
>
> Now we know that it is possible to create dynamic instances of a
> metamodel in the same Eclipseinstance (which is necessary to be able to
> show all four renders in the same perspective), which gives us a .xmi
> file in which the model is stored. Another option is to install the
> metamodel as a plugin in the same instance of Eclipse in which the
> metamodel is defined to create an instance of that model in that way.
>
> We however don't know how to make a graphical representation (not a
> tree/hierarchical representation but with rectangles and arrows and the
> like) of this model programmatically. Preferably we would have some
> piece of code which either makes the view with the graphical
> representation in it directly or creates a file which one can open by
> double-click.
> We have looked at creating a generic viewpoint specification model to
> use for all this model rendering but this clearly isn't made to be
> generic and we didn't got this working. For our needs a single
> viewpoints specification would be sufficient.
>
> Does anybody have a suggestion how we could tackle this problem or give
> us some inspiration such that we ourselves could solve this? If anything
> is still unclear, feel free to ask.

Here below are suggestions.
To represent the metamodel with Sirius you need to define a single
viewpoint which manage *.ecore as model file extension. Note that
EcoreTools has already done the job and provide an enhanced vsm. [1]

Then to have model instances you could generate two plugin your
metamodel corresponding to each version of your meta-model. That
supposes that your have changed the nsURI of your metamodel.
Then you can define RepresentationDescription such as diagram in one or
many VSM to represent your models.

To summurize:
* 1 VSM for *.ecore which covers any version of your metamodel
* two versions of your metamodel with the corresponding generated
meta-model plugin
* 1 RepresentationDescripton(in one or many VSM) per model version to
represent your model.

I hope that will help.
>
> Kind regards,
> Rick Bouten
>
[1] https://www.eclipse.org/ecoretools/


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Rendering models programmatically [message #1733114 is a reply to message #1733070] Tue, 24 May 2016 13:26 Go to previous message
Rick Bouten is currently offline Rick BoutenFriend
Messages: 2
Registered: May 2016
Junior Member
Hi,

Thank you for response.
Our issue is not in the area of making the pre and post models, but solely in the rendering of the (not-meta) model in the same eclipse instance as where the meta model is defined.
We are able to create dynamic instances of the meta model giving us a .xmi file containing the model. We are even able to install the meta model as a plugin in the Eclipse instance and creating a model as a model project that way. But we can't get it to render that model nicely. Is it possible to have some sort of generic VSM that is applicable to all models (since in the odesign there is a notion of nodeMappings which with a generic VSM cannot be set to something) and how do we assign this VSM to the dynamic instance?

Kind regards,
Rick Bouten
Previous Topic:Reloading problem of the diagram editor
Next Topic:Creating new a new file
Goto Forum:
  


Current Time: Thu Apr 18 05:36:00 GMT 2024

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

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

Back to the top