Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Connections stop one pixel short of node
Connections stop one pixel short of node [message #198714] Wed, 12 October 2005 16:44 Go to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
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 #198755 is a reply to message #198714] Wed, 12 October 2005 17:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Does this happen at the source/origin of the connection, or only at the
target end?

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dijei3$8i1$1@news.eclipse.org...
> 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 #198794 is a reply to message #198755] Wed, 12 October 2005 17:28 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
It does happen at the source of the connection, but I cannot immediately day
if it happens at the target also because at the target there is usually a
decoration. Also I saw that one connection which did not have any decoration
did touch the source and target nodes properly without the 1-pixel gap. And
once the angle between the top of the node and the connection becomes 45
degrees or less, the gap vanishes also.
Do you need me to look for the target end specifically?

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dijg9e$as1$1@news.eclipse.org...
> Does this happen at the source/origin of the connection, or only at the
> target end?
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dijei3$8i1$1@news.eclipse.org...
>> 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 #198809 is a reply to message #198794] Wed, 12 October 2005 17:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

On win32, we used to paint an extra dot at the end of the connection. This
was done in SWTGraphics#drawPolyline(PointList).
SWT fixed this inconsistency and we removed our workaround.

You should try reproducing in the logic example, and/or post a snippet
showing the problem.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dijh3p$btd$1@news.eclipse.org...
> It does happen at the source of the connection, but I cannot immediately
> day if it happens at the target also because at the target there is
> usually a decoration. Also I saw that one connection which did not have
> any decoration did touch the source and target nodes properly without the
> 1-pixel gap. And once the angle between the top of the node and the
> connection becomes 45 degrees or less, the gap vanishes also.
> Do you need me to look for the target end specifically?
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:dijg9e$as1$1@news.eclipse.org...
>> Does this happen at the source/origin of the connection, or only at the
>> target end?
>>
>> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>> news:dijei3$8i1$1@news.eclipse.org...
>>> 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 #199130 is a reply to message #198809] Thu, 13 October 2005 20:23 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I created a minimal graphical editor and found the following:

- The 1-pixel gap happens only on the source side of connections, not the
target side.
- The 1-pixel gap happens only if the connection leaves the source node at
an angle between 7.30 and 1.30 on a clock (i.e. only in the "evening").

I can zip and attach the Eclipse project if you want.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:dijhg9$cgd$1@news.eclipse.org...
> On win32, we used to paint an extra dot at the end of the connection. This
> was done in SWTGraphics#drawPolyline(PointList).
> SWT fixed this inconsistency and we removed our workaround.
>
> You should try reproducing in the logic example, and/or post a snippet
> showing the problem.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dijh3p$btd$1@news.eclipse.org...
>> It does happen at the source of the connection, but I cannot immediately
>> day if it happens at the target also because at the target there is
>> usually a decoration. Also I saw that one connection which did not have
>> any decoration did touch the source and target nodes properly without the
>> 1-pixel gap. And once the angle between the top of the node and the
>> connection becomes 45 degrees or less, the gap vanishes also.
>> Do you need me to look for the target end specifically?
>>
>> "Randy Hudson" <none@us.ibm.com> wrote in message
>> news:dijg9e$as1$1@news.eclipse.org...
>>> Does this happen at the source/origin of the connection, or only at the
>>> target end?
>>>
>>> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>>> news:dijei3$8i1$1@news.eclipse.org...
>>>> 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 #199339 is a reply to message #199130] Fri, 14 October 2005 14:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

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();

}

}
Re: Connections stop one pixel short of node [message #199371 is a reply to message #199339] Fri, 14 October 2005 15:19 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
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 125 times)
Re: Connections stop one pixel short of node [message #200147 is a reply to message #199371] Thu, 20 October 2005 20:39 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
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();
>>
>> }
>>
>> }
>>
>>
>
>
>
Re: Connections stop one pixel short of node [message #200449 is a reply to message #200147] Mon, 24 October 2005 14:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Please see the snippet I attached and modify it to reproduce the problem you
are having.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dj8v9b$til$1@news.eclipse.org...
> Were you able to reproduce the problem with this?
Re: Connections stop one pixel short of node [message #200472 is a reply to message #200449] Mon, 24 October 2005 16:04 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I cannot see any attachment. If you want, you can send it directly to my
email address.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:djisgt$j0b$1@news.eclipse.org...
> Please see the snippet I attached and modify it to reproduce the problem
> you are having.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:dj8v9b$til$1@news.eclipse.org...
>> Were you able to reproduce the problem with this?
>
>
Re: Connections stop one pixel short of node [message #200615 is a reply to message #200472] Tue, 25 October 2005 17:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I meant pasted, not attached.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:djj0mb$poe$1@news.eclipse.org...
>I cannot see any attachment. If you want, you can send it directly to my
>email address.
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:djisgt$j0b$1@news.eclipse.org...
>> Please see the snippet I attached and modify it to reproduce the problem
>> you are having.
>>
>> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>> news:dj8v9b$til$1@news.eclipse.org...
>>> Were you able to reproduce the problem with this?
>>
>>
>
>
Re: Connections stop one pixel short of node [message #201031 is a reply to message #200615] Fri, 28 October 2005 18:01 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Ah, I had overlooked that code. My issue is easy to reproduce making node2
the source of the connection:
conn.setSourceAnchor( new ChopboxAnchor( node2 ) );
conn.setTargetAnchor( new ChopboxAnchor( node1 ) );


"Randy Hudson" <none@us.ibm.com> wrote in message
news:djlobg$lr2$1@news.eclipse.org...
>I meant pasted, not attached.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:djj0mb$poe$1@news.eclipse.org...
>>I cannot see any attachment. If you want, you can send it directly to my
>>email address.
>>
>> "Randy Hudson" <none@us.ibm.com> wrote in message
>> news:djisgt$j0b$1@news.eclipse.org...
>>> Please see the snippet I attached and modify it to reproduce the problem
>>> you are having.
>>>
>>> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
>>> news:dj8v9b$til$1@news.eclipse.org...
>>>> Were you able to reproduce the problem with this?
>>>
>>>
>>
>>
>
>
Previous Topic:Copy diagram to system clipboard?
Next Topic:how create new geometrical shapes
Goto Forum:
  


Current Time: Mon Sep 23 06:13:02 GMT 2024

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

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

Back to the top