Can't get link straight

Hi!

Using JGo 5.1 there seems no way to get a JGoLink straight. Other than
said in the documentation my links are orthogonal by default and this
can not be switched off using setOrthogonal(false).

The following gets ignored, too. Pretty strange… I can change Pen and Brush and I am not working with a subclass of JGoLink…

link.setArrowHeads(false, false);

Are you saying that calling JGoLink.setOrthogonal and JGoStroke.setArrowHeads don’t work?
That is indeed quite strange. Are you sure you are actually calling those methods on the objects that are actually in the document?

I just found out what happened… For some reason unknown to me someone added this to our extension to JGoDocument:

public void documentChanged(JGoDocumentEvent e) {
super.documentChanged(e);

switch (e.getHint()) {
  case JGoDocumentEvent.INSERTED:
    if (e.getJGoObject() instanceof JGoLink) {
      // jeder neue Link bekommt vorn einen Pfeil dran
      JGoLink link = (JGoLink) e.getJGoObject();
      JGoPort port = link.getToPort();
      if (port != null) {

     &nbs p;  link.setArrowHeads(false, true);

     &nbs p;  link.setOrthogonal(true);

     &nbs p;  link.setAvoidsNodes(true);

     &nbs p;  link.setJumpsOver(true);
      }
    }
    break;
}

}

That lead to that strange behaviour unless I’m working within a transaction.

Sorry for posting :-/