C

GroupingNodePositionHandler

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 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 layout changes to the provided wrappedHandler. If the given wrappedHandler is null, an implementation of IPositionHandler is queried from the 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 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

Called by clients to indicate that the dragging has been canceled by the user.
This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Implementations should reset the position of the items they modify to their initial state. Alternatively to this method the dragFinished method might be called.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the coordinate of the location property at the time of initializeDrag.
Called by clients to indicate that the repositioning has just been finished.
This method may be called after the initial initializeDrag and zero or more invocations of handleMove. Alternatively to this method the cancelDrag method might be called.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation the location may or may not be modified to reflect the new value. This is the same value as delivered in the last invocation of handleMove.
Called by clients to indicate that the element has been dragged and its position should be updated.
This method may be called more than once after an initial initializeDrag and the final call will be followed by either one dragFinished or one cancelDrag call.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
originalLocation: Point
The value of the location property at the time of initializeDrag.
newLocation: Point
The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the implementation, the location may or may not be modified to reflect the new value.
Called by clients to indicate that the element is going to be dragged.
This call will be followed by one or more calls to handleMove, and a final dragFinished or cancelDrag.

Parameters

context: IInputModeContext
The context to retrieve information about the drag from.
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
The temporary parent for the node.