[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: Still struggling with coordinates
|
Think of absolute and local (relative) as two different coordinate systems.
translateToRelative() translates the coordinates to that figure's local
coordinate system, which may not necessarily be relative to that figure's
origin (as is the case with ScalableLayeredPane). In your case, the parent
and child are in the same coordinate system, which is why
translateToRelative() does nothing. To do what you want, you can just
subtract the parent's location from that of the child's. What are you using
this for?
The new GEF help documentation (3.1.1 and later) has a section on
coordinates that might clear things up for you.
"Brad Reynolds" <bradleyjames@xxxxxxxxx> wrote in message
news:di9r6f$qdk$1@xxxxxxxxxxxxxxxxxxx
> There's something fundamental that I'm missing and hopefully someone can
> straighten me out. I have a figure that contains another figure. What
> I want is to be able to get the coordinates of the child figure relative
> to it's parent's figure. When I call any of the translate methods the
> check to useLocalCoordinates() always returns false so it doesn't
> translate. How can I translate a figure's bounds to be relative to it's
> parent?
>
> Thanks,
> Brad