Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to show subset of the Sirius-based model diagram(layer or filter or object-centered diagram?)
How to show subset of the Sirius-based model diagram [message #1806671] Mon, 13 May 2019 14:53 Go to next message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 82
Registered: March 2010
Member
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 15:32 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to show subset of the Sirius-based model diagram [message #1806688 is a reply to message #1806672] Tue, 14 May 2019 00:36 Go to previous messageGo to next message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 82
Registered: March 2010
Member
Hello Steve,

Thank you very much for this quick response.

I understand your suggestion is to take the "object-centered diagram" approach. I will proceed with this approach for the moment.

However, I am also interested in taking the "filter" approach so that the layout of the model will be preserved. Would it be possible to apply "variable filter" to highlight only the interested subset of the model without showing (by hiding) other model elements and without destroying the original model's layout?

Best regards,
Akira
Re: How to show subset of the Sirius-based model diagram [message #1806708 is a reply to message #1806688] Tue, 14 May 2019 09:16 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
Hello Akira,

Indeed, you can also take the variable filter approach. This means that in the semantic condition expression, you will need to call a Java service that will first find the selected element on the diagram and then compute a list of element that needs to be filtered (for the example that is elements that are not parent or children).
Concerning the "object-centered diagram" approach and the layout difference, you can fix it by using the copy/paste layout contextual action (or programatically) from the original diagram to the sub-diagram.

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to show subset of the Sirius-based model diagram [message #1806958 is a reply to message #1806708] Mon, 20 May 2019 03:45 Go to previous messageGo to next message
Akira Tanaka is currently offline Akira TanakaFriend
Messages: 82
Registered: March 2010
Member
Hello Steve,

Thank you for the response. I am now trying both approaches at the same time, and I am facing one issue.

1) In the object-centered diagram approach, I need to be able to refer to the selected model element (instance) in AQL statement (or could be Java service). Is there any way to reference the selected element(s)?

2) In the variable filter approach, I need to be able to again refer to the selected model element in AQL or Java. In the previous response message, you wrote: " you will need to call a Java service that will first find the selected element on the diagram." Is there any sample or previous thread discussing this (I could not find this)?

Above issue may come from the fact that my ecore model defines Link eClass (explicit class representing a Link), rather than defining a Link as a relationship between Nodes. Therefore, using the reference to the selected element, I need to find links that reference from (source) or reference to (target) the selected element.

Thank you very much in advance.
Akira
Re: How to show subset of the Sirius-based model diagram [message #1807011 is a reply to message #1806958] Tue, 21 May 2019 09:20 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 432
Registered: May 2011
Senior Member
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


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Show Content Assist in properties view text widget
Next Topic:Model explorer & diagrams label colors
Goto Forum:
  


Current Time: Thu Aug 22 21:29:26 GMT 2019

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

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

Back to the top