Moving ports outside of nodes


Is it possible to set the position of a port to be outside of the node itself?

I’m working with my own classes derived from GoNode, GoPort, etc.

If I try to set the position of the port I add to be outside the bounds
of the node (the bounds of the GoGroup I draw my node representation
in), the bounds (as indicated by the selection handles) increase to
include the new position of the port.

I notice that the Processor sample has nodes that can be moved to far outside the nodes–what am I missing?

Nolan Woods

By definition a group’s child object cannot be outside of the Bounds of the group. That’s why you see the bounds getting bigger.
However, it might appear that way to the user, as you can see in the Processor sample, when the port is not inside the bounds of the big shape/background/icon that is also a child of the node. This effect is reinforced by making that big child object the node’s SelectionObject, so that that big object gets the selection handle(s). That’s also what is happening with ActivityNodes in the Processor sample.
And actually those nodes also get a lot bigger when the user drags the Label far away from the Icon.
So you if you are inheriting from GoNode, you can override the SelectionObject property to return the child object you want to get selection handles when the user selects the node. Note also that for GoNodes, it is some of the SelectionObject’s properties (Resizable, Reshapable, ResizesRealtime, Shadowed, and Location) that implement those properties for the node as a whole.