Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » BendpointEditPolicy - incorrect location after zooming
BendpointEditPolicy - incorrect location after zooming [message #222282] Tue, 29 August 2006 13:05 Go to next message
Martin Tanler is currently offline Martin Tanler
Messages: 1
Registered: July 2009
Junior Member
Hello,

I am currently developing a view using GEF. My problem is the following:
after zooming in
or zooming out I try to create/move a bendpoint of a connection. However
the location of
the (new) bendoint location is incorrect if I have zoomed in or zoomed
out. (zoom level 0.5: the bendpoint gets moved half the way it
should be).

Thanks in advance for your help,

Martin
Re: BendpointEditPolicy - incorrect location after zooming [message #1012078 is a reply to message #222282] Wed, 20 February 2013 20:47 Go to previous messageGo to next message
Tim E. is currently offline Tim E.
Messages: 56
Registered: November 2012
Member
Hey,

sorry for digging up this thread.

But I have the exact same problem and cannot figure out how to solve it.

When I zoomed, an want to create/move a bendpoint, the getLocation() method of the request returns a wrong location.

It even returns negative values.

I'd appreciate any help.

Thanks in advance,
Tim
Re: BendpointEditPolicy - incorrect location after zooming [message #1012374 is a reply to message #1012078] Thu, 21 February 2013 12:43 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Although I've never create bendpoints, this is definitively a problem related to relative/absolute coordinate system. Check out the javadoc.
Try to translate the location to relative using figure.translateToRelative(location) or something.
Re: BendpointEditPolicy - incorrect location after zooming [message #1012382 is a reply to message #1012374] Thu, 21 February 2013 13:08 Go to previous messageGo to next message
Tim E. is currently offline Tim E.
Messages: 56
Registered: November 2012
Member
I tried to use figure.translateToRelative(location), unfortunately it did not change anything.

At the moment I implemented relative bendpoints according to the Logic example,
which seems to work fine.

I also filed a bug, about the incorrect location https://bugs.eclipse.org/bugs/show_bug.cgi?id=401367 ...

Perhaps I just don't understand the translateTo{Relative, Absolute} methods,
I can't really find a good explanation...

[Updated on: Thu, 21 February 2013 13:08]

Report message to a moderator

Re: BendpointEditPolicy - incorrect location after zooming [message #1012447 is a reply to message #1012382] Thu, 21 February 2013 15:18 Go to previous messageGo to next message
Jan Krakora is currently offline Jan Krakora
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Looking at the Bendpoint interface, there is written "A bendpoint returns a point relative to the connection figure on which it is being used."

The getLocation() method of the BendpointRequest returns always absolute coordinates. Absolute means relative to the canvas.
So Calling connection.translateToRelative(location) should change the location according to the actual zoom, scroll or whatever.

Coordinate transformation is dark space for me too. take a look at this http://www.eclipsezone.com/eclipse/forums/t46584.html

By the way, I don't think the bug you filed is actually a bug. The returned location is just in absolute coordinates.

[Updated on: Thu, 21 February 2013 15:20]

Report message to a moderator

Re: BendpointEditPolicy - incorrect location after zooming [message #1012450 is a reply to message #1012447] Thu, 21 February 2013 15:24 Go to previous message
Tim E. is currently offline Tim E.
Messages: 56
Registered: November 2012
Member
Thanks for the help...

I'll have a look at it.

I just checked it again, and translateToRelative does change the values.
Probably I forgot something, or did something wrong.

I changed everything to relative bendpoints, which just works fine,
so I'll probably stick to this solution.

Thanks anyway!

And you are probably right about the bug...

[Updated on: Thu, 21 February 2013 15:24]

Report message to a moderator

Previous Topic:Best practice for "invisible" figures with an EditPart?
Next Topic:customize gridlayout
Goto Forum:
  


Current Time: Tue Oct 21 09:00:52 GMT 2014

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

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