getLocation() method in GEF [message #41128] |
Mon, 11 November 2002 10:15  |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
I have a question regarding the getLocation() method in GEF.
When I create a component on the diagram, the getLocation() method will
return coordinate with respect to the diagram.
When I create a component on the container component, the getLocation()
method will return coordinate with respect to the container component.
But when I create a component on the diagram and then drag it to the
container component, the getLocation() method will return coordinate with
respect to the diagram. How can I find out the location of the child
component with respect to the new container component?
I think there is a method called translateToAbsolute(), but I think that
translate the coordinate to the coordinate with respect to the diagram. Is
this correct?
Thank you.
|
|
|
Re: getLocation() method in GEF [message #41190 is a reply to message #41128] |
Mon, 11 November 2002 10:27   |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
in ConstraintedLayoutEditPolicy see:
protected Object getConstraintFor (ChangeBoundsRequest request,
GraphicalEditPart child) {
I didn't understand all of your comments. AFAIK, getLocation() *always*
returns the location with respect to the Viewer. If you think that
sometimes it is relative to the diagram, try scrolling the diagram.
"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:aqofjf$h15$1@rogue.oti.com...
> I have a question regarding the getLocation() method in GEF.
> When I create a component on the diagram, the getLocation() method will
> return coordinate with respect to the diagram.
> When I create a component on the container component, the getLocation()
> method will return coordinate with respect to the container component.
> But when I create a component on the diagram and then drag it to the
> container component, the getLocation() method will return coordinate with
> respect to the diagram. How can I find out the location of the child
> component with respect to the new container component?
>
> I think there is a method called translateToAbsolute(), but I think that
The point is absolute already, so you might use translateToRelative(), but I
don't think that is sufficient either.
> translate the coordinate to the coordinate with respect to the diagram. Is
> this correct?
>
> Thank you.
>
>
|
|
|
Re: getLocation() method in GEF [message #41283 is a reply to message #41190] |
Mon, 11 November 2002 10:44   |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
Thanks.
But if the parent container component has a ScrollPane itself (like teh
Circuit in Logic Editor Example), so if I first create the component on the
diagram first and the drag that to the parent container component with
Scroll Pane, the getLocation will return the location with respect to the
diagram viewer, not the parent container viewer. How can I get the location
with respect to the diagram viewer?
"Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
news:aqogb1$hfo$1@rogue.oti.com...
> in ConstraintedLayoutEditPolicy see:
> protected Object getConstraintFor (ChangeBoundsRequest request,
> GraphicalEditPart child) {
>
> I didn't understand all of your comments. AFAIK, getLocation() *always*
> returns the location with respect to the Viewer. If you think that
> sometimes it is relative to the diagram, try scrolling the diagram.
>
> "Jack R." <radienssmgs2@hotmail.com> wrote in message
> news:aqofjf$h15$1@rogue.oti.com...
> > I have a question regarding the getLocation() method in GEF.
> > When I create a component on the diagram, the getLocation() method will
> > return coordinate with respect to the diagram.
> > When I create a component on the container component, the getLocation()
> > method will return coordinate with respect to the container component.
> > But when I create a component on the diagram and then drag it to the
> > container component, the getLocation() method will return coordinate
with
> > respect to the diagram. How can I find out the location of the child
> > component with respect to the new container component?
> >
> > I think there is a method called translateToAbsolute(), but I think that
>
> The point is absolute already, so you might use translateToRelative(), but
I
> don't think that is sufficient either.
>
> > translate the coordinate to the coordinate with respect to the diagram.
Is
> > this correct?
> >
> > Thank you.
> >
> >
>
>
|
|
|
Re: getLocation() method in GEF [message #41409 is a reply to message #41283] |
Mon, 11 November 2002 16:54  |
Eclipse User |
|
|
|
Originally posted by: radienssmgs2.hotmail.com
As Randy Hudson said getLocation() always returns the location with respect
to the Viewer.
If the component was in the diagram first and then drag and drop to a new
container (which has its own viewer), the getLocation() will return the
location respect to the diagram viewer or the new container?
"Jack R." <radienssmgs2@hotmail.com> wrote in message
news:aqoh9g$i5m$1@rogue.oti.com...
> Thanks.
> But if the parent container component has a ScrollPane itself (like teh
> Circuit in Logic Editor Example), so if I first create the component on
the
> diagram first and the drag that to the parent container component with
> Scroll Pane, the getLocation will return the location with respect to the
> diagram viewer, not the parent container viewer. How can I get the
location
> with respect to the diagram viewer?
>
>
> "Randy Hudson" <hudsonr@us.eye-bee-em.com> wrote in message
> news:aqogb1$hfo$1@rogue.oti.com...
> > in ConstraintedLayoutEditPolicy see:
> > protected Object getConstraintFor (ChangeBoundsRequest request,
> > GraphicalEditPart child) {
> >
> > I didn't understand all of your comments. AFAIK, getLocation() *always*
> > returns the location with respect to the Viewer. If you think that
> > sometimes it is relative to the diagram, try scrolling the diagram.
> >
> > "Jack R." <radienssmgs2@hotmail.com> wrote in message
> > news:aqofjf$h15$1@rogue.oti.com...
> > > I have a question regarding the getLocation() method in GEF.
> > > When I create a component on the diagram, the getLocation() method
will
> > > return coordinate with respect to the diagram.
> > > When I create a component on the container component, the
getLocation()
> > > method will return coordinate with respect to the container component.
> > > But when I create a component on the diagram and then drag it to the
> > > container component, the getLocation() method will return coordinate
> with
> > > respect to the diagram. How can I find out the location of the child
> > > component with respect to the new container component?
> > >
> > > I think there is a method called translateToAbsolute(), but I think
that
> >
> > The point is absolute already, so you might use translateToRelative(),
but
> I
> > don't think that is sufficient either.
> >
> > > translate the coordinate to the coordinate with respect to the
diagram.
> Is
> > > this correct?
> > >
> > > Thank you.
> > >
> > >
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07685 seconds