C

DropInputMode

An input mode which handles drag and drop related events on a CanvasComponent.
ImplementsInheritance Hierarchy

Remarks

An instance of DropInputMode is initialized for an expected data type in the constructor. There are four events raised by an instance of this class.

Clients can query the current pointerPosition which is updated while a drag is in progress. Clients get the data from the drag operation by calling dropData from an event handler registered for any of these events.

This mode is exclusive by default.

See Also

Developer's Guide

Members

Show:

Constructors

Initializes a new instance of the DropInputMode class for the given data type.
This instance fires events only if a drag operation carries DragDropItem of the given type.

Parameters

transferType: string
A list of types that are used in getData.

See Also

API
drag-entered, drag-dropped

Properties

Gets or sets a value indicating whether to capture pointer input during drag operations.
The default is true and thus prevents pointer events from being processed by visuals in the canvas.
final

Property Value

true if pointer input should be captured during the drag; false otherwise.
Gets the installed controller.
protectedreadonlyfinal
Gets or sets the DragDropEffects that will be used for drags on the canvas.
conversionfinal
Gets the data carried by a drag operation.
This is only valid, if a drag entered the CanvasComponent first.
readonly
Gets the pointer position after dropping an item.
The position is returned in world coordinates according to the CanvasComponent into which this input mode is installed.
readonlyfinal
Gets or sets the enabled state of this input mode.
Clients can use this property to disable or reenable this instance. This will set the enabled property of the installed controller so a disabled instance should never try to acquire the input mutex.

Examples

Disabling the NodeDropInputMode on its parent input mode
mode.nodeDropInputMode.enabled = false
Gets or sets a value indicating whether this mode will be the only one running when it has the mutex.

The value of this property will be delegated to the exclusive property of the controller.

If this mode is marked as exclusive and has the mutex, all other modes added to the same MultiplexingInputMode will be deactivated. Otherwise, it will always run concurrently with all other modes.

final
Gets a value indicating whether a drag operation is currently in progress.
readonlyfinal
Gets the last processed drag event argument.
readonlyfinal
Retrieves the IInputModeContext this mode has been installed in.
The value will be null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the inputMode.
protectedreadonlyfinal
Gets the current pointer position during drag operations.
The position is returned in world coordinates according to the CanvasComponent into which this input mode is installed.
readonlyfinal
Gets the priority of this input mode.
The priority will influence the order in which the modes will be installed into the CanvasComponent. The lower the priority value, the earlier it will be installed. If two modes are using the same priority value, the first one to be registered will be installed earlier.
final
Gets or sets the IHitTestable that determines whether the given location is a valid drop location.
final

Property Value

The hit testable that yields true for valid drop locations.

See Also

Developer's Guide

Methods

Called to adjust the dropEffect accordingly.
protected

Parameters

evt: DragEventArgs
The event args of the drag event to adjust the effects for.

Return Value

boolean
true if the drag event is handled by this input mode.
Cleanly cancels this mode.
Creates an implementation of IInputModeContext that is specific to this mode.

This is needed for events that are triggered by this InputMode to signalize where the event is coming from. A common usage for this is for example in isHit calls.

The result can be given to isHit or enumerateHits to let implementations of IHitTestable get access to the current IInputModeContext. This can be done by looking up IInputModeContext from the ICanvasContext's lookup method or simply downcasting.

protected

Return Value

IInputModeContext
A readily configured IInputModeContext.

See Also

API
enumerateHits, isHit, IInputModeContext
Helper method that yields a suitably configured InputModeEventArgs for this input mode.
Installs this mode into the given canvas.
Clients should not call this method as this is handled by the framework.

Parameters

context: IInputModeContext
the context to install this mode into
controller: ConcurrencyController
The controller for this mode.

See Also

API
CanvasComponent
Called after cancel has been called.

Can be overridden in subclasses to perform additional actions after the mode has been canceled.

This implementation does nothing.

protected
Called after the active property of the installed ConcurrencyController has been set to true.

Can be overridden in subclasses to perform additional actions after the mode has been activated.

Overriding implementations should call the base implementation.

protected
Called after the active property of the installed ConcurrencyController has been set to false.

Can be overridden in subclasses to perform additional actions after the mode has been deactivated.

Overriding implementations should call the base implementation.

protected
Called once a drag has been dropped on the canvas.
protected

Parameters

evt: InputModeEventArgs
The event argument that contains context information.
Called once a drag has entered the canvas.
protected

Parameters

evt: InputModeEventArgs
The event argument that contains context information.
Called whenever a drag is over the canvas.
protected

Parameters

evt: InputModeEventArgs
The event argument that contains context information.
Called once a drag has left the canvas.
protected

Parameters

evt: InputModeEventArgs
The event argument that contains context information.
Called after tryStop has been called.

Can be overridden in subclasses to perform additional actions after the mode has been stopped.

This implementation does nothing.

protected
This method updates the pointerPosition according to the coordinates passed in.
It is called prior to the onDragEntered, onDraggedOver, onDragDropped and onDragLeft methods.
protected

Parameters

location: Point
The current location of the pointer in world coordinates.
Overridden to only return true if this instance does not currently have the input mutex.

Return Value

boolean
true iff this instance does not own the mutex.
Uninstalls this mode from the canvas.
Clients should not call this method as this is handled by the framework.

Parameters

context: IInputModeContext
the context

Events

Occurs when a drag operation is dropped onto the CanvasComponent into which this instance is installed.

No event is raised

  • if this instance is not enabled,
  • if another concurrent input mode is active or
  • the data from the drag operation does not conform to the expected type.

To get additional data for the event, clients should use the sender which is set to the sending DropInputMode. The EventArgs provide no useful data.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.

See Also

Developer's Guide
Occurs when a drag operation enters the CanvasComponent into which this instance is installed.

No event is raised

  • if this instance is not enabled,
  • if another concurrent input mode is active or
  • the data from the drag operation does not conform to the expected type.

To get additional data for the event, clients should use the sender which is set to the sending DropInputMode. The EventArgs provide no useful data.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.

See Also

Developer's Guide
Occurs when a drag operation leaves the CanvasComponent into which this instance is installed.

No event is raised

  • if this instance is not enabled,
  • if another concurrent input mode is active or
  • the data from the drag operation does not conform to the expected type.

To get additional data for the event, clients should use the sender which is set to the sending DropInputMode. The EventArgs provide no useful data.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.

See Also

Developer's Guide
Occurs when a drag operation drags over the CanvasComponent into which this instance is installed.

No event is raised

  • if this instance is not enabled,
  • if another concurrent input mode is active or
  • the data from the drag operation does not conform to the expected type.

To get additional data for the event, clients should use the sender which is set to the sending DropInputMode. The EventArgs provide no useful data.

Properties of

InputModeEventArgs
context: IInputModeContext
Gets the context for the current event.

See Also

Developer's Guide