Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » mouse click notification
mouse click notification [message #896089] Tue, 17 July 2012 08:51 Go to next message
tom maxx is currently offline tom maxx
Messages: 20
Registered: July 2012
Junior Member
Hi friends,

I want to get notification that mouse is clicked on figure in EditPart, So on mouse click I can change color of that figure.

But I want by GEF way; means by registering EditPolicy & Request and Command.

Can some one tell that how to get event notification using Request & Command way?

Thanks
Re: mouse click notification [message #896179 is a reply to message #896089] Tue, 17 July 2012 13:57 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi, do you mean double click or mouse up or mouse down?
Re: mouse click notification [message #896189 is a reply to message #896089] Tue, 17 July 2012 14:10 Go to previous messageGo to next message
tom maxx is currently offline tom maxx
Messages: 20
Registered: July 2012
Junior Member
Hi Jan,

for me is the event (double click, mouse up, mouse down, ...) irrelevant. I want to modify the color of my figure by selecting. And I want to save the new color in the model, because for me it's insufficient to change the feedback-figure-color.

[Updated on: Tue, 17 July 2012 14:13]

Report message to a moderator

Re: mouse click notification [message #896193 is a reply to message #896189] Tue, 17 July 2012 14:17 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Well, you could add an editPartListener in your EditPart and change the model's color there whenever its selectedStateChanged method is called.

[Updated on: Tue, 17 July 2012 14:18]

Report message to a moderator

Re: mouse click notification [message #896194 is a reply to message #896193] Tue, 17 July 2012 14:25 Go to previous messageGo to next message
tom maxx is currently offline tom maxx
Messages: 20
Registered: July 2012
Junior Member
Do you know an example/tutorial for the EditPartListener?
Why is it so difficult to select a figure? If I want to delete a figure it's very easy. I have to create an Command and a simple EditPolicy ... .

Is there a reason why I can't recieve a REQ_SELECTION-request in the getCommand(Request req)-method of an EditPolicy?

Thanks! Smile
Re: mouse click notification [message #896200 is a reply to message #896194] Tue, 17 July 2012 14:36 Go to previous messageGo to next message
tom maxx is currently offline tom maxx
Messages: 20
Registered: July 2012
Junior Member
Can I create a Command via the EditPartListener? This is essential for the undo-function.
Re: mouse click notification [message #896202 is a reply to message #896200] Tue, 17 July 2012 14:41 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Yes, you can do something like follows
part.getViewer.getEditDomain().getCommandStack().execute(your command)
Re: mouse click notification [message #896412 is a reply to message #896202] Wed, 18 July 2012 10:37 Go to previous message
tom maxx is currently offline tom maxx
Messages: 20
Registered: July 2012
Junior Member
Thank you!
Previous Topic:[Zest]Question about dynamically refreshing a graph
Next Topic:Zest2 release date?
Goto Forum:
  


Current Time: Tue Sep 23 10:24:34 GMT 2014

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

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