How to make PolylineConnection line look smoother [message #190329] |
Wed, 03 August 2005 11:43 |
Eclipse User |
|
|
|
Originally posted by: erel.unicorn.com
I'm writing a GUI that draws a line between two figures.
the code is:
PolylineConnection conn = new PolylineConnection();
conn.setSourceAnchor(new EllipseAnchor(leftNode));
conn.setTargetAnchor(new EllipseAnchor(rightNode));
when moving the nodes the angle of the line between them is changing and
the line doesn't look smooth when not in %45 degrees.
how can I make the line smooth in any angle
thanks in advance
|
|
|
Re: How to make PolylineConnection line look smoother [message #190369 is a reply to message #190329] |
Wed, 03 August 2005 17:26 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Turn anti-aliasing on. If using GEF, you can use the
ConnectionLayer#setAntialias() method. Otherwise, you can just turn it on
for the GC in the paint() method of one of your figures (root or contents or
other parent figure).
This will enable advanced graphics functionality (provided by SWT), which
could fail if the proper libraries are not available on various platforms.
"Erel" <erel@unicorn.com> wrote in message
news:01242f6b63a2200a1953598a1725376c$1@www.eclipse.org...
>
> I'm writing a GUI that draws a line between two figures.
>
> the code is:
>
> PolylineConnection conn = new PolylineConnection();
> conn.setSourceAnchor(new EllipseAnchor(leftNode));
> conn.setTargetAnchor(new EllipseAnchor(rightNode));
>
> when moving the nodes the angle of the line between them is changing and
> the line doesn't look smooth when not in %45 degrees.
>
> how can I make the line smooth in any angle
>
>
> thanks in advance
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03336 seconds