Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Traversing specific parts of the gmf domain model
Traversing specific parts of the gmf domain model [message #554449] Mon, 23 August 2010 08:42 Go to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi @ all,

I would like to implement a feature for my gmf-editor which enables the user to right-click on a node on the canvas, and then calculate all related nodes in the domain model.
For example i have nodes A, B and C:
node A has a link to two node Bs which have links to two node Cs.
In the properties view of my node A, I can see the links to both two node Bs.
But the correlated node Cs are of course not shown.

I think that, I have to implement an action, which traverses the domain model from a given node element.
Has anybody some experiences with something compareable?

Any help would be appreciated,
best regards,
masija
Re: Traversing specific parts of the gmf domain model [message #554667 is a reply to message #554449] Mon, 23 August 2010 23:31 Go to previous messageGo to next message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
Hi Masija. You can do this with a derived atributte in emf. For example you define a list of nodes for the entity like a derived atributte in the emf editor . After that, yo have to implement the method that specifies the relationships between the nodes. In this case I think is recursive so you can do it with a ocl expresion or with java code in the skeleton generated. When you regenerate you will see the list of nodes related like one more item in the properties view. Sorry for my English, is rustic. Regards

Fernando
Re: Traversing specific parts of the gmf domain model [message #555148 is a reply to message #554667] Wed, 25 August 2010 15:33 Go to previous messageGo to next message
masija . is currently offline masija .Friend
Messages: 59
Registered: July 2010
Member
Hi Fernando,
thanks a lot for your reply, derived attributes are working for me!
I added a derived, nonchangable, transient reference to my node-class in the .ecore.
Then I implemented the getter-function for this attribute similar to the ExtendedPO2 example from the EMF book (see getShippedOrders http://my.safaribooksonline.com/0-13-142542-0/ch12lev1sec4 )

Best regards,
masija

Re: Traversing specific parts of the gmf domain model [message #555215 is a reply to message #555148] Wed, 25 August 2010 21:10 Go to previous message
Fernando Herrera is currently offline Fernando HerreraFriend
Messages: 49
Registered: January 2010
Member
You are welcome Masija. I have fix the problem with mi shared editing domain that I posted in your thread some days ago with the tutorial you pointed me. Regards

Fernando
Previous Topic:How to capture elements in a diagram
Next Topic:[Eclipse 3.6 and GMF 2.3] Border items drawing problems
Goto Forum:
  


Current Time: Fri Sep 20 15:01:03 GMT 2024

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

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

Back to the top