Im trying to move the link start point I know where this point is with the method getStartPoint() but how would I change this start point? I have tried changing the x, y of the bounding rectangle of the link but the link at times does not connect to the node i.e. it either ends up to the left right top bottom of the node. I have tried using the setPoint(int i,int x,int y) method but it never changes the start point. Im not sure if im selecting the right point for the the index of the point to change.
It’s really the port’s responsibility to figure out where the link’s stroke should end (at either point 0 for the From end, or at point getNumPoints()-1 for the To end).
So that usually means either setting the JGoPort’s FromSpot and ToSpot (for the simplest cases), or overriding getFromLinkPoint and getToLinkPoint (when the port’s spot is NoSpot).
Im changing the start point of the links in the paint method in my class which extends JGoLabeledLink and I check if the start points collide I change the start point since my links are orthogonal. Wouldnt it be easier to just use setPoint(int i, int x, int y)? But like I said I have tried that but the changes are never displayed? I also tried like u suggested to override getFromLinkPoint and getToLinkPoint setting the setFromSpot(JGoPort.NoSpot) and setToSpot(JGoPort.NoSpot) but it never took the updates even though the methods were returning new points
Whoa! You don’t want to be making any changes to any JGoObjects during any paint method. That might be why you are getting odd behavior, although that isn’t clear.