Skip to main content



      Home
Home » Eclipse Projects » GEF » label on connection with bendpoints not relocating
label on connection with bendpoints not relocating [message #168366] Tue, 15 February 2005 12:17 Go to next message
Eclipse UserFriend
I have a Connection with Bendpoints just like in the Logic example
(WireBendPoint). My connection also has a Label placed at the center using
MidpointLocator.

If i move the nodes when the connection is a straight line, the label moves
accordingly to the new center. However, if i move the connection using the
bendpoint so that my connection line is angled and not straight, the label
does not re-adjust to the new center. Assume the new connection line looks
like a V since in moved the bendpoint downwards. The label now sticks to the
center of one arm of the V and not to the center of the line.

How can i fix this? I have tried: locator.relocate(label) where locator is a
MidpointLocator. But this does not work.

thanks in advance
Sapna
Re: label on connection with bendpoints not relocating [message #168389 is a reply to message #168366] Tue, 15 February 2005 14:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Sounds like you are using the wrong locator. One locator is used for
handles, which appear at the end or middle of segments identified by their
index. Another locator is used for "special" locations along the polyline,
such as BEGIN, END, or CENTER, which is what you want.

"Sapna George" <sgeorge@vt.edu> escreveu na mensagem
news:cutamd$j5k$1@www.eclipse.org...
>I have a Connection with Bendpoints just like in the Logic example
> (WireBendPoint). My connection also has a Label placed at the center using
> MidpointLocator.
>
> If i move the nodes when the connection is a straight line, the label
> moves
> accordingly to the new center. However, if i move the connection using the
> bendpoint so that my connection line is angled and not straight, the label
> does not re-adjust to the new center. Assume the new connection line looks
> like a V since in moved the bendpoint downwards. The label now sticks to
> the
> center of one arm of the V and not to the center of the line.
>
> How can i fix this? I have tried: locator.relocate(label) where locator is
> a
> MidpointLocator. But this does not work.
>
> thanks in advance
> Sapna
>
>
Re: label on connection with bendpoints not relocating [message #168540 is a reply to message #168389] Wed, 16 February 2005 11:55 Go to previous message
Eclipse UserFriend
This label is intended to present the user with information about the
connection from the model. So, it's positioning should have nothing to do
with handles.

I'm not sure what to use for labels on the polyline. Maybe MidpointLocator
is not the one.

So, i tried the following:
ConnectionLocator locator = new ConnectionLocator(this);
add(label, locator);

It seemed to keep the label at the center of the connection when i moved the
bendpoint once. Assume the original straight line is now a V, the label
stays at the angle of the V. However, if i move the bendpoint of one arm of
the V so that now the line now looks something like this: </ , the lable now
moves to the center of the lower arm of the < !!!

I guess i can live with this visual behavior. But, out of curiosity, which
locator should i use for "informative" labels placed at the center of a
polyline?

thanks in advance,
Sapna


"Randy Hudson" <none@us.ibm.com> wrote in message
news:cutjnk$t9h$1@www.eclipse.org...
> Sounds like you are using the wrong locator. One locator is used for
> handles, which appear at the end or middle of segments identified by their
> index. Another locator is used for "special" locations along the
polyline,
> such as BEGIN, END, or CENTER, which is what you want.
>
> "Sapna George" <sgeorge@vt.edu> escreveu na mensagem
> news:cutamd$j5k$1@www.eclipse.org...
> >I have a Connection with Bendpoints just like in the Logic example
> > (WireBendPoint). My connection also has a Label placed at the center
using
> > MidpointLocator.
> >
> > If i move the nodes when the connection is a straight line, the label
> > moves
> > accordingly to the new center. However, if i move the connection using
the
> > bendpoint so that my connection line is angled and not straight, the
label
> > does not re-adjust to the new center. Assume the new connection line
looks
> > like a V since in moved the bendpoint downwards. The label now sticks to
> > the
> > center of one arm of the V and not to the center of the line.
> >
> > How can i fix this? I have tried: locator.relocate(label) where locator
is
> > a
> > MidpointLocator. But this does not work.
> >
> > thanks in advance
> > Sapna
> >
> >
>
>
Previous Topic:GEF and MultiPageEditorPart
Next Topic:SWT widgets in Figures
Goto Forum:
  


Current Time: Sat Jun 14 17:31:46 EDT 2025

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

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

Back to the top