Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Handle on Mouse event for gef.graph.Node(How to create handle for events on gef.graph.Node objects.)
Handle on Mouse event for gef.graph.Node [message #1740836] Thu, 18 August 2016 19:26 Go to next message
Didier Nadeau is currently offline Didier NadeauFriend
Messages: 3
Registered: August 2016
Junior Member
Hi,

I am new to the GEF framework and I would like to use GEF4/Zest in an eclipse application. I have checked out the most recent code on Github last week.

I plan on using gef.graph.Node and layout algorithms to display tiles of a network. However, I would like to be able to place handle for events (clicked, selected, etc) on the Nodes. I have found that the class javafx.scene.Node supports events, but it does not work with the layout algorithms (such as GridLayoutAlgorithm).

Is there a way to have handle for specific events on the gef.graph.Node similarly as with javafx.scene.Node ?

Thank you for your time,

Didier
Re: Handle on Mouse event for gef.graph.Node [message #1742116 is a reply to message #1740836] Wed, 31 August 2016 14:34 Go to previous messageGo to next message
Didier Nadeau is currently offline Didier NadeauFriend
Messages: 3
Registered: August 2016
Junior Member
I have managed to do it. I extended ZestFXModule and overrode bindNodePartAdapters to add a new binding linked with my class. It works, however there might be a better way to do it that I missed.
Re: Handle on Mouse event for gef.graph.Node [message #1742609 is a reply to message #1742116] Tue, 06 September 2016 07:24 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 235
Registered: July 2009
Location: L√ľnen
Senior Member
The intended way depends on which event should trigger the handle creation. We provided dedicated handle part factories for hover and selection. If you detail your use case I might provide more hints on what the 'intended' way would be.
Re: Handle on Mouse event for gef.graph.Node [message #1743281 is a reply to message #1742609] Tue, 13 September 2016 20:40 Go to previous messageGo to next message
Didier Nadeau is currently offline Didier NadeauFriend
Messages: 3
Registered: August 2016
Junior Member
Thank you for your reply, however I am unsure on how to use the Factories provided.

Basically, I have a graph with multiple nodes in it. I want to attach a custom click handler that is called when a node is selected. I have managed it by overriding ZestFxModule and adding a new binding. Is there a proper way to do that with one of the factories provided ?
Re: Handle on Mouse event for gef.graph.Node [message #1743317 is a reply to message #1743281] Wed, 14 September 2016 10:17 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
Generally speaking, when you want to process mouse clicks, overriding the module and adding a binding for an IFXOnClickPolicy is exactly the way to go.

However, in some scenarios it is sufficient to register event handlers on the visuals within the parts. So it depends on what you want to do when the mouse is clicked.

Best regards,
Matthias
Previous Topic:GEF4 Add extra visual elements
Next Topic:GEF4 - Zest 4 - A few questions
Goto Forum:
  


Current Time: Mon Sep 24 16:28:49 GMT 2018

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

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

Back to the top