Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » MouseMotionListener and Link Creation(How to get MML to work during link creation)
MouseMotionListener and Link Creation [message #905045] Wed, 29 August 2012 15:32 Go to next message
Jérémy Flusin is currently offline Jérémy FlusinFriend
Messages: 2
Registered: May 2012
Junior Member
Hello everyone,

I'm trying to make my own tooltip on some nodes (called "Input") of my GMF editor. In order to do this, I set a MouseMotionListener to my InputFigure to display my tooltip when the mouse is hovering the node.

Everything works fine, but I would want to display my tooltip during the creation of a link whose target is my Input node. The problem is, none of the listener's methods is called when a link is being created.

How can I proceed ?

PS: I did not use the "setTooltip()" method for the same reason; the tooltip does not appear during the creation of a link.
Re: MouseMotionListener and Link Creation [message #907536 is a reply to message #905045] Tue, 04 September 2012 07:19 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

as far as I can understand you want to draw a connection between two model elements and show a menu which lets the user select what to create when releasing the mouse at the target. To do so install a customized GraphicalNodeEditPolicy into your edit parts. This class shows such a GraphicalNodeEditPolicy http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.common.gmf.inthemiddle/src/de/uni_mannheim/informatik/swt/common/gmf/inthemiddle/gnep/ITMGraphicalNodeEditPolicy.java The method getConnectionMenuContent(CreateConnectionRequest request) is of interest here. An example for a template which installs this policy into an EditPart can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/impl/diagram/editparts/NodeEditPart.xpt The part «AROUND createDefaultEditPoliciesBody FOR gmfgen::GenNode-» is of interest in this template. A video that shows the result can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/wiki/FirstSteps#Creat_DSL_Connection

Ralph
Re: MouseMotionListener and Link Creation [message #907545 is a reply to message #905045] Tue, 04 September 2012 07:19 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

as far as I can understand you want to draw a connection between two model elements and show a menu which lets the user select what to create when releasing the mouse at the target. To do so install a customized GraphicalNodeEditPolicy into your edit parts. This class shows such a GraphicalNodeEditPolicy http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.common.gmf.inthemiddle/src/de/uni_mannheim/informatik/swt/common/gmf/inthemiddle/gnep/ITMGraphicalNodeEditPolicy.java The method getConnectionMenuContent(CreateConnectionRequest request) is of interest here. An example for a template which installs this policy into an EditPart can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/impl/diagram/editparts/NodeEditPart.xpt The part «AROUND createDefaultEditPoliciesBody FOR gmfgen::GenNode-» is of interest in this template. A video that shows the result can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/wiki/FirstSteps#Creat_DSL_Connection

Ralph
Re: MouseMotionListener and Link Creation [message #907554 is a reply to message #905045] Tue, 04 September 2012 07:19 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

as far as I can understand you want to draw a connection between two model elements and show a menu which lets the user select what to create when releasing the mouse at the target. To do so install a customized GraphicalNodeEditPolicy into your edit parts. This class shows such a GraphicalNodeEditPolicy http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.common.gmf.inthemiddle/src/de/uni_mannheim/informatik/swt/common/gmf/inthemiddle/gnep/ITMGraphicalNodeEditPolicy.java The method getConnectionMenuContent(CreateConnectionRequest request) is of interest here. An example for a template which installs this policy into an EditPart can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/impl/diagram/editparts/NodeEditPart.xpt The part «AROUND createDefaultEditPoliciesBody FOR gmfgen::GenNode-» is of interest in this template. A video that shows the result can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/wiki/FirstSteps#Creat_DSL_Connection

Ralph
Re: MouseMotionListener and Link Creation [message #907566 is a reply to message #905045] Tue, 04 September 2012 07:19 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

as far as I can understand you want to draw a connection between two model elements and show a menu which lets the user select what to create when releasing the mouse at the target. To do so install a customized GraphicalNodeEditPolicy into your edit parts. This class shows such a GraphicalNodeEditPolicy http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.common.gmf.inthemiddle/src/de/uni_mannheim/informatik/swt/common/gmf/inthemiddle/gnep/ITMGraphicalNodeEditPolicy.java The method getConnectionMenuContent(CreateConnectionRequest request) is of interest here. An example for a template which installs this policy into an EditPart can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/source/browse/de.uni_mannheim.informatik.swt.models.gmf/templates/aspects/impl/diagram/editparts/NodeEditPart.xpt The part «AROUND createDefaultEditPoliciesBody FOR gmfgen::GenNode-» is of interest in this template. A video that shows the result can be found here: http://code.google.com/a/eclipselabs.org/p/melanie/wiki/FirstSteps#Creat_DSL_Connection

Ralph
Previous Topic:Shared Editing Domain - Errors after saving diagram changes
Next Topic:separate property box while double clicking the node
Goto Forum:
  


Current Time: Thu Apr 18 06:52:47 GMT 2024

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

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

Back to the top