Skip to main content



      Home
Home » Eclipse Projects » Sirius » How to Create a View without a reference to the model
How to Create a View without a reference to the model [message #1730831] Thu, 28 April 2016 17:37 Go to next message
Eclipse UserFriend
Hi,

How can I create a View without referencing to the implemented model?

I need a Creation Tool that creates a Picture (from workspace) in the diagram like the Create Text Tool from the palette.

I tried to create a Node with the workspace image as style, but I don't know which Domain Class I could use for it. (I tried a several ones like diagram.WorkspaceImage, diagram.DNode, diagram.square and so on)
Then I wanted to use the Node Creation Tool with mapping this Node and after Begin I took Create View with mapping this Node and var:containerView as Container View Expression.

Is that the right way or how can I achieve this?

Regards
Re: How to Create a View without a reference to the model [message #1730885 is a reply to message #1730831] Fri, 29 April 2016 09:52 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

In Sirius the behavior is:
- a model's element (semantic element) is mapped with a mapping (node,
container, edge, column, line, treeElement) with a style
- this mapping is represented in a representation (diagram, table, tree).
So, Semantic Element (in model) -> 1..n mapping in Sirius -> n graphical
representation.

In your case you want to display a graphical view that not correspond to
a mapping or that the mapping does not correspond to semantic element.
It's impossible with Sirius.

In your case you can maybe mapped the root element (element on which the
diagram is defined) in mode not synchronized for your image.

is this clearer to you?


Regards,


--
Julien - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to Create a View without a reference to the model [message #1731116 is a reply to message #1730885] Mon, 02 May 2016 18:28 Go to previous messageGo to next message
Eclipse UserFriend
Okay, that's a pity.

I tried to map the root element, but then I can only create 1 View.

So when it is impossible in Sirius, how is it possible to create Text, Note and Note Attachment from the palette ? In other words, how is it implemented?
Is there any way to use this for my intention?

The last possible solution would be, to add a new semantic element to the model for that, but It would be great, if there is any other way.
Re: How to Create a View without a reference to the model [message #1731142 is a reply to message #1730885] Tue, 03 May 2016 03:30 Go to previous messageGo to next message
Eclipse UserFriend
Hello Julien. I hop on the train and ask some followup questions:

On 29-Apr-16 15:52, Julien DUPONT wrote:
> So, Semantic Element (in model) -> 1..n mapping in Sirius -> n graphical
> representation.

Do you mean that one semantic element may have more than one graphical
representations in a single diagram?

The diagram itself also targets a semantic element. Is it possible to
have one or more graphical elements that target the same element as the
diagram itself?

Thanks for explaining.
Felix
Re: How to Create a View without a reference to the model [message #1731679 is a reply to message #1731142] Mon, 09 May 2016 04:32 Go to previous message
Eclipse UserFriend
Le 03/05/2016 09:30, Felix Dorner a écrit :
> Hello Julien. I hop on the train and ask some followup questions:
>
> On 29-Apr-16 15:52, Julien DUPONT wrote:
>> So, Semantic Element (in model) -> 1..n mapping in Sirius -> n graphical
>> representation.
>
> Do you mean that one semantic element may have more than one graphical
> representations in a single diagram?

Yes, you can have several mappings which will create a different
graphical element for a single semantic element.
If you reuse a mapping in several places on the same diagram or if the
semantic candidates expression return a same element in different
contexts, you have the possibility to create several times a graphical
element for the same semantic element in a different container.
The refresh behavior compute "candidates" for each mapping: a candidate
references the mapping, the semantic element and the container (diagram,
node, container, list, ..)

>
> The diagram itself also targets a semantic element. Is it possible to
> have one or more graphical elements that target the same element as the
> diagram itself?

If you want to create a graphical element which represent the same
semantic element than the target of the diagram, you simply create a
mapping with the same domain class (or a super type) than the diagram
description and you put "var:self" as semantic candidates expression.
This is also true for any node/container mapping, if you want to create
a sub node / border node / compartiment or sub container on an element.

>
> Thanks for explaining.
> Felix
>
>


--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Trigger Arrange All of a Diagram programmatically
Next Topic:Swimlanes with Sirius
Goto Forum:
  


Current Time: Sat Mar 15 04:31:29 EDT 2025

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

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

Back to the top