Link object coordinates

One more piece to the keyboard navigation puzzle, links.

I’m implementing a way to select links. The idea is that you would use Alt+Arrow and it would start navigating the links in a clockwise fashion starting at the 12, 3, 6 or 9 o’clock and find the closest next one. From there you would go forward backward based on their relative location.

Most of my cases are rectangles with default spot, so not too complex, but wondering if you have any starting point that we can use.

Thanks
Alain

That’s a nice idea. Sorry, I do not recall that we have any samples that implement that.

I completed keyboard selection and navigation and moving on to “move”.

I’m looking to adapt the LinkShifting tool to do the job, but my DrawCommandHandler has been enhanced to allow the user to toggle the arrowKeyBehavior. I would like to keep the key dispatching in there but a bit confused if I can and if so how to operate the LinkShifting tool from my command handler. Or any other better approach?

Thanks as always
Alain

If you can invoke a tool, then its Tool.doKeyDown method can handle whatever keystrokes that you want.

Hmmm, looking at the LinkShiftingTool, it doesn’t seem as if it were designed to be invoked programmatically very naturally. We did do that for some of the built-in tools, but apparently not for that extension. You’ll have to modify a copy of the tool so that you can programmatically assign the tool handle and change LinkShiftingTool.doActivate not to search for the handle if one has already been supplied via assignment before setting Diagram.currentTool to be the LinkShiftingTool and then activating the tool by executing myDiagram.currentTool.doActivate().

Thanks, got it all working.