Highlight nodes allowed for linking

Hi,

I would like to highlight all nodes which can be linked to a specific node. The highlighting should apply when the user starts to create the link (i.e by clicking on the port and start dragging the mouse).

How could I implement this? I was looking for an event which is fired when the linking is started but I couldn’t find any. Maybe there is even an easier solution?

Best regards,
Dominic

Override LinkingTool.doActivate to call the base method and then highlight the desired nodes. LinkingTool.isForwards tells you whether LinkingTool.originalFromNode or LinkingTool.originalToNode is the Node that the user is starting from.

And override LinkingTool.doDeactivate to clean up any highlighting before calling the base method.

In case you haven’t read this already: Extending GoJS -- Northwoods Software

Thank you, works perfectly!