This project is read-only.

Add connector

Apr 24, 2012 at 8:18 AM


I'd like to know how to let users interactively draw connectors to a diagram. I saw that setting InteractiveMode to AddConnector, user can add connectors dragging from a shape to another.

I my case I want to force user to add connector from exit ports to shapes only (i'll use events to force);   now I'm trying to add a custom behaviour: when users drags a port, a new connector automatically adds to drawing with start connected to port and the end is floating with mouse movement.

Is there a simple way to achive that? Else, I can made changes to the library, adding a new InteractiveMode, and commit here; but I'd need help understanding library code structure.

Best regards

Dec 3, 2014 at 1:57 PM
Any news about this request? I'm interested too
Oct 14, 2015 at 9:10 AM

I've just started using this lib a few weeks ago, and had the same problem. I know this is an old question but it may come in handy for others.

I solved this by removing the auto created line in the ElementMouseUp event handler.

In my application the InteractiveMode is set to Normal by default, and set to AddConnector in ElementMouseDown when pressing Ctrl. In the ElementMouseUp i remove the new line to show a dialog instead. If user choose to create a connection in the dialog it will create a connector between two ports instead of the default link created by the lib.