label on connection with bendpoints not relocating [message #168366] |
Tue, 15 February 2005 12:17  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
> >
> >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05498 seconds