How to Highlight all references to an object in a Sirius Diagram [message #1794043] |
Wed, 22 August 2018 15:13  |
Eclipse User |
|
|
|
I'm creating a Sirius VSM where the edges represent a network. Information can flow across the edges from node to node. I would like to be able to select a data structure from a list of those defined in my model and then highlight every place that data structure is referenced *and* show the transitive closure of how that data structure can flow across the edges of the network from node to node.
I can create a Java service that will identify the references and transitive closure, given a data structure.
What I don't know how to do is:
1) Create a selection dialog to select a data structure from a list of possible data structures (I have found very little documentation on this)
2) How to dynamically change the visual representation of the nodes and edges through which the data structure passes.
Any pointers / suggestions?
|
|
|
|
Re: How to Highlight all references to an object in a Sirius Diagram [message #1794363 is a reply to message #1794072] |
Wed, 29 August 2018 11:04   |
Eclipse User |
|
|
|
Thanks for your rapid response. I am trying this out. I apparently did not properly communicate one key thing.
The items that I select (data structures) do not have a visual representation in the diagram (which contains only nodes,
ports on those nodes, and edges between ports). What I'm trying to do is highlight the nodes, ports and edges that the
data structures flow through. I've written a service method that takes the selected data structures and finds the nodes,
ports, and edges (the semantic elements, not the DRepresentationElements). The challenge I'm facing is that the service method in
the 'Elements to Select' field isn't being called. The service method for the 'Candidates Expression' is being called, so I know
I've properly registered the service class.
In the 'Candidates Expression' field, the successful call looks like this:
service:<method name>()
In the 'Elements to Select' field, I've tried the following:
1) service:<static method call using class.method name>()
2) service:<instance method name where the first parameter is the same type as the one used in the 'Candidates Expression' service method call>()
3) [container.<instance method where the first parameter is the same type as the one used in the 'Candidates Expression' service method call>()/]
4) [element.<instance method>()/]
Note that I have defined methods that take as the first parameter an object of type:
EObject, Collection<EObject>, the type used in the successful 'Candidate Expression' call, as well as a static method that takes no parameters.
None of these methods get called.
None of these have worked. What's the correct call? What is the context this method will be called in? What am I doing wrong?
Other notes:
*) I'm using the standard GEMOC Studio distribution which includes Sirius 5.1.1.201801311428.
1) Users will select a single data structure but that multiple diagram elements will be highlighted as a result. Should the Selection Wizard mulitple box be checked or not in this case?
2) I'm looking at https://www.eclipse.org/forums/index.php/t/1000795/ to see if that will provide additional insight
Follow up:
I changed my method that supplies the 'Candidates Expression' field to return a list of edges (these semantic elements have a graphical representation). I then checked the 'Multiple' field so that element should contain a Collection<EObject> and set the 'Elements to Select' field to 'var:element'
That should mean that all the selected edges should be highlighted after the Selection Wizard is finished. That did not happen. The selection did not change.
More Follow Up:
The Sirius Tool Specification doc , in the 'Selection after tool execution' section, says: In any case, if the default list of elements is not empty, the list of elements returned is filtered with the default selected elements. In case of creation tool, the default list contains newly created elements so, the returned list can contain at most that elements. If I understand this correctly, this means that the list of items finally displayed as selected must be a subset of those selected in the Selection Wizard dialog. In other words, this means that I cannot use the Selection Wizard to select something other than what I want to appear as selected or a superset thereof. If that is true, then I cannot use the Selection Wizard for my original intended purpose because I cannot use the Selection Wizard to select something with no graphical representation, use that input to calculate what I want to appear as selected, and expect the selected elements to change after using the tool.
Is that correct?
[Updated on: Wed, 29 August 2018 16:15] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.50259 seconds