Quote:- In the image file I have attached, in the red circle area, the node creates the link itself. how to fix it?
If you call createDiagramLink(sameNode, sameNode), the control assigns a self-loop Bezier shape to it, but that doesn't seem to consider the case when the self-loop link connects different anchor points. After creating the link and assigning the anchor points, you can set the link shape to whatever you like, e.g. try something like this -
PointF start = link.getStartPoint();
PointF end = link.getEndPoint();
link.setShape(LinkShape.Polyline);
link.setSegmentCount(4);
// case for right to top directon
PointList points = link.getControlPoints();
points.set(0, start);
points.set(1, new PointF(start.x + offset, start.y));
points.set(2, new PointF(start.x + offset, end.y - offset));
points.set(3, new PointF(end.x, end.y - offset));
points.set(4, end));
link.updateFromPoints()
Quote:- I want to define 4 corners of a shape node (top, bottom, left, right) to create the correct link?
Copy the first AnchorPattern definition from AnchorPoints sample project and assign it to your nodes, and then match your R/L/T/B port values to the respective point indices when you call setOriginAnchor / setDestinationAnchor.
Regards,
Slavcho