Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Create but not represent element
Create but not represent element [message #1743647] Sun, 18 September 2016 04:20 Go to next message
Emil Jenotte is currently offline Emil JenotteFriend
Messages: 25
Registered: September 2016
Junior Member
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.
index.php/fa/27110/0/

- 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.
index.php/fa/27109/0/

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 14:10 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
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 06:37 Go to previous message
Emil Jenotte is currently offline Emil JenotteFriend
Messages: 25
Registered: September 2016
Junior Member
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
Previous Topic:About Layout of sirius
Next Topic:Setting properties Rules & Grid programmatically.
Goto Forum:
  


Current Time: Fri Apr 26 22:34:23 GMT 2024

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

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

Back to the top