Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Re: Semantical container != Graphical container
Re: Semantical container != Graphical container [message #4900] Thu, 03 August 2006 13:31 Go to next message
Eclipse UserFriend
Originally posted by: jw377.safe-mail.net

Hello!

Dmitry Stadnik schrieb:
> Hello!
>
> Note is a pure design element and it's quite different. Basically
> you have to patch two things:
>
> 1. Container node canonical edit policy: modify
> getSemanticChildrenList() to use another container (it's parent I guess;
> that corresponds to diagram element; I assume that child node is stored
> in diagram element).
>
> 2. Container node item semantic edit policy: in generated
> CreateElementCommand modify getEClassToEdit() and getElementToEdit() to
> provide another container info (diagram element instead of container
> element).
>
> In gmfmap model you should define structure that follows graphical
> definition; in container node mapping there should be a ChildReference
> to the child node and child node mapping within it. ContainmentFeature
> of ChildReference could be written directly in text editor (ui filters
> it out since it's not available amongst container node features).
> Validation also will complain so you have to ignore it (((

I have tried your approach and now I am able to add an element to
another diagram element than the diagram element corresponding to it's
semantical container. But now I have a different problem:

On top level I have the diagram canvas (corresponding to semantical
element A). A references Elements of type B and C. Furthermore I have a
graphical node X (for the semantical element B) and a graphical node Y
(for the semantical element C).

By following your advice I am able to create Y-nodes within X-nodes. But
when I create this node within the X-node, another Y-node is also
created in the canvas. So I have two Y-nodes for one C element (one in
the X-node and one in the canvas).

Any idea how to prevent the second Y-node to appear in the canvas?

(I hope the A,B,C's were not too confusing ;-))

Thomas

F'up to eclipse.modeling.gmf
Re: Semantical container != Graphical container [message #5102 is a reply to message #4900] Thu, 03 August 2006 14:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Hello!

May you have a mapping to show C:Y on diagram canvas so canonical edit
policy uses it to add extra view?

Thomas Weiler wrote:
> Hello!
>
> Dmitry Stadnik schrieb:
>> Hello!
>>
>> Note is a pure design element and it's quite different. Basically
>> you have to patch two things:
>>
>> 1. Container node canonical edit policy: modify
>> getSemanticChildrenList() to use another container (it's parent I
>> guess; that corresponds to diagram element; I assume that child node
>> is stored in diagram element).
>>
>> 2. Container node item semantic edit policy: in generated
>> CreateElementCommand modify getEClassToEdit() and getElementToEdit()
>> to provide another container info (diagram element instead of
>> container element).
>>
>> In gmfmap model you should define structure that follows graphical
>> definition; in container node mapping there should be a ChildReference
>> to the child node and child node mapping within it. ContainmentFeature
>> of ChildReference could be written directly in text editor (ui filters
>> it out since it's not available amongst container node features).
>> Validation also will complain so you have to ignore it (((
>
> I have tried your approach and now I am able to add an element to
> another diagram element than the diagram element corresponding to it's
> semantical container. But now I have a different problem:
>
> On top level I have the diagram canvas (corresponding to semantical
> element A). A references Elements of type B and C. Furthermore I have a
> graphical node X (for the semantical element B) and a graphical node Y
> (for the semantical element C).
>
> By following your advice I am able to create Y-nodes within X-nodes. But
> when I create this node within the X-node, another Y-node is also
> created in the canvas. So I have two Y-nodes for one C element (one in
> the X-node and one in the canvas).
>
> Any idea how to prevent the second Y-node to appear in the canvas?
>
> (I hope the A,B,C's were not too confusing ;-))
>
> Thomas
>
> F'up to eclipse.modeling.gmf
Re: Semantical container != Graphical container [message #5171 is a reply to message #5102] Thu, 03 August 2006 14:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jw377.safe-mail.net

Dmitry Stadnik schrieb:
> Hello!
>
> May you have a mapping to show C:Y on diagram canvas so canonical
> edit policy uses it to add extra view?

Yes, I have a mapping to show C:Y on diagram. But the canvas should only
show those elements C:Y, which are not hold by other diagram elements.

Consider the following:

Your top level model element holds a reference to (textual) notes which
can be connected to arbitrary elements of your model, e.g. to UML
classes. Now consider a UML package with a UML class in it to which you
connect such a note. The semantical element for this note is held by the
top level model element while the graphical representation of the note
is contained in the package's graphical representation (and can be moved
with it etc.).

On the other hand you want to be able to connect a note e.g. to a
package. In that case the container for the graphical representation of
the note and the semantical element are the same (namely the top level
model and its graphical representation - the diagram canvas).

So you have to reference all notes in your diagram from the top level
model element (because packages, classes etc. should not know about
notes which are connected to them), but the graphical container for
these notes may be different from the diagram canvas.

This use case is similar to what I want to achieve in my editor.

Thomas
Re: Semantical container != Graphical container [message #5239 is a reply to message #5171] Thu, 03 August 2006 14:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Hello!

Thomas Weiler wrote:
> Dmitry Stadnik schrieb:
>> Hello!
>>
>> May you have a mapping to show C:Y on diagram canvas so canonical
>> edit policy uses it to add extra view?
>
> Yes, I have a mapping to show C:Y on diagram. But the canvas should only
> show those elements C:Y, which are not hold by other diagram elements.

So could you express this in canonical edit policies of nodes that hold
C:Y nodes?
Re: Semantical container != Graphical container [message #6490 is a reply to message #5239] Fri, 04 August 2006 10:18 Go to previous message
Eclipse UserFriend
Originally posted by: jw377.safe-mail.net

Thanks Dmitry for your help. Now it's working.

Thomas
Previous Topic:Is it possible to modify the position of Diagram menu on main menu bar?
Next Topic:Downloading source for Draw2d
Goto Forum:
  


Current Time: Sat Jul 27 12:51:44 GMT 2024

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

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

Back to the top