Skip to main content



      Home
Home » Eclipse Projects » GEF » Problems with CreationTool
Problems with CreationTool [message #84082] Tue, 17 June 2003 11:52 Go to next message
Eclipse UserFriend
Originally posted by: junost.gmx.de

Hello

I wrote a 'LineCreationTool' extending CreationTool. Also I extended the
handleButtonUp- and handleButtonDown -method to set start- and endpoint. But
the problem is the getLocation- methode from AbstactTool. When I scroll down
(the zero-point is outside the drawing area) and draw a line, getLocation
gives back a wrong point. It is the right point relative to the edge of the
drawing area but not right relative to the zero point.

Is there another possibility to get the correct position?

Alexander M
Re: Problems with CreationTool [message #84097 is a reply to message #84082] Tue, 17 June 2003 12:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

locations are always absolute in tools, meaning relative to the Canvas, not
the scrolled diagram.

To get the correct position, the target of the line creation (probably the
diagram itself), should take the point, and call:
Figure.tranlsateToRelative(point);

Make sure you don't modify a Point you don't own.

"Alexander M
Re: Problems with CreationTool [message #84128 is a reply to message #84097] Tue, 17 June 2003 14:05 Go to previous message
Eclipse UserFriend
Originally posted by: junost.gmx.de

Thank you, your hint was very helpful.

Alexander M
Previous Topic:draw2d connections with bends
Next Topic:Desperately need a cookbook type example of GEF in a View.
Goto Forum:
  


Current Time: Sat Nov 08 05:49:42 EST 2025

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

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

Back to the top