Links not connecting underneath nodes

Good afternoon,

In our application we have a node that connects two links but is rarely relevant to the user. Generally the user will wish to have this particular layer not visible.

Currently when the nodes are set as not visible there is a small, roughly 1 pixel x 1 pixel, gap between the links. This doesn’t happen for several of our other nodes but I just can’t see the difference at the moment.

Are there any likely causes of this sort of behaviour?

Thanks for any help.

I’m assuming that this node has a single port that both the in-comming and out-going links connect to. You probably just need to set the “to” and “from” spots of that port to Center:

<span =“apple-tab-span”="" style=“white-space:pre”> port.setFromSpot(GoObject.Center);
<span =“apple-tab-span”="" style=“white-space:pre”> port.setToSpot(GoObject.Center);

That will insure that the both the ending point of the first link and the starting point of the second link are at the same point.

Thanks for the reply SSmith.

That certainly does the job, in fact that is the reason why many of our other nodes perform as required. The downside to setting the from and to spots to Center is that the link directions become rigidly set to North, South, East and West by adding in extra points roughly 10 pixels away from the node center. This is great for many of our nodes but not this particular case. Is this JGo functionality or something that my predecessors have implemented?

Also, I have just noticed that this is not a problem with orthogonal links, only with straight (point to point) links.

You can avoid that by changing the end segment length to 0:

<span =“Apple-tab-span” style=“white-space:pre”> port.setEndSegmentLength(0);

Perfect solution! Thanks a lot ssmith!

I have just one more query, not sure if I should make a new topic for it.

Anyway, we have a node in our system which is 6x6 in size and often has more than 4 links attached to it. With orthogonal links, if 3 or more links are entering/leaving the same side of the node, it becomes hard to distinguish which link is which. With straight (point to point) links, we have got around this problem by spreading either the first or last points which creates a sort of V shape leaving the node.

With orthogonal links, ideally we would like the same behaviour however just spreading the links out a little better would be a start. Is there a value anywhere that controls how much the links are spread out across one side of a node/nodes bounding box? I imagine it is related to the node size but I haven’t found it yet.

Thanks for all your help so far.

There’s no built-in setting that will automatically spread multiple orthonognal links coming from or going to a single port. If orthogonal links are necessary, you might want to consider having multiple incoming and outgoing ports on each node, perhaps something like GeneralNode in the examples folder. Another approach would be to continue to use a single port, but create your JGoPort subclass and override getFromLinkPoint and getToLinkPoint to determine where on that port links should start and end. In either of the above cases, you would probably also want to change the EndSegmentLength of each port to avoid overlapping link segments.

However, the simpler approach is to just use straight links.