Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Getting zoom information from inside a ConnectionAnchor
Getting zoom information from inside a ConnectionAnchor [message #234936] Tue, 30 June 2009 20:28 Go to next message
Eclipse UserFriend
Originally posted by: johan.harjono.utoronto.ca

Hi,

I had my own custom algorithm to determine where a connection anchor
should be. It works well when the zoom level is 100%, but not when the
zoom level is any less. I need to take the zoom level into consideration
when I calculate the coordinates.

I know I can access the ZoomManager (and hence the zoom info) of the
diagram from any EditPart, but I don't know how to get the zoom info
from inside a ConnectionAnchor (in which I calculate the anchor
coordinates inside its getLocation())

How can a ConnectionAnchor access the zoom information of the diagram?

thanks,
Johan
Re: Getting zoom information from inside a ConnectionAnchor [message #234973 is a reply to message #234936] Wed, 01 July 2009 11:38 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Johan,

I think you can call DiagramFigure.translateToRelative() to translate absolute
coordinates into the "zoomed" coordinates.

-----------------
Alex Shatalin
Re: Getting zoom information from inside a ConnectionAnchor [message #235140 is a reply to message #234973] Thu, 02 July 2009 16:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johan.harjono.utoronto.ca

Hi,

Thanks for the idea. Unfortunately it did not work for me.
How about IFigure? is it possible to get the zoom level from an IFigure?

Johan
Re: Getting zoom information from inside a ConnectionAnchor [message #235147 is a reply to message #235140] Thu, 02 July 2009 18:03 Go to previous message
Eclipse UserFriend
Originally posted by: johan.harjono.utoronto.ca

Hi,

I found a workaround, it's not the most elegant solution but it works :)
I basically set it so that a few figures can have access to their
EditParts, and from there I can access the diagram's ZoomManager

cheers,
Johan
Previous Topic:"Invalid view - remove from diagram" on diagrams created with older GMF opened in latest G
Next Topic:Folding compartment
Goto Forum:
  


Current Time: Fri Apr 03 11:25:46 GMT 2020

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

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

Back to the top