Skip to main content



      Home
Home » Eclipse Projects » GEF » Location of child parts in container
Location of child parts in container [message #159649] Mon, 29 November 2004 23:10 Go to next message
Eclipse UserFriend
I have an EditPart which uses a LabeledContainer and which accepts parts
that are Labels, using ToolbarLayout to position them vertically. I
would like to put ConnectionAnchors on the sides of the container that
line up with the contained parts. I thought to do this in
refreshChildren for the container but I can't figure out how to get the
actual location of the children. I have tried traversing the child
EditParts and the children of the LabeledContainer Figure but getBounds
always returns the same unhelpful values. I thought to try
translateToParent but that seems to be hardwired to do nothing. Is this
method too early to get the rendered location? It seems to run after
refreshVisuals.

Thanks.
Re: Location of child parts in container [message #159802 is a reply to message #159649] Tue, 30 November 2004 11:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Your anchor should derive the location when it is asked getLocation. If you
do it any sooner, the figures aren't in the correct place. For performance
reasons, layouts only occur hopefully once and in the order of depencies,
such as connections depending on their nodes.

"Barry Lay" <blay@laysercomputing.com> wrote in message
news:cogrs1$flo$1@www.eclipse.org...
> I have an EditPart which uses a LabeledContainer and which accepts parts
> that are Labels, using ToolbarLayout to position them vertically. I
> would like to put ConnectionAnchors on the sides of the container that
> line up with the contained parts. I thought to do this in
> refreshChildren for the container but I can't figure out how to get the
> actual location of the children. I have tried traversing the child
> EditParts and the children of the LabeledContainer Figure but getBounds
> always returns the same unhelpful values. I thought to try
> translateToParent but that seems to be hardwired to do nothing. Is this
> method too early to get the rendered location? It seems to run after
> refreshVisuals.
>
> Thanks.
Re: Location of child parts in container [message #159820 is a reply to message #159802] Tue, 30 November 2004 14:17 Go to previous messageGo to next message
Eclipse UserFriend
Thank you, that got the job done. Incidently, what does the parameter
do? The API mentions that the anchor "...may use the given reference
Point..." but doesn't say what it refers to. I notice that the logic
diagram example ignores it.

Randy Hudson wrote:
> Your anchor should derive the location when it is asked getLocation. If you
> do it any sooner, the figures aren't in the correct place. For performance
> reasons, layouts only occur hopefully once and in the order of depencies,
> such as connections depending on their nodes.
Re: Location of child parts in container [message #159854 is a reply to message #159820] Tue, 30 November 2004 15:54 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

See ChopboxAnchor for an example
"Barry Lay" <blay@laysercomputing.com> wrote in message
news:coigvs$kp7$1@www.eclipse.org...
> Thank you, that got the job done. Incidently, what does the parameter
> do? The API mentions that the anchor "...may use the given reference
> Point..." but doesn't say what it refers to. I notice that the logic
> diagram example ignores it.
>
> Randy Hudson wrote:
> > Your anchor should derive the location when it is asked getLocation. If
you
> > do it any sooner, the figures aren't in the correct place. For
performance
> > reasons, layouts only occur hopefully once and in the order of
depencies,
> > such as connections depending on their nodes.
Previous Topic:TextFlow and BlockFlow is-a Figure?
Next Topic:Tie into Save All
Goto Forum:
  


Current Time: Thu May 08 07:13:48 EDT 2025

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

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

Back to the top