An implementation of the IHandle that can be used to move an IPort interactively by assigning new IPortLocationModelParameters to the locationParameter
Implements
- I
- I
Remarks
This class also provides snapping facilities and can be used in conjunction with both OrthogonalEdgeEditingContext, as well as GraphSnapContext.
Members
Show:
Constructors
Initializes a new instance of the PortLocationModelParameterHandle class to change the IPortLocationModelParameter of the given port.
Initializes a new instance of the PortLocationModelParameterHandle class to change the IPortLocationModelParameter of the given
port.Parameters
- port: IPort
- The port to adjust the location parameter of.
Properties
Gets or sets the cursor to display when the mouse hovers over or drags this handle.
Gets or sets the cursor to display when the mouse hovers over or drags this handle.
Gets a view of the location of the item.
Gets a view of the location of the item.
The point describes the current world coordinate of the element that can be modified by this handler.
readonlyfinal
Implements
IDragHandler.locationGets the port this instance acts on.
Gets the port this instance acts on.
protectedreadonlyfinal
Property Value
The port.
final
Implements
IHandle.tagGets or sets the type of the handle that can be used by the rendering engine to render types differently.
Gets or sets the type of the handle that can be used by the rendering engine to render types differently.
Methods
Called by clients to indicate that the dragging has been canceled by the user.
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.
Implements
IDragHandler.cancelDragCalled during the drag to collect snap results.
Called during the drag to collect snap results.
This implementation will delegate to the IPortSnapResultProvider that has been received from the port this instance is bound to.
protected
Parameters
- evt: CollectSnapResultsEventArgs
- The CollectSnapResultsEventArgs instance containing the event data.
- source: any
- The source of the event.
Called by clients to indicate that the repositioning has just been finished.
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.
Implements
IDragHandler.dragFinishedGets the graph to use for setting the parameter from the context.
Gets the graph to use for setting the parameter from the context.
protected
Parameters
- context: IInputModeContext
- The input mode context to use.
Return Value
- IGraph
- The graph or
nullif the graph could not be obtained.
See Also
API
- graph
This is used for the MovementInfo that is passed to the addMovedPort method.
protected
Parameters
- port: IPort
- The port to determine the move type for.
Return Value
- MoveTypes
- This implementation returns LINEAR_MOVE for models of type FreeNodePortLocationModel and ARBITRARY_MOVE for all others.
Obtains the new parameter for the given location and port.
Obtains the new parameter for the given location and port.
protected
Parameters
- port: IPort
- The port to obtain a parameter for.
- model: IPortLocationModel
- The model to use.
- location: Point
- The new location.
Return Value
- IPortLocationModelParameter
- The new parameter to use.
Ignore clicking the handle.
Ignore clicking the handle.
Called by clients to indicate that the element has been dragged and its position should be updated.
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.
Implements
IDragHandler.handleMoveCalled by clients to indicate that the element is going to be dragged.
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.
Implements
IDragHandler.initializeDragApplies the parameter.
Applies the parameter.
protected
Parameters
- graph: IGraph
- The graph to use for applying.
- port: IPort
- The port to apply the parameter to.
- locationParameter: IPortLocationModelParameter
- The new parameter to apply.