Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Restrict the connection for the figures when they r in container
Restrict the connection for the figures when they r in container [message #178924] Tue, 25 March 2008 11:58 Go to next message
Eclipse UserFriend
Originally posted by: govind.ashrit.xxx.com

Hi All..

In my project i have some figures (say A,B,C etc.)
According to the model n graph.

I can connect A to A(A-----A).

Now my Requirement is :::

When i drag 2 figs of type B from palette n place on editor.

then add one Fig A in both of the Figs B.

Now i want to restrict connection between fig A and Fig A ..which r now in
different containers(ie Fig B).

Help Required..

Thanks in Advance..


Regards
Govind R .
Re: Restrict the connection for the figures when they r in container [message #179000 is a reply to message #178924] Tue, 25 March 2008 14:24 Go to previous messageGo to next message
Eclipse UserFriend
Hello govind,

Add a back reference from A to container B into your metamodel and use following
ocl as a link source constraint:

self.myA = oppositeEnd.myA

-----------------
Alex Shatalin
Re: Restrict the connection for the figures when they r in container [message #179032 is a reply to message #179000] Wed, 26 March 2008 00:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: govind.ashrit.xxx.com

Hi Alex..

Thanks for the reply...

But i didn't get u completely...can u explain ..please

Regards
Govind R.
Re: Restrict the connection for the figures when they r in container [message #179052 is a reply to message #179032] Wed, 26 March 2008 05:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

In the gmfmap you can specify constraints (aka audits) for connections.
There you can add a constraint, saying that the link's source's
container has to be equal to the link's target's container. See the
GMF-Tutorial for more details.


govind schrieb:
> Hi Alex..
>
> Thanks for the reply...
>
> But i didn't get u completely...can u explain ..please
>
> Regards
> Govind R.
>
Re: Restrict the connection for the figures when they r in container [message #179177 is a reply to message #179000] Wed, 26 March 2008 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: govind.ashrit.xxx.com

Hi Alex..


Sorry i didnt understand
Adding a back reference from A to container B into metamodel

and in following ocl as a link source constraint:

self.myA = oppositeEnd.myA

what is 'my' ??

A will be class rite!!


please help

Thanks in advance

Regards

Govind R
Re: Restrict the connection for the figures when they r in container [message #179193 is a reply to message #179177] Wed, 26 March 2008 10:38 Go to previous message
Eclipse UserFriend
Hello govind,

AFAIU, you have the following meta-model:

- EClass (name="A")
- EReference (name="myBs", containment="true", type="B")
- EClass (name="B")

I'm suggesting you to add one more reference into EClass "B":
- EReference (name="myA", type="A", eOpposite="myBs")

As a result this EReference will be set to the container of B element (A).

-----------------
Alex Shatalin
Previous Topic:Strategy for updating the gmfgen model after having edited the ecore/ecore_diagram model
Next Topic:Presentations from EclipseCon
Goto Forum:
  


Current Time: Sat Jul 19 18:59:20 EDT 2025

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

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

Back to the top