Relink a link with path points

My link type is orthogonal and relinkable. I can relink it to another jgo node. But after I move its orthogonal points a bit, the link is resized, I cannot relink it like before: When I drag around the end point handle, the link doesn’t get redrawn. If I keep dragging it to another node, release the mouse, nothing seems changed, the link seems still linked to the old node. But after I move the second node a bit to trigger the ‘redraw’, it appears to be relinked.
I’ve overwritten a few JGoLabeledLink methods: addOrthoPoints, calculateStroke, gainedSelection, geometryChange and handleResize. How to debug this issue?

Do you have any problems if you don’t override gainedSelection and handleResize? If not, then your other overrides are probably OK. Although it seems unusual, but still plausible, to override both calculateStroke and addOrthoPoints.
What do you do in your override of gainedSelection?

It works if I don’t override calculateStroke. Here is the code, it is used to make reshaped link persistable
public void calculateStroke() {
//get saved path points.
Point[] pathPoints = getPathPoints();
if (pathPoints != null) {
Vector points = new Vector();
for (int i = 0; i < pathPoints.length; i++){
points.add(pathPoints);
}

setPoints(points);
return;
}
// Let JGo layout the route path
super.calculateStroke();
}

It looks like your override of calculateStroke just restores the points returned by getPathPoints(), if any; otherwise it performs the standard routing (stroke path calculation).
So if getPathPoints() is returning an array holding the original points of the stroke, it will just keep that stroke path. It seems you need to cause getPathPoints() to return null sooner.

That solved the problem. thank you very much!