Recalculate GoLink route in a peculiar way

Hello, GoDiagram’s engineers!!!

I have a problem:
I have a class inherited from GoIconicNode on the GoView and 2 GoLink derived classes outcoming from the node Center (from the same point) in opposite directions.

GoLink instances have the following properties:

    Orthogonal = true;
    Style = GoStrokeStyle.RoundedLineWithJumpOvers;

I have to implement the behavior when I’m dragging one of the GoLink instances, that must not go inside the node boundary like at the picture bellow (the right GoLink is inside the node boundary):

GoLink instances mustn’t outcome from bottom or top of the node, they must outcome only from its sides (from left and right sides like at the first picture) (It’s shown at the next picture)

Also GoLink instances mustn’t intersect the node, they should simply bypass it without the node intersection they come from.

I suppose I should override CalculateStroke method, but is there more easy way to achieve such behavior. Maybe it can be implemented with GoDiagram standart means, or maybe you have a piece of code which can help me! :blush:

Thanks in advance!

P.S.: GoDiagram version is

Did you get my email?

Hello, Jake!
Sorry for late answer.
Yes, I did.
I use evaluating version of GoDiagram

Well, the default behavior of GoIconicNode is just to draw to the edge of the node…

But you are correct that orthognal links will connect to top and bottom too…

but… if in the port on the bottom star, I change the port.ToSpot to MiddleLeft (and also change port.EndSegmentLength to 30 for looks), I get:

There is also a “FromSpot”, which I’m guessing you would want to be MiddleRight.

Jake, thank you for the answer! It helped a little ))

I would like to describe my problems:
My each node has two connectors at its left and right sides. The connectors are implemented as two GoLinks which start from the Center of their node they belong to. I have to connect nodes through their connectors, i.e. the very end of one node connector should be connected to another node connector end. This connection should be done as it’s made in case of GoLink connects to some GoPort. This situation is illustrated at the picture below:

To achieve the desired result, I think that I should perform the following actions:

  1. Create GoPort instances for each connector and assign their FromPort properties. These ports must move with the node and provide moving of the connectors appropriately. In real I couldn’t achieve such behavior - I moved the ports in overrided setter Bound property method, but GoLinks (connectors) remained at the place they were. It seems strange, because the ports are connected with the connectors through the property GoLink.FromPort. Maybe I’m wrong.
  2. Create GoPort instances for each connector and assign their ToPort properties. In my opinion It should be done the connectors would be able to be connected with each other. These ports should have their Center properties equal the last point of its GoLink (if we resize or reshape GoLink (connector) then its port should move with the last point). But if we want to connect one connector end with another starting relinking operation, I think we have to remove ToPort at the start of relinking (method Start of GoToolRelinking) and add it again into GoDocument at the end of the operation (method Stop of GoToolRelinking). If we don’t remove we will not be able to connect GoLink (connector) with another connector that has GoPort ath the end.

These are my thoughts how to connect two different nodes through their connectors.
Am I on the right way or far away from the truth? Maybe there is more easy way to implement described behavior, and I just don’t know yet.
Thanks in advance.

Well, I found answers on my previous questions.
But I have the next question:
How is it possible to suppress relinking a link from its FromPort? :persevere:
My application mustn’t allow such behavior.