we like to change the default behavior of ports like…
If the user click on a port, the port is changed its position. - The linking from port to port is calling from a context menu item
I have already implement a port moving tool like your example and it works fine. But now I am searching for the right place to insert the three tools (PortMovingTool, ToolRelinking, ToolLinkingNew). I try to Replace the MouseTool in the view… but your default behavior is shown (the port want to link to another port).
Can you help me please? Thanks.
If you only want users to draw new links when they invoke a command (such as from a context menu item), then you don’t want users to start the GoToolLinkingNew tool modelessly and you want to start that tool from your code.
You can achieve the former by removing that tool from the list of the GoView’s mouse tools:
To start a linking operation programmatically, do something like:
GoToolLinkingNew tool = new GoToolLinkingNew(goView1); tool.OriginalStartPort = theCurrentPort; goView1.Tool = tool;
This is demonstrated in commented-out code in the LimitedNode example class of Demo1.