Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » full style refresh of Sirius diagram elements(full style refresh of Sirius diagram elements)  () 1 Vote
full style refresh of Sirius diagram elements [message #1783435] Tue, 13 March 2018 06:53 Go to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Hi

We find that there is a time-consuming process in the diagram refresh operation. When editing in a diagram which has sevral thousands elements, such as creating an new elment, DDiagramSynchronizer.refreshOperation() will refresh all elements style in the diagram. The code fragment of element style refresh show in the below:

private void handleKeptNodes(final DragAndDropTarget viewContainer, final SetIntersection<AbstractDNodeCandidate> status, Collection<AbstractDNode> keptNodes, boolean border,
IProgressMonitor monitor) {
final Iterable<AbstractDNodeCandidate> keptNodeCandidates = status.getKeptElements();
try {
monitor.beginTask(Messages.DDiagramSynchronizer_refreshNodesMsg, Iterables.size(keptNodeCandidates));
for (final AbstractDNodeCandidate keptCandidate : keptNodeCandidates) {
handleKeptNode(viewContainer, keptCandidate, keptNodes, border, new SubProgressMonitor(monitor, 1));
}
} finally {
monitor.done();
}
}

private AbstractDNode handleKeptNode(final DragAndDropTarget viewContainer, AbstractDNodeCandidate keptCandidate, final Collection<AbstractDNode> keptNodes, boolean border,
IProgressMonitor monitor) {
/* The element is already here. */
AbstractDNode keptNode = keptCandidate.getOriginalElement();
try {
monitor.beginTask(Messages.DDiagramSynchronizer_nodeRefreshMsg, 3);

final AbstractNodeMapping nodeMapping = keptCandidate.getMapping();

if (keptNode instanceof DDiagramElementContainer && nodeMapping instanceof ContainerMapping) {
final ContainerMapping keptNodeMapping = (ContainerMapping) nodeMapping;
/* handle list attribute change on mapping */
keptNode = handleListAttributeChangeOnMapping(keptNode, keptNodeMapping, viewContainer, new SubProgressMonitor(monitor, 1));

if (keptNode instanceof DNodeContainer) {
DNodeContainer dnc = (DNodeContainer) keptNode;
ContainerLayout childrenPresentation = keptNodeMapping.getChildrenPresentation();
if (dnc.getChildrenPresentation() != childrenPresentation) {
dnc.setChildrenPresentation(childrenPresentation);
}
}
} else if (!border && viewContainer instanceof DDiagramElementContainer && nodeMapping instanceof NodeMapping) {
/* Handle list attribute change on container mapping */
keptNode = handleListAttributeChangeOnContainerMapping(keptNode, nodeMapping, (DDiagramElementContainer) viewContainer, new SubProgressMonitor(monitor, 1));
}
this.sync.refresh(keptNode);
monitor.worked(1);
this.sync.refreshStyle(keptNode, nodeMapping);
monitor.worked(1);
keptNodes.add(keptNode);
} finally {
monitor.done();
}
return keptNode;
}

So we want to know why refresh all elements style in the diagram even if just modifying one element in the diagram. Maybe just refresh the modified diagram element style is OK, this can also improve editing feedback speed in large diagram.
So if anyone can give your help, and answer it? Thank you very much! I'm waiting for your answer.
Re: full style refresh of Sirius diagram elements [message #1783457 is a reply to message #1783435] Tue, 13 March 2018 10:40 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hello

Effectively, a full refresh is done after executing the tool.
Potentially, the new semantic element that you created with the tool may have impact on mapping precondition or on condition on style and so on. So potentially the whole diagram content may be impacted.

We can image that the specifier knows that there is no impact or do not want a full refresh. He could set a "partial refresh=true" on the tool or the maping.
I suggest you open a enhancement bugzilla.
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius

regards
Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: full style refresh of Sirius diagram elements [message #1783567 is a reply to message #1783457] Wed, 14 March 2018 08:31 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Thank you very much!
I have create an ehancement bug in bugzilla.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=532428
Re: full style refresh of Sirius diagram elements [message #1783671 is a reply to message #1783457] Thu, 15 March 2018 12:40 Go to previous messageGo to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi, Laurent

I saw the document (https://www.eclipse.org/sirius/doc/specifier/general/ToolsSpecification.html) says, only set Force Refresh flag on the tool can make full refresh, but as my experiments, it does full refresh even if i did not set the Force Refresh flag. Is there a bug or other consider?


Best regards!

by Keep Mind Calm
Re: full style refresh of Sirius diagram elements [message #1783692 is a reply to message #1783671] Thu, 15 March 2018 15:06 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hi,

Yes, the documentation is a little bit misleading because it is true only in manual refresh context.
* in automatic refresh, a full refresh is done : every existing diagram elements on diagram are refreshed
* in manual refresh, a full refresh is done only if "force refresh" is set on the tool

Laurent


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: full style refresh of Sirius diagram elements [message #1783705 is a reply to message #1783692] Fri, 16 March 2018 02:15 Go to previous messageGo to next message
mind calm is currently offline mind calmFriend
Messages: 57
Registered: July 2017
Member
Hi, Laurent

Thanks for your explanation.
I have an idea for performance, only refresh the current visible area of the diagram, is it possible?


Best regards!

by Keep Mind Calm
Re: full style refresh of Sirius diagram elements [message #1783758 is a reply to message #1783705] Fri, 16 March 2018 16:19 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hello

No it is not possible and, to be honest with you, we are far from having such a feature. Currently the refresh is done based on model change. You proposal would require delta refresh each time we move vertical or horizontal sliders.


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Custom layout not getting invoked
Next Topic:what happend to my table after the last update?
Goto Forum:
  


Current Time: Fri Apr 19 02:15:39 GMT 2024

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

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

Back to the top