Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Retrieving mouse position
Retrieving mouse position [message #1066600] Wed, 03 July 2013 11:39 Go to next message
Cedric Moonen is currently offline Cedric Moonen
Messages: 274
Registered: August 2009
Senior Member
Hello,

I recently upgraded to graphiti 0.10 (from 0.8 ) and was able to fix most of the compilation errors (changes in the API.
I have one remaining problem: in my custom move shape feature, how can I retrieve the mouse position ? Previously, this could be done by calling getMouseLocation() on the editor but this method doesn't exist anymore (and furthermore, getting the editor is deprecated).

I need this because I need to know the mouse position in the target shape (relative to the target shape). This is used to validate whether the shape can be moved there.

Thanks

[Updated on: Wed, 03 July 2013 11:43]

Report message to a moderator

Re: Retrieving mouse position [message #1066808 is a reply to message #1066600] Thu, 04 July 2013 13:24 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1618
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Cedric,

getMouseLocation() has moved to DiagramBehavior, but it's not part of the
interface IDiagramBehaviorUI, so you will need to cast.
((DiagramBehavior)getDiagramBehavior()).getMouseLocation() from within your
feature should do it.

Michael
Re: Retrieving mouse position [message #1066904 is a reply to message #1066808] Fri, 05 July 2013 06:21 Go to previous message
Cedric Moonen is currently offline Cedric Moonen
Messages: 274
Registered: August 2009
Senior Member
Hi Michael,

That does the trick, thanks for the reply.

C├ędric
Previous Topic:Disabling Undo of Graphical Changes?
Next Topic:Problem with API changes in newest Graphiti Version
Goto Forum:
  


Current Time: Thu Oct 23 17:58:03 GMT 2014

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

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