Skip to main content



      Home
Home » Eclipse Projects » Sirius » Adding a new edge in a diagram extension(Edge has source and target in original meta-model)
Adding a new edge in a diagram extension [message #1735589] Tue, 21 June 2016 06:51 Go to next message
Eclipse UserFriend
Hi all,

currently I'm working on my master's thesis and got a little stuck during the implementation of a diagram extension.
First of all, I got a core meta-model and an extension which are built in a way that the extension knows the core meta-model but the core meta-model doesn't know the extension. There is a root meta-class in the core as well as in the extension while the root class in the extension extends the root class in the core so that I can create and choose all elements from both meta-models.

However, I also created a new relation in the extension that connects two elements in the core meta-model together. Both elements are represented by my base editor. For the representation of the extension I created a diagram extension as I don't want to alter the base editor directly (Since not everybody needs to use my extension). Is there any way where I can create the new edge in the extension and refer to the node mappings of the base editor if the extension and the base editor are both in separate .odesign files?
And, if there is no way in doing so, is there another way of creating that specific edge without altering the base editor?
Hope my request isn't too confusing.

Greetings,
Michael
Re: Adding a new edge in a diagram extension [message #1735724 is a reply to message #1735589] Wed, 22 June 2016 05:12 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

You can find here an example that show to you 2 solutions.

I try to reproduce a simple metamodele, as describe in your comments.
(joined in core-extensionMM.zip).

The first solution use the node mapping import with DiagramCore and
DiagramExtension. (joined in fr.obeo.core.extension.design.zip).
You can see in core-extension.odesign 2 representations diagram defined.
The first representation describe only the 2 mappings defined in Core
metamodel.
The second representation, use the node import of A and B mapping and
defined a relation mapping.


The second solution use 2 specifications files (2 odesign). In this case
you can, as an EMF Model, load an odesign and use the mapping import.
The second specification file is extension.odesign. It using the node
mapping import of mapping A and B defined in core-extension.odesign.

To show the result you can open the representations in model directory.

Regards,
--
Julien - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Adding a new edge in a diagram extension [message #1735752 is a reply to message #1735724] Wed, 22 June 2016 08:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

thank you for your answer this helps a lot Smile
Is that also possible when using the diagram extension mechanism Sirius offers and if the extension root element only references, but not extends the core root class? As far as I know the root node in the odesign extension is the same as in the core odesign. How would I then access the root node of my extension? My only attempt would then be to add a Java Extension and implement a method which returns the desired root element. Does that work or is there an easier way to access the root node of an extension from inside the diagram extension mechanism?

Regards,
Michael
Re: Adding a new edge in a diagram extension [message #1735756 is a reply to message #1735752] Wed, 22 June 2016 09:26 Go to previous message
Eclipse UserFriend
I'm not sure to understand your problem.

In example I was given you, the root element in the representation
DiagramExtension or in Diagram2Extension is extension.Root. In
DiagramCore the root is core.Root. It's not the same object.

If extension.Root does not extend core.Root, does not change the Sirius
mechanism. So, you can remove the extension of core.Root in
extension.Root. I tested it in example I was given you and it's work!

Is that also possible when using the diagram extension mechanism Sirius
offers and if
the extension root element only references, but not extends the core
root class? Yes!



As far as I know the root node in the odesign extension is the same as
in the core odesign.
No! In odesign extension it's extension.Root and in core odesign it's
core.Root.


--
Julien - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Creating the instance of the dropped object in the new file
Next Topic:Two diagram problems on Linux machines
Goto Forum:
  


Current Time: Tue Mar 18 01:07:49 EDT 2025

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

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

Back to the top