Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Edge/Link children(How to define)
Edge/Link children [message #514055] Fri, 12 February 2010 05:28 Go to next message
Eclipse UserFriend
Hi,

I'm wondering is it possible to define a chilrden for an Edge?
I have an Edge that have a message reference, so I need to enable that a Message can be added to the Edge, and when it is done, the Edge should be annotated with the message like in this picture:

http://i49.tinypic.com/24ctfnd.jpg

--
Regards, Milan

[Updated on: Fri, 12 February 2010 05:29] by Moderator

Re: Edge/Link children [message #516082 is a reply to message #514055] Mon, 22 February 2010 12:41 Go to previous message
Eclipse UserFriend
I managed to added a node as a Edge chilrden by defining drag_drop_role to the parent edge, as well
as creation_role, canonical_role and custom semantic_role (this includes getCreateCommand() with node creation command).

In XXVisualDRegistry, canCreateNode() method,
for my EdgeEditPart.VISUAL_ID I defined that if
nodeVisualID is NodeEditPart == nodeVisualID to return true, as well as getNodeVisualID() method, I added

case EdgeEditPart.VISUAL_ID: 	
if (CommonPackage.eINSTANCE.getReference().isSuperTypeOf(domainElement.eClass())) {
  return NodeEditPart.VISUAL_ID;
}
break;


However, I have two problems. The first, is that I cannot enable that my node is moved on the edge parent (like label). I tried with custom PRIMARY_DRAG_ROLE, i.e., NonResizableEditPolicyEx, but it doesn't work (when I move my child node it is not contained anymore in the parent).

And second, regarding above additions to the XXVisualDRegistry class, when my editor is generated from the genmodel the XXVisualDRegistry class is overriden. I cannot wrote generated not before getNodeVisualID() method, because it should be generated for new/changed elements from the genmodel.

What should I do?

--
Thanks, Milan

[Updated on: Mon, 22 February 2010 12:41] by Moderator

Previous Topic:GMF text editor
Next Topic:How to mark Nodes
Goto Forum:
  


Current Time: Sun Jul 06 07:39:19 EDT 2025

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

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

Back to the top