How to show subset of the Sirius-based model diagram [message #1806671] |
Mon, 13 May 2019 10:53  |
Eclipse User |
|
|
|
Hello
I would like to show a subset of a Sirius-based model diagram. Let's take a basicfamily sample model as an example. If I select (by clicking) "Elias" and with some action, I would like to show the diagram consisting of "Elias " and his parents and children (i.e. persons including the target instance with directly connected person/node instances) by hiding all the other node and link instances. What approach would be the most appropriate to achieve this? Would it be defining a layer, or a filter, or a person's instance centered diagram, or something else?
Thank you very much for your help in advance.
Akira
|
|
|
Re: How to show subset of the Sirius-based model diagram [message #1806672 is a reply to message #1806671] |
Mon, 13 May 2019 11:32   |
Eclipse User |
|
|
|
Hello,
Indeed, in this case, you will need a diagram where the domain class is a person. This will need new node mappings to display the parents and children as nodes. However, you should be able to reuse the same edge mappings as the "main" diagram description for the parents and children references as well as the tools.
Once the new sub diagram description is available in your VSM (odesign file), you will automatically be able to create the sub diagram from the main diagram when you select an element of the type of the sub diagram domain class. To make it simpler with your example, when you select Elias and right click, you will have a menu "New" to create the sub diagram and an "Open" diagram if one already exists. You are not required to add a tool, but if you want you can add a Double click tool with a navigation task to open the sub diagram with a double click on Elias.
Regards,
Steve
|
|
|
|
|
|
Re: How to show subset of the Sirius-based model diagram [message #1807011 is a reply to message #1806958] |
Tue, 21 May 2019 05:20  |
Eclipse User |
|
|
|
Hello,
1) You should have automatically the New and Open contextual menu to open a sub-diagram so I imagine that you ask the question in the context of a tool you are adding. Depending on what you are doing it should be accessible by aql:self or var:element. If this is not the case, I will need more information.
2) It's not really the usual approach of variable filter (I mean triggering a filter and using the current selection) so I can't find a sample from the top of my head, sorry. You can define new variables on your tool but I do not think you will be able to have the selected element easily (or at all). The simplest way is probably to directly access the active editor (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()), access the current selection in the editor and get the semantic element.
Regards,
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.21336 seconds