Diagram stores all pictogramLinks - simplify xml [message #1817497] |
Sun, 24 November 2019 20:14  |
Eclipse User |
|
|
|
Hi,
I try to simplify the stored xml representing pictogram elements. I have limited set of element types so I don't need to store in each element complete graphicsAlgorithm. I started to do it by creating my custom model that inherits from platform:/resource/org.eclipse.graphiti.mm/model/graphiti.ecore#//pictograms/ and overrides methods that create Pictogram elements on the fly.
I have question about pictograms/Diagram. As I see, it stores all pictogram links that are created by org.eclipse.graphiti.features.impl.AbstractFeatureProvider.link method. Why this knowledge is necessary on the level of Diagram?
Or maybe my whole approach is wrong and I should resign from inheriting graphiti.ecore and build model from scratch?
|
|
|
|
Re: Diagram stores all pictogramLinks - simplify xml [message #1817509 is a reply to message #1817498] |
Mon, 25 November 2019 09:19   |
Eclipse User |
|
|
|
Marek,
yes, the links are used to establish the logical connection between business objects and their graphical representation. It can be used to connect any Graphiti diagram object to the represented EMF object; in fact any Java obejct could be connected but that requires some addional effort in hooking in.
Unfortunately I cannot tell what the concrete reason was to make the link model separate, the reason for storing it on diagram level was to improve performance when collecting all the links (no need to dive into the object tree).
Regarding your original question, I'm not sure if I can help there. I have not tried anything like this before; an idea that came to my mind when I read it, was to change the EMF serialization, but I'm not sure if that will be of any help for you.
Michael
|
|
|
Re: Diagram stores all pictogramLinks - simplify xml [message #1818147 is a reply to message #1817509] |
Sun, 08 December 2019 16:25   |
Eclipse User |
|
|
|
Thank you,
I still try to give a shot to overload model. I have additional question to that. What attributes "visible" and "active" on PictogramElement for are and what is their lifecycle? I guess that by changing visible to false I could hide element. But active? By default I see that for all ContainerShape in xml these attributes are set to true.
I am asking because when I overload isActive methods to return always true, I got StackOverflow exception because of endless refreshing.
Marek
|
|
|
|
Re: Diagram stores all pictogramLinks - simplify xml [message #1818169 is a reply to message #1818148] |
Mon, 09 December 2019 09:51   |
Eclipse User |
|
|
|
Hi Marek,
active in short means that an object can be clicked and selected, there is some more behind in some scenarios, but that probably goes to deep for this.
The method isObjectAlive determines if an object is really part of the model, e.g. after delete the object might still be in memory but not part of an EMF resource or in creation the object might be created but not yet hooked into the model. For some operation we need to map an object to a file, that's why we check for the EMF resource as well.
Hope that helps.
MIchael
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06142 seconds