Connection in FreeFormLayout [message #245603] |
Thu, 18 September 2008 10:43  |
Eclipse User |
|
|
|
I need to do connections with some elements, that are quite far from
source in layout. Something like a reference.
First, i did it with redefining getTargetConnectionAnchor in target
element's editpart. I wrote my specific ConnectionAnchor with new
getLocation method. So i have short horizontal connections, going from
source to nearest place near source. But if move down scrolling in my
editor, these connections are realy bad repaint and eclipse environment
becomes dead. This is the same with zooming.
Is there some tutorials on how i can create connections that are not
connected to target element, just "hanging in the air"?
It was also a good idea to duplicate target element graphically on the
viewer and establish connection not with target, but with its copy, but i
don't know how to do it, Any tutorials with such examples would be also
much appreciated.
Regards, Michael
|
|
|
Re: Connection in FreeFormLayout [message #245606 is a reply to message #245603] |
Thu, 18 September 2008 14:53   |
Eclipse User |
|
|
|
Originally posted by: felix.mayer.erdas.com
An XYAnchor lets you end a connection in the "air", not sure if that helps
in your case.
"Mikhail " <cjpipa@mail.ru> wrote in message
news:e4f263712ee469b539aac10aa93ca749$1@www.eclipse.org...
>I need to do connections with some elements, that are quite far from source
>in layout. Something like a reference.
> First, i did it with redefining getTargetConnectionAnchor in target
> element's editpart. I wrote my specific ConnectionAnchor with new
> getLocation method. So i have short horizontal connections, going from
> source to nearest place near source. But if move down scrolling in my
> editor, these connections are realy bad repaint and eclipse environment
> becomes dead. This is the same with zooming.
>
> Is there some tutorials on how i can create connections that are not
> connected to target element, just "hanging in the air"?
>
> It was also a good idea to duplicate target element graphically on the
> viewer and establish connection not with target, but with its copy, but i
> don't know how to do it, Any tutorials with such examples would be also
> much appreciated.
>
> Regards, Michael
|
|
|
Re: Connection in FreeFormLayout [message #245676 is a reply to message #245606] |
Wed, 24 September 2008 11:20  |
Eclipse User |
|
|
|
In our app the user needs to be able to define an arbitrary 'gap' between
a polyline connection and its node. our solution subclasses
PolyLineConnectionin draw2d to override outlineShape(Graphics g). In this
overrided method we calculate where the start of the visible line is based
on the 'gap' supplied form the model.
So in this case, the endpoint of the link is still that returned by
getSrc/TargetAnchor but the visible line is truncated.
I can send more details if this is promisiing for you.
I.e., we have
--
s1 | -----------------> Shp2
--
rather than:
--
s1 |----------------->Shp2
--
Richard
|
|
|
Powered by
FUDForum. Page generated in 0.07294 seconds