Select link points

Hi,

is there a way we can make link points (we call it “bendpoints”) selectable entities?

Usage scenario is this:

  • there’s 2 nodes connected via a link, but that link has a couple of bendpoints (maybe one closer to the start node and another closer to the end node)
  • We would like to be able to lasso select (or shift click select) the start node and the closest bendpoint and drag/move them together - without moving the furthest bendpoint.

Thanks,

The reshaping handles shown on selected Links that are reshapable belong to an Adornment created by the LinkReshapingTool: GoJS Tools -- Northwoods Software. They are not separate Parts, so they cannot be selected like Nodes or Links.

If you set Link.adjusting to go.Link.End, perhaps you will get the effect that you are asking for when the user moves a Node. It depends a lot on the details.

Yeah, I figured as much…thanks. We’ll try to come up with a clever solution to this user request, or drop the requirement altogether.

If my suggestion was inadequate, you could implement a “SelectionMoved” DiagramEvent listener to update the routes of connected links, if you know what to do. Otherwise you will need to implement it by overriding DraggingTool.doActivate to either:

  • temporarily set Link.adjusting, or
  • remember the offsets/routes of the connected links before the dragging starts.
    And override DraggingTool.doDropOnto (I believe this is the most convenient) to respectively either:
  • reset Link.adjusting, or
  • modify the routes of the connected links

I hope this explanation helps.

Link.adjusting doesn’t work for us as we’re already doing “custom route computation”, so toggling that property on/off, didn’t seem to have any effect.

But your suggestion was fine…I provided a “simple limited example” in my question…the real “user request” is more complex, though, for example, this would need to support multi-selection of nodes / links / bendpoints, and they could “choose” to drag more than one bendpoint but not all, from a link, or all, or drag a bendpoint from another link that is not connected to the node being dragged but shares the same coordinates (junction points)…

So at the moment, the only way I can think of to accomplish this would be to be able to select / deselect the specific bendpoints they want to drag along. That not being possible, I’ll try to think of a partial solution to their problem, like, selecting a node AND the link, will drag along the first (or last) bendpoint, but not the others. It won’t solve all the things they want but it will probably be an improvement…

What is the expected lifetime of bendpoint selection? What happens when the user selects bendpoints of links that are not connected with any selected node? Can they drag bendpoints without dragging Nodes, or at least with connected Nodes?

Can they do other operations on selected bendpoints, such as deleting them or copying them?

If you think this through, I bet you can find a lot more questions that would need answering.

As far as the mechanisms are concerned, not the policies for what you let the user do, besides overriding methods on the DraggingTool, you might use techniques similar to the Selectable Fields sample: Mapping Selectable Fields of Records