Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Avoiding multiple representations of an element in diagram
Avoiding multiple representations of an element in diagram [message #1830751] Mon, 03 August 2020 06:40 Go to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Hi,

I would appreciate your advice.
I have a diagram with multiple layers. There is a default layer presenting elements based on their type and a specific property. For example, it presents all elements of type Box provided their property "isWrapped" is set to 'true'.
I have another layer - "all elements" - that is meant to show all the elements of type Box (regardless of their set property).
When I activate the "all elements" layers, the Box elements with true "IsWrapped" appear twice. Is there a mechanism to avoid this? (other than checking the property of the elements in the "all elements" layer before creation)


Thanks,
Avi
Re: Avoiding multiple representations of an element in diagram [message #1831077 is a reply to message #1830751] Tue, 11 August 2020 09:29 Go to previous messageGo to next message
souhaila serbout is currently offline souhaila serboutFriend
Messages: 3
Registered: July 2020
Junior Member
Hi,
I think that the layers are meant to be used in a complementary way. Which means that it is normal to have duplicated representations when you aritivate both of the layers.
I suppose that the only solution to get the visualization you are searching for is to remove the elements of the default layer from the 'all elements' layer. And, when you want to visualize all the. elements, you just activate all the. layers.

Souhaila,
Re: Avoiding multiple representations of an element in diagram [message #1831138 is a reply to message #1831077] Wed, 12 August 2020 09:33 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 131
Registered: October 2019
Senior Member
Thank you Souhaila.

I was actually trying to approach what you suggested (" remove the elements of the default layer"). Is there any easy way to do it? is there a query to filter out existing diagram elements? (for example, taking a set->select(x | x does not already appear in diagram)

Thanks,
Avi
Re: Avoiding multiple representations of an element in diagram [message #1831756 is a reply to message #1831138] Fri, 28 August 2020 07:56 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Avi,

One way to have a possibility to display all elements or only the one corresponding to isWrapped=true would be to use filters: you might have a "all boxes" mapping on your default layer and then create a mapping based filter to handle the visibility of your elements. Then the user would use the filter tabbar item (the one next to the layer selection item) to select if he wants to enable a filter.

Another possibility would be to define a Wrapped Box mapping in the default layer (with the check on the wrapped attribute put in the semantic candidate expression) and all elements layer with a mapping import (same kind of mapping than the Wrapped Box mapping) referencing the Wrapped Box mapping which would have the semantic candidates expression without the wrapped attribute filter. Then Sirius will manage both mapping and will be able to keep the same diagram elements for "boxes" which corresponds to both layers. See https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#mapping_imports

Regards


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Fri, 28 August 2020 07:56]

Report message to a moderator

Previous Topic:Nest attributes of class inside container.
Next Topic:Problem to create node from palette
Goto Forum:
  


Current Time: Thu Apr 25 22:27:21 GMT 2024

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

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

Back to the top