C

GroupingNodePositionHandler
expert

The IPositionHandler implementation used in the context of IGraphs where there is an active hierarchy.

Remarks

This implementation delegates through to a simpler implementation that only deals with the geometric relocation of the node. In addition to that, it finds the IReparentNodeHandler from the IInputModeContext to detect a reparenting gesture by the user. If such a gesture is recognized, the node can be moved freely until a valid new parent node is found. This implementation then temporarily sets that node as a new visual parent and highlights the node. When the gesture is finished, the IReparentNodeHandler.reparent method is called to perform the actual reparenting.

In order to customize this default behavior, subclasses of this type can be decorated to the INodes in the graph.

Members

Show:

Constructors

Initializes a new instance of the GroupingNodePositionHandler class.
This implementation delegates the handling of the node's INode.layout changes to the provided wrappedHandler. If the given wrappedHandler is null, an implementation of IPositionHandler is queried from the Graph.DEFAULT_NODE_LOOKUP to be used as delegate.

Parameters

node: INode
The node to reposition.
wrappedHandler?: IPositionHandler
The IPositionHandler to wrap. If omitted, this will be the default IPositionHandler for nodes.

Properties

Gets or sets a value determining whether the layout of the parent group node is adjusted to always keep the moved node inside.
Default is true
final
Gets a view of the location of the item.
Delegates to the wrapped IPositionHandler's IDragHandler.location.
readonlyfinal
Gets or sets a value determining whether children of the moved node are implicitly moved with it.
Default is true
final
Gets or sets a value determining whether reparenting the moved node is enabled.
Default is true
final

Methods

Parameters

context: IInputModeContext
originalLocation: Point

Parameters

context: IInputModeContext
originalLocation: Point
newLocation: Point

Parameters

context: IInputModeContext
originalLocation: Point
newLocation: Point

Parameters

context: IInputModeContext
Sets a temporary visual parent for the node during reparenting.
This is used to show the grouping hierarchy level a node would end in after finishing the reparenting gesture. Override this method with an empty implementation to not change the z-order of the dragged node during the gesture.
protected

Parameters

context: IInputModeContext
The current IInputModeContext.
node: INode
The node being reparented.
parent: INode | null
The temporary parent for the node.