Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connection in FreeFormLayout
Connection in FreeFormLayout [message #245603] Thu, 18 September 2008 14:43 Go to next message
Mikhail is currently offline MikhailFriend
Messages: 2
Registered: July 2009
Junior Member
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 18:53 Go to previous messageGo to next message
Eclipse UserFriend
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 15:20 Go to previous message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
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


Previous Topic:[Announce] GEF 3.5.0M2 is available
Next Topic:Zest custom figures
Goto Forum:
  


Current Time: Tue Mar 19 06:29:38 GMT 2024

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

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

Back to the top