Connections stop one pixel short of node [message #198714] |
Wed, 12 October 2005 12:44  |
Eclipse User |
|
|
|
Since release 3.1, I have seen a strange anomaly in my diagrams: connections
that touch my node on the top or left side stop one pixel short of the node
itself. This does not happen if there is a decoration on that connection end
or if the connection has a very shallow angle to the node. What could be the
cause of this?
|
|
|
|
|
|
|
|
Re: Connections stop one pixel short of node [message #199371 is a reply to message #199339] |
Fri, 14 October 2005 11:19   |
Eclipse User |
|
|
|
Well, I hope I didn't make a stupid mistake somewhere, but here is my little
project.
I run it in the debugger as an Eclipse application, all you need is a file
with the extension .diagram to open the editor.
There are 3 hardcoded nodes with connections between them. When the diagram
opens, you should see a gap in the connection between Node3 and Node1 where
it goes into Node3, which is the source. The same is true for the connection
from Node2 to Node3. There is no gap in the connection from Node1 to Node2
because it leaves Node1 at an angle where the gap doesn't occur. When you
move Node2 to the left, the gap in the connection from Node2 to Node3
disappears when the angle becomes 45 degrees or when Node2 is directly
underneath Node1. You have to deselect Node2 to see the effect.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:diogcm$eqp$1@news.eclipse.org...
> Are you sure that the node to which the connection is attached is entirely
> filling its own bounds?
> Which connection anchor class are you using?
>
> Here is what I am referring to by a Snippet:
>
> public class ConnectionSnippet {
>
> public static void main(String[] args) {
>
> Display d = new Display();
> Shell shell = new Shell(d);
> shell.setLayout(new FillLayout());
> FigureCanvas canvas = new FigureCanvas(shell);
>
> Figure connectionPanel = new Figure();
>
> RectangleFigure
> node1 = new RectangleFigure(),
> node2 = new RectangleFigure();
> node1.setBackgroundColor(ColorConstants.red);
> node1.setOutline(false);
> node1.setBounds(new Rectangle(40,40, 50, 30));
> node2.setBackgroundColor(ColorConstants.blue);
> node2.setOutline(false);
> node2.setBounds(new Rectangle(100, 140, 50, 30));
>
> PolylineConnection conn = new PolylineConnection();
> conn.setSourceAnchor(new ChopboxAnchor(node1));
> conn.setTargetAnchor(new ChopboxAnchor(node2));
> connectionPanel.add(node1);
> connectionPanel.add(node2);
> connectionPanel.add(conn);
>
> canvas.setContents(connectionPanel);
>
> shell.open();
> while (!shell.isDisposed())
> while (!d.readAndDispatch())
> d.sleep();
>
> }
>
> }
>
>
Attachment: testGEF.zip
(Size: 89.55KB, Downloaded 142 times)
|
|
|
Re: Connections stop one pixel short of node [message #200147 is a reply to message #199371] |
Thu, 20 October 2005 16:39   |
Eclipse User |
|
|
|
Were you able to reproduce the problem with this?
"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dioia2$hhi$1@news.eclipse.org...
> Well, I hope I didn't make a stupid mistake somewhere, but here is my
> little project.
> I run it in the debugger as an Eclipse application, all you need is a file
> with the extension .diagram to open the editor.
>
> There are 3 hardcoded nodes with connections between them. When the
> diagram opens, you should see a gap in the connection between Node3 and
> Node1 where it goes into Node3, which is the source. The same is true for
> the connection from Node2 to Node3. There is no gap in the connection from
> Node1 to Node2 because it leaves Node1 at an angle where the gap doesn't
> occur. When you move Node2 to the left, the gap in the connection from
> Node2 to Node3 disappears when the angle becomes 45 degrees or when Node2
> is directly underneath Node1. You have to deselect Node2 to see the
> effect.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:diogcm$eqp$1@news.eclipse.org...
>> Are you sure that the node to which the connection is attached is
>> entirely
>> filling its own bounds?
>> Which connection anchor class are you using?
>>
>> Here is what I am referring to by a Snippet:
>>
>> public class ConnectionSnippet {
>>
>> public static void main(String[] args) {
>>
>> Display d = new Display();
>> Shell shell = new Shell(d);
>> shell.setLayout(new FillLayout());
>> FigureCanvas canvas = new FigureCanvas(shell);
>>
>> Figure connectionPanel = new Figure();
>>
>> RectangleFigure
>> node1 = new RectangleFigure(),
>> node2 = new RectangleFigure();
>> node1.setBackgroundColor(ColorConstants.red);
>> node1.setOutline(false);
>> node1.setBounds(new Rectangle(40,40, 50, 30));
>> node2.setBackgroundColor(ColorConstants.blue);
>> node2.setOutline(false);
>> node2.setBounds(new Rectangle(100, 140, 50, 30));
>>
>> PolylineConnection conn = new PolylineConnection();
>> conn.setSourceAnchor(new ChopboxAnchor(node1));
>> conn.setTargetAnchor(new ChopboxAnchor(node2));
>> connectionPanel.add(node1);
>> connectionPanel.add(node2);
>> connectionPanel.add(conn);
>>
>> canvas.setContents(connectionPanel);
>>
>> shell.open();
>> while (!shell.isDisposed())
>> while (!d.readAndDispatch())
>> d.sleep();
>>
>> }
>>
>> }
>>
>>
>
>
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06188 seconds