Faster way of removing graphiti elements [message #1121225] |
Mon, 30 September 2013 11:53 |
PALANI SANKAR Messages: 35 Registered: April 2013 |
Member |
|
|
Hi All
I am working on a use case where i have a tree inside graphiti editor and on selection of each tree node , different graphiti elements needs to appear , as it is a single editor what i am doing is i am removing the elements and redrawing. currently i am facing a performance issue that on doing removal if there are more elements it is taking much time to remove the elements. can anyone tell me how can i remove elements
without affecting the performance.is there any other way other than remove feature.
It would be helpful if some suggest a way to improve the performance on the above scenario.
Thanks
Palani
Thanks
Palani
|
|
|
Re: Faster way of removing graphiti elements [message #1122104 is a reply to message #1121225] |
Tue, 01 October 2013 08:28 |
Andreas Graf Messages: 211 Registered: July 2009 |
Senior Member |
|
|
Hi Palani,
regarding the deletion, I suspect that there might be room for improvement in Graphiti, however I have not done an in-depth analysis.
DefaultRemoveFeature.remove calls Graphiti.getPeService().deletePictogramElement(pe);
which seems to be doing a depth-first traversal of the tree, invoking EcoreUtil.delete
on the elements.
EcoreUtil.delete tries to find all cross references to the object to be removed (and, possibly, its children). This is called quite often.
I am not sure that this might not lead to performance impact for larger diagrams and domain models (note that EcoreUtil.delete will try to find references from your domain model to your diagram as well - the entire ResourceSet is checked).
Maybe the Graphiti experts could elaborate on this approach and the reason for not just calling EcoreUtil.delete on the object to be removed and letting EcoreUtil do all the recursion?
[Updated on: Tue, 01 October 2013 08:44] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04358 seconds