Skip to main content



      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 04:42 Go to next message
Eclipse UserFriend
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 19:31 Go to previous messageGo to next message
Eclipse UserFriend
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 11:33 Go to previous messageGo to next message
Eclipse UserFriend
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 17:10 Go to previous message
Eclipse UserFriend
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: Tue Jul 01 15:52:00 EDT 2025

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

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

Back to the top