Pointing node

Hi,

I need some kind of a pointing box (not a balloon node) like one on the picture below:

  • Box should have ability to take another node, and that node also could take another node (child).

  • While dragging either the parent or any of child nodes, the whole box should be moving except the arrow point of the line (it’s anchored).

  • While dragging a line, a whole composition is moving including a box, and the line.

  • While dragging the arrow point, only the line should be moving.

  • The line could be connected on any side of the box and dynamically change it’s position in order of box node reposition.

  • The arrow end point is not connected to the port (it’s free).

Can somebody help me to construct this kind of node and manage it in LayoutChildren?

Thanks in advance

Does CustomSubGraph in the SubGraphApp sample give you most of the behavior you want except for the arrow hanging off the node?

Hello Jake,

yes, CustomSubGraph should be OK, but what worries me is the rest of the requirements.

One small thing for better clarification:

The line could be connected on any side of the box and dynamically change it’s position in order of box node reposition, while arrow side of the line stays anchored.

Thanks

Look at the MovableLinkApp sample. Specifically, look at how the GoLabeledLink is created in Form.cs (points are added to the link to give it a path). And connect the From end of the link to the CustomSubGraph.Port.



but for this requirement:



- While dragging a line, a whole composition is moving including a box, and the line.



you should be able to create a custom DraggingTool that adds the subgraph to the EffectiveSelection when the link is dragged.



Actually, it might be simpler… just override SelectionObject in your GoLink and redirect selection to the SubGraph if the link doesn’t have a “To” connection. That might work.

CustomSubGraph collapses to a small shape if there is no node within, but you can set it to be Resizable and set the size. (you can play with this in SubGraphApp using the properties controls on the left.)

Thanks for the tip Jake.
I looked at that example and I think it could be useful for me.

But, where (maybe in DraggingTool?) and how (Location of the line?) can I manage the following:

-Dragging node around the line should stay anchored?

In this example, the line and node are moving together…

I played with this a bit in code… keeping CustomSubGraph a fixed size with no nodes isn’t working very well. Some mix of behavior from BoxArea or LimitingSubGraph from NodeLinkDemo will be needed (although note: neither of those have a BoxPort on the edge).



If you create the link and attach the From end, dragging the subgraph will drag the link. But the reverse isn’t true. See the comment above about SelectionObject.

Hello again Jake,

after some prior tasks, I came back to this problem.
Picture below shows what I have done so far:

Location node is a custom GoSubGraphBase and the link is a custom GoLabeledLink with GoStrokeArrowheadStyle.Circle at the end. At the FromPort side link is connected to the custom GoBoxPort, and at the ToPort end, to null.

I tried to resolve the requirement:
“While node dragging, the ToPort end of the link stays anchored.”

Tried with a custom DraggingTool, but without success.
Is it possible somehow to accomplish this requirement on this way?
Or I should add another (invisible) port at the end line?

In addition, I need the exact coordinates of the circle (arrowhead). Thanks in advance.

It would be easy to just make the little black dot be a small GoBasicNode with no label.