Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » The judgement of DDiagramElementSynchronizer.isSameDescription()(The judgement of DDiagramElementSynchronizer.isSameDescription())
The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784680] Mon, 02 April 2018 08:38 Go to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
private boolean isSameDescription(StyleDescription bestStyleDescription, Style style, Style bestStyle) {
return bestStyleDescription == style.getDescription() && bestStyle.eClass().equals(style.eClass());

About this function, we think that maybe the judgement of bestStyle.eClass().equals(style.eClass()) is redundant. If the StyleDescription is same, the class of the Style is also same. So why Sirius needs to judge the class of Style?

In our analysis, if deleting the jugement of Style'class, the performance of style refresh maybe improved. About the DDiagramElementSynchronizer.refreshStyle(), when the StyleDescription is same, there is no need to invoke mappingHelper.getBestStyle() which will create a new Style and update the Style according to StyleDescription.

We hope anyone can give us some advise or explaination about this problem.

[Updated on: Mon, 02 April 2018 08:39]

Report message to a moderator

Re: The judgement of DDiagramElementSynchronizer.isSameDescription() [message #1784941 is a reply to message #1784680] Fri, 06 April 2018 07:42 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 554
Registered: July 2009
Senior Member
This code has not changed for a long time, so my memory is a little fuzzy, but from what I remember the test is actually needed to handle cases where style customizations are applied. This may not be the case in your own modeler, but there are several mechanisms (conditional styles, style customizations, mapping imports which override the default style, etc.) where the relationship between a Style instance and StyleDescription are more complex than they look at first glance, and this test is needed to handle those.

Pierre-Charles David - Obeo

Need training or professional services for Sirius?
Previous Topic:Mapping of a group of instances as a node in a diagram
Next Topic:Is there parallel operation in Sirius?
Goto Forum:

Current Time: Thu Jan 21 12:33:48 GMT 2021

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

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

Back to the top