Home » Modeling » GMF (Graphical Modeling Framework) » Multiple Plugins, same Domain Model, DND
Multiple Plugins, same Domain Model, DND [message #549875] |
Wed, 28 July 2010 10:07 |
masija . Messages: 59 Registered: July 2010 |
Member |
|
|
Hi @ all,
I have to develope a GMF plugin, which enables me to create different diagram types of the same domain model.
In addition it must be possible, to add some elements from diagram A to Diagram B with drag and drop.
(And display detailed properties for each element in the diagram)
For example Diagram A contains elements a, b and c
Diagram B contains elements d, e and the element a from Diagram A.
I figured out how to enable drag and drop support, to drag the elements from Diagram A to B.
In the properties view I also have some information about references to other elements.
But if I now change the original element a in Diagram A, for example add or delete a connection to a nother element, the two diagrams come out of sync.
Now the element a in Diagram B disappears out of the canvas, just leaving a connection pointing to nothing.
Does anyone have a hint for me how to solve this problem?
Best Regards
masija
|
|
|
Re: Multiple Plugins, same Domain Model, DND [message #550057 is a reply to message #549875] |
Thu, 29 July 2010 00:57 |
Pantelis Petridis Messages: 10 Registered: February 2010 |
Junior Member |
|
|
Hello Masija,
i think you need a sharedEditingDomain.
editingDomain holds information on the diagram and its underlying model.
I guess your problem is that whenever a new editor is opened, GMF
creates a new editingDomain. Therefore multiple instances of your model
exist in the memory, but they are not interconnected.
Maybe GMFTools can be of a help to you:
http://code.google.com/p/gmftools/
Make sure you also read this:
http://code.google.com/p/gmftools/wiki/SharedEditingDomain
On 28/7/2010 1:07 μμ, Masija wrote:
> Hi @ all,
>
> I have to develope a GMF plugin, which enables me to create different
> diagram types of the same domain model.
>
> In addition it must be possible, to add some elements from diagram A to
> Diagram B with drag and drop.
> (And display detailed properties for each element in the diagram)
> For example Diagram A contains elements a, b and c
> Diagram B contains elements d, e and the element a from Diagram A.
>
> I figured out how to enable drag and drop support, to drag the elements
> from Diagram A to B.
> In the properties view I also have some information about references to
> other elements.
>
> But if I now change the original element a in Diagram A, for example add
> or delete a connection to a nother element, the two diagrams come out of
> sync.
> Now the element a in Diagram B disappears out of the canvas, just
> leaving a connection pointing to nothing.
>
> Does anyone have a hint for me how to solve this problem?
>
> Best Regards
> masija
>
|
|
| | | |
Re: Multiple Plugins, same Domain Model, DND [message #553886 is a reply to message #549875] |
Thu, 19 August 2010 10:27 |
masija . Messages: 59 Registered: July 2010 |
Member |
|
|
Hi Fernando,
gmf-tools provides indeed a good sollution for this problem.
http://code.google.com/p/gmftools/wiki/SharedEditingDomain
You can follow this wiki step by step and change your models by hand, or you can use the gmf-tools functionality... (which didnt work correctly for me, because i didnt want to use the gallileo release)
After this step, you have two (or more) plugins (based on the same .ecore) sharing the same editing domain.
The next problem was, that now every change in the domain model will be reflected in every open diagram...
I don't know if you want to use this feature of gmf (see CanonicalDiagramEditingPolicy).
For my use case, the canonical behavior didn't fit, becaus i just wanted to display a part of the domain model.
Here gmftools also provides a good solution:
SemiCanonicalDiagramEditPolicy - only Diagram Elements are updated, model elements which have no representation are ignored.
If you are interested in this behavior take a look at
http:// code.google.com/p/gmftools/wiki/SemiCanonicalDiagramEditPoli cy which is a step by step "tutorial" on how to implement the semi canonical behavior...
Of you want to use the semi canonical behavior, provided by gmftools, you should also use theire dnd-policy...
best regards, and feel free to ask if you need any help
masija
[Updated on: Thu, 19 August 2010 11:07] Report message to a moderator
|
|
| | | |
Goto Forum:
Current Time: Fri Nov 08 21:56:27 GMT 2024
Powered by FUDForum. Page generated in 0.03565 seconds
|