Create but not represent element [message #1743647] |
Sun, 18 September 2016 00:20  |
Eclipse User |
|
|
|
Hello,
I have the following two situations:
1) I have Elements TypeNever, which are in a Containment relationship with an Element (Node) and I would like to add them as a Bordered Nodes with the Creation Tool to the Node, but I don't want them to be represented graphically.
2) I have other Elements TypeOnce, which are in a Containment relationship with an Element (Container) and I would like to add them as Bordered Nodes with the Creation Tool to the Container, but I only want the first added Element to be represented. The other ones should be created but not represented.
I tried to solve this by using by
- for 1) just not adding a layout - but the result is, that when there is no layout, no Element gets created at all.

- for 2) using conditional styles. If its true, the element gets represented. My aql-Statements work perfectly fine. But, when the condition is false, then I didn't add any layout - the result is, like above: No Layout => no element gets created.

So this does not seem the way to go.
How e.g. where exactly can I separate between creation and visualization?
Cheers,
Emil
|
|
|
Re: Create but not represent element [message #1743766 is a reply to message #1743647] |
Mon, 19 September 2016 10:10   |
Eclipse User |
|
|
|
Hi Emil,
Quote:
I tried to solve this by using by
- for 1) just not adding a layout -
By writing layout I assume you mean style.
The style element is mandatory, each mapping must have at least one default style, then it can have several conditional styles. So you can't use the style description to control the visibility of a graphical element.
1) If you never want to display a TypeNever element, why do you create a mapping for them ? You simply have to check that the other mappings like mappingElementTypeOnce will not show them (different domain class ? not a super type, just write a semantic candidates expression which filter the other types).
You can use a generic tool (with some precondition to enable it only when the hoovered element is your "Element") and create you TypeNever instance, if there is no mapping, there will be no graphical node for them.
2) In order to display one border node if there is at least one TypeOnce element, you simply need to customize the semantic candidates expression to take only the first element. Do not forget to replace your conditional style by a default style. You might try something like aql:self.eContainer().indicators()->first()
Quote:
How e.g. where exactly can I separate between creation and visualization?
The visualization is in Sirius is configured by the mapping structure and the interpreted expression which parts of your model you want to represent and how you want to display them.
With the tools and the model operations, you can modify your model, then regarding your modifications, the interpretation result of your expression will change and the visualization will be updated.
Note that there is the concept of MappingFilter which might allow you to control the visibility of elements (by mapping or by expression), their activation is controlled by the user: https://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#mapping_filter
The user also have the possibility to manually hide/reveal each diagram element.
Regards,
Maxime - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Re: Create but not represent element [message #1743955 is a reply to message #1743766] |
Wed, 21 September 2016 02:37  |
Eclipse User |
|
|
|
Hello Maxime,
this really helped me.
The OnceElement works perfectly like that. I just added an default error image.
For the NeverElement, I used the MappingFilter, which is even better. So now its up to the user, to show or not show the Element.
Thank you again!
Cheers
Emil
|
|
|
Powered by
FUDForum. Page generated in 0.03162 seconds