[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Connections stop one pixel short of node

Were you able to reproduce the problem with this?

"Felix L J Mayer" <felix.mayer@xxxxxxxxxxxxx> wrote in message 
news:dioia2$hhi$1@xxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxx> wrote in message 
> news:diogcm$eqp$1@xxxxxxxxxxxxxxxxxxx
>> 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();
>>
>> }
>>
>> }
>>
>>
>
>
>