Replace the default link type

Hi There,

I just want to replace the default link type of
JGOView to use myInhertedLinkType instead of JGoLink.

I used to do this using GODiagram for C# … By
adding this line to the view

MyView.ReplaceMouseTool(typeof(GoToolLinkingNew),new MyCustomLinkTool(MyView));

MyCustomLinkTool inheret the GoToolLinkingNew to return the type of link that should be drawn..

So I try to act same procedures , but I didn't find similar classes in JGO compoment.

What I tried to do is follow the processor sample as it use a different link Type "FlowLink". I did the following steps

  • NewLinkClass inheret from JGOLabeledLink .
  • NewDocumenClass inheret from JGODocument.. create a new method
      • public BpmnLink newLink() { BpmnLi nk ll = new BpmnLink(); return ll; }
  • Set The document of MyViewClass with the new documentType
  • Overide the Newlink method in MyViewClass

public void newLink(JGoPort from, JGoPort to)

{

JGoLink l = getDoc().newLink(from, to);

fireUpdate(JGoViewEvent.LINK_CREATED, 0, l);

getDoc().endTransaction(“new FlowLink”);

}

Nothing Happened , so I really appericate if I can get help in this. Do I miss any steps.or there is a simple way to do such actions

Thanks In Advance

Yes, the notion of “tools” was introduced in GoDiagram. We have long considered adding “tools” to JGo, although maintaining compatibility might be difficult.
I think you’re taking the right approach (assuming you do need all of those subclasses) by overriding JGoView.newLink.
However, you seem to be calling some other method of your document class: newLink(JGoPort, JGoPort) instead of the newLink() method you defined on your document subclass.
And you also aren’t adding the link to the document, neither in the document’s newLink method, nor in the JGoView.newLink method.