|
Re: Still struggling with coordinates [message #198251 is a reply to message #198240] |
Sun, 09 October 2005 01:29 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
What you are asking is the opposite of what XYLayout does when it lays out.
So refer to its layout method
"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:di9r6f$qdk$1@news.eclipse.org...
> 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
|
|
|
Re: Still struggling with coordinates [message #198255 is a reply to message #198240] |
Sun, 09 October 2005 01:48 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
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@gmail.com> wrote in message
news:di9r6f$qdk$1@news.eclipse.org...
> 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds