Hide BorderedNode when connected Edge is hidden or filtered [message #1818528] |
Wed, 18 December 2019 11:53  |
Eclipse User |
|
|
|
Hi,
I have a diagram that consists of connetec Containers. If two containers are connected, a BorderedNode is created for each of them and then those two BorderedNodes are connected by an edge.
I would now like to implement the following feature:
Whenever an edge is not shown, i.e., it is a) hidden manually by the user or b) filtered out by a filter, I would like to automatically hide both connected BorderedNodes as well.
How would I be able to achieve that?
I figure, in the Precondition Expression, I would have to check whether or not the connected edge is visible, but I don't know how exactly I would do that.
I tinkered around with something like this, without success:
aql:self.findMyEdge().visible
Any idea what I should try?
|
|
|
|
Re: Hide BorderedNode when connected Edge is hidden or filtered [message #1818690 is a reply to message #1818545] |
Mon, 23 December 2019 05:36   |
Eclipse User |
|
|
|
Hi Steve,
thanks for your reply. The b) answer is kinda obvious, now that I think about it (d'oh).
I know that I could add labels to the edge itself. However, I prefer the border nodes, as they always "stick" to the node, no matter the length and position of the edge. With edge labels, the user typically (i.e., in non-trivial graphs) has to rearrange the labels manually each time he repositions the labels in order to avoid confusion as to which edge exactly the label belongs. Is there a good solution for this problem? I guess other people just live with this inconvenience?
Thanks for the a) solution, though. Will this also work if the edge is not shown because of "transitively" hidden node, i.e., if the user does not the edge itself but the node on the other side of the edge?
Best Regards,
Konrad
|
|
|
Re: Hide BorderedNode when connected Edge is hidden or filtered [message #1818741 is a reply to message #1818690] |
Thu, 26 December 2019 07:35  |
Eclipse User |
|
|
|
Hello,
Indeed, the labels at the end of an edge may require to be moved around by the user even though Sirius places them next to the end of the edge. This could be improved by having a custom style[1] on the edge mapping, but it is probably overkill in this context.
If you go with the a) solution with a model change trigger, it will be triggered with a notification. Therefore depending if the "Hide action" is executed on a Node or an edge, it will be the notifier. Your model change trigger will need to be able to process if it is an edge then it will need to hide 2 nodes. If it is a node, then it will need to hide the edge and the opposite node.
Best regards,
Steve
[1] https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html
|
|
|
Powered by
FUDForum. Page generated in 0.07958 seconds