Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Implicitly Connecting Nodes
Implicitly Connecting Nodes [message #957948] Thu, 25 October 2012 12:20 Go to next message
Phillip James is currently offline Phillip James
Messages: 5
Registered: October 2012
Junior Member
Hi All,

I am rather new to the whole GMF development, but have hit a rather strange problem. I would like to connect Nodes directly without a connection between them.

For example, I have in my ecore file: Node A and Node B, and a relationship that Node A "has" Node B. Now usually, you would expect this to get translated to two different Nodes in GMF with the "has" being a connection. I was wondering if it is possible to implicitly create this connection. So if I draw a Node A, I would then like to be able to drag a Node B on top of this Node and for the, to glue together at a given point. Some how this would involve implicitly creating the "has" connection without drawing it. Is this possible?

I have thought that it may be possible with a compartment which contains a Node A and a very small line which represent the connection and is created when a Node A is dropped on the canvas. Then the Node B can be connected to this small line.

I know this sounds very odd! But is anything like this possible?

Thanks in advance!
Phil
Re: Implicitly Connecting Nodes [message #962786 is a reply to message #957948] Mon, 29 October 2012 06:25 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 695
Registered: November 2009
Senior Member
Hi Philip,

can you provide pictures showing the steps you want to do? Could this be applied to your problem? http://wiki.eclipse.org/Graphical_Modeling_Framework/Tips#Implicit_node_in_the_middle_creation

Ralph
Re: Implicitly Connecting Nodes [message #962950 is a reply to message #957948] Mon, 29 October 2012 09:01 Go to previous messageGo to next message
Phillip James is currently offline Phillip James
Messages: 5
Registered: October 2012
Junior Member
Hi Ralph,

Yes that could be a solution! Thanks Smile

Also, sorry I missed it in the tips section.

Do you know if this has now been included as a possibility in the GMF Tooling?

Thanks again,
Phil
Re: Implicitly Connecting Nodes [message #962960 is a reply to message #962950] Mon, 29 October 2012 09:10 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 695
Registered: November 2009
Senior Member
Hi,

no it has not been included but there is an open bug on this item. You should express your interest there and follow it to get informed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=331868

Ralph
Re: Implicitly Connecting Nodes [message #962967 is a reply to message #962960] Mon, 29 October 2012 09:17 Go to previous messageGo to next message
Phillip James is currently offline Phillip James
Messages: 5
Registered: October 2012
Junior Member
Ok thanks. I will try the code in the tutorial and let you know how it goes.

best,
Phil
Re: Implicitly Connecting Nodes [message #981351 is a reply to message #957948] Mon, 12 November 2012 05:51 Go to previous messageGo to next message
Phillip James is currently offline Phillip James
Messages: 5
Registered: October 2012
Junior Member
Hi All,

I have been fighting with the code changes for last week or so, and have to say, I think I am completely out of my depth!

One small question I have is does anyone have a simpler example, or if I posted my model would someone be willing to help me get through Smile

Thanks is advance for any help.

Phil
Re: Implicitly Connecting Nodes [message #982553 is a reply to message #981351] Tue, 13 November 2012 03:09 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 695
Registered: November 2009
Senior Member
Hi,

here I do have a modified version fitting my needs: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/#svn%2Fde.uni_mannheim.informatik.swt.models.plm.diagram%2Fcustom-src%2Fde%2Funi_mannheim%2Finformatik%2Fswt%2Fmodels%2Fplm%2Fdiagram%2Fcustom%2Fimplicitconnection All you need to do is install this editpolicy into the nodes you want to use it for and modify the create command of the link which is created in a way like this: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/xpt/diagram/commands/CreateLinkCommand.xpt

Unfortunately the command contains some custom code that is used for other features of my editor. I think installing the editpolicy and doing some debugging will help you a lot.

Ralph

[Updated on: Tue, 13 November 2012 03:27]

Report message to a moderator

Previous Topic:Diagram does not refresh correctly
Next Topic:Refresh Connections after command execution
Goto Forum:
  


Current Time: Sat Apr 19 00:44:40 EDT 2014

Powered by FUDForum. Page generated in 0.07649 seconds