Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to capture double click on GEF Container
How to capture double click on GEF Container [message #237122] Mon, 23 July 2007 10:16 Go to next message
Vinayak is currently offline VinayakFriend
Messages: 2
Registered: July 2009
Junior Member
Hi All,
I'm trying to capture a double click event on the GEF Editor. Note that i dont want to capture the event on Edit Parts(Which is captured by SelectEditPartTracker,if i'm not wrong). The double click event on the empty spaces besides the edit parts is what im looking for.

Anybody worked on GEF. Please help.
Re: How to capture double click on GEF Container [message #237145 is a reply to message #237122] Tue, 24 July 2007 03:16 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

Looks like you need to detect a double-click on your top-level figure. You
can add a MouseListener to that figure for that purpose.
Hope this helps.

Cheers,
Alex
Re: How to capture double click on GEF Container [message #237150 is a reply to message #237145] Tue, 24 July 2007 05:25 Go to previous messageGo to next message
Vinayak is currently offline VinayakFriend
Messages: 2
Registered: July 2009
Junior Member
The GEF SelectionTool already processes double-click and will send a SelectionRequest to the target EditPart under the mouse of the type REQ_OPEN.

My problem is i need this SelectionRequest to be available at the container level like the ScrollingGraphicalViewer.

I feel MouseListener doesn't serve the purpose in GEF.
Re: How to capture double click on GEF Container [message #237296 is a reply to message #237150] Sat, 28 July 2007 22:16 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

If you need to detect a double-click on the white space (i.e. not
including meaningful editparts drawn on top) then I would go with a mouse
listener to the top level figure.
GEF's event dispatchers are listening to mouse and key events on
FigureCanvas control and handle these events. There are 2 concrete event
dispatchers. SWTEventDispatcher that just forwards events to the figure on
which the event has occurred and the figure, by default, forwards the
event to the listeners of this event. The DomainEventDispatcher besides
forwarding events to figures forwards them to EditDomain which forwards it
the currently active tool (that's why selection tool creates REQ_OPEN for
double-click).
You can just listen to the FigureCanvas control for a double-click but
you'll have to determine on which figure the event has occurred yourself.
With a mouse listener on the top level figure you'll get only the
double-clicks occurring on the that figure (i.e on the white space not on
its children).

Cheers,
Alex
Previous Topic:export editor diagram to a jpeg file without physically opening the editor
Next Topic:Print Orientation
Goto Forum:
  


Current Time: Sat Apr 27 01:22:31 GMT 2024

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

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

Back to the top