Connections in Liinux [message #92923] |
Mon, 08 September 2003 17:56  |
Eclipse User |
|
|
|
Originally posted by: gg.decisionsoft.co.uk
I am writing a program to display a tree using GEF.
However when I run under linux, maximizing the editor sometimes causes all the connections to be come disconnected.
They keep their size and shape, but are not in the correct place. It does not happen all the time and, as far as I can tell, never happens under windows.
Has anyone else experienced this problem and does anyone have a fix?
--
Geoff
|
|
|
|
Re: Connections in Liinux [message #93012 is a reply to message #92951] |
Tue, 09 September 2003 16:05  |
Eclipse User |
|
|
|
Originally posted by: gg.decisionsoft.co.uk
Randy Hudson wrote:
> It sounds like a potential bug in one of the connection anchors. Which
> anchor types are you using?
>
I've managed to fix the problem now.
I'm using my own connection anchor that subclasses AbstractConnectionAnchor.
Originally I was doing this:
public Point getLocation(Point reference) {
Rectangle r = Rectangle.SINGLETON;
r.setBounds(getOwner().getBounds());
Point p = r.getLocation();
p.x += r.width / 2;
return p;
}
But I had a look at the ChopBoxAnchor implementation and changed it to this:
public Point getLocation(Point reference) {
Rectangle r = Rectangle.SINGLETON;
r.setBounds(getOwner().getBounds());
r.translate(-1, -1);
r.resize(1, 1);
getOwner().translateToAbsolute(r);
Point p = r.getLocation();
p.x += r.width / 2;
return p;
}
This works, but I'm not sure why. Shouldn't the original have the same effect?
> "Geoff Gibbs" <gg@decisionsoft.co.uk> wrote in message
> news:bjhjo0$vf0$1@eclipse.org...
>
>>I am writing a program to display a tree using GEF.
>>
>>However when I run under linux, maximizing the editor sometimes causes all
>
> the connections to be come disconnected.
>
>>They keep their size and shape, but are not in the correct place. It does
>
> not happen all the time and, as far as I can tell, never happens under
> windows.
>
>>Has anyone else experienced this problem and does anyone have a fix?
>>--
>>Geoff
>>
>
>
>
--
Geoff
|
|
|
Powered by
FUDForum. Page generated in 0.28202 seconds