An IInputMode implementation that can handle marquee selections performed by the user with a mouse.
Remarks
This implementation will request the mutex as soon as it recognizes a mouse drag.
Per default the visualization of the marquee rectangle uses the secondaryColor of the set theme.
This mode is exclusive by default.
Examples
MarqueeSelectionInputMode
is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the marqueeSelectionInputMode property.Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.MarqueeSelectionInputMode
See Also
Constructors
Creates a new instance of the marquee selection mode.
Parameters
A map of options to pass to the method.
- priority - number
- exclusive - boolean
A value indicating whether this mode will be the only one running when it has the mutex. This option sets the exclusive property on the created object.
- enabled - boolean
The enabled state of this input mode. This option sets the enabled property on the created object.
- useViewCoordinates - boolean
A value indicating whether the marquee rectangle is drawn in view coordinates (which include projection), or intermediate coordinates. This option sets the useViewCoordinates property on the created object.
- template - IVisualTemplate
The template that is used for the visualization of the marquee rectangle. This option sets the template property on the created object.
- cancelRecognizer - function(Object, EventArgs):boolean
The event recognizer that determines whether to cancel marquee selection. This option sets the cancelRecognizer property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- validBeginCursor - Cursor
The cursor to use when beginning the dragging of the marquee is valid. This option sets the validBeginCursor property on the created object.
- marqueeCursor - Cursor
The cursor to use during the dragging of the marquee. This option sets the marqueeCursor property on the created object.
- validBeginRecognizer - function(Object, EventArgs):boolean
The event recognizer that determines whether it is valid to begin drawing the marquee. This option sets the validBeginRecognizer property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- pressedRecognizer - function(Object, EventArgs):boolean
The event recognizer that determines whether to start creating the marquee. This option sets the pressedRecognizer property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- draggedRecognizer - function(Object, EventArgs):boolean
The event recognizer that determines whether to drag the marquee. This option sets the draggedRecognizer property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- releasedRecognizer - function(Object, EventArgs):boolean
The event recognizer that determines whether to finish creating the marquee. This option sets the releasedRecognizer property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- pressedRecognizerTouch - function(Object, EventArgs):boolean
The event recognizer that determines whether to start creating the marquee via touch. This option sets the pressedRecognizerTouch property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- draggedRecognizerTouch - function(Object, EventArgs):boolean
The event recognizer that determines whether to drag the marquee via touch. This option sets the draggedRecognizerTouch property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
- releasedRecognizerTouch - function(Object, EventArgs):boolean
The event recognizer that determines whether to finish creating the marquee via touch. This option sets the releasedRecognizerTouch property on the created object.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
A callback that recognizes events.Given a sender and an event argument, delegates decide whether the event is treated as a match depending on the context.Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
Properties
Gets or sets the event recognizer that determines whether to cancel marquee selection.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
Gets the installed controller.
Gets or sets the event recognizer that determines whether to drag the marquee.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
See Also
Gets or sets the event recognizer that determines whether to drag the marquee via touch.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
Gets or sets the enabled state of this input mode.
Remarks
Examples
Gets or sets a value indicating whether this mode will be the only one running when it has the mutex.
Remarks
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.
Gets the context instance this mode is currently installed in or null
if this instance is not installed.
Remarks
Implements
Gets or sets the event recognizer that determines whether to start creating the marquee.
Remarks
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
See Also
Gets or sets the event recognizer that determines whether to start creating the marquee via touch.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
See Also
Gets the priority of this input mode.
Remarks
See Also
Implements
Gets or sets the event recognizer that determines whether to finish creating the marquee.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
See Also
Gets or sets the event recognizer that determines whether to finish creating the marquee via touch.
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
Gets the current or last marquee selection in world coordinates as a path.
Remarks
See Also
Gets the current or last marquee selection rectangle.
Gets or sets the template that is used for the visualization of the marquee rectangle.
See Also
Gets or sets a value indicating whether the marquee rectangle is drawn in view coordinates (which include projection), or intermediate coordinates.
Remarks
View coordinates ensure that the user always sees a rectangle for the marquee. However, the resulting shape of the marquee in world coordinates may not be a rectangle.
The default is true
.
See Also
Gets or sets the event recognizer that determines whether it is valid to begin drawing the marquee.
Remarks
Signature Details
function(eventSource: any, evt: EventArgs) : boolean
Parameters
- eventSource - any
- The source of the event.
- evt - EventArgs
- The arguments of the event to be decided to handle.
Returns
- boolean
true
if theevt
is considered to be handled.
Methods
Calculates the location and size of the marquee rectangle.
Remarks
Parameters
A map of options to pass to the method.
- startDragLocation - Point
- the location in world coordinates where the drag has been started
- currentDragLocation - Point
- the current location of the drag in world coordinates
Returns
- ↪Rect
- the marquee rectangle to be determined from the given locations
true
and a projection is set, startDragLocation
and currentDragLocation
are given in view coordinates instead of world coordinates.Cancels any pending marquee selection.
Implements
Helper method that yields a suitably configured InputModeEventArgs for this input mode.
Returns
- ↪MarqueeSelectionEventArgs
- An input mode event argument that is configured for this instance.
Installs this mode into the given context that is provided by the canvas.
Remarks
In general a mode can only be installed into a single canvas at all times.
This method is called to initialize this instance. Subclasses should override this method to register the corresponding event handler delegates for the various input events they need to register with.
Overriding implementations should call the base implementation, first.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context that this instance shall be installed into. The same instance will be passed to this instance during uninstall. A reference to the context may be kept and queried during the time the mode is installed.
- controller - ConcurrencyController
- The controller for this mode.
See Also
Implements
Called after cancel has been called.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation does nothing.
Called after the active property of the installed ConcurrencyController has been set to true
.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
Called after the active property of the installed ConcurrencyController has been set to false
.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
Triggers the DragCanceled event.
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Triggers the DragCanceling event.
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Called once the drag has been finalized.
Remarks
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Called before the drag will be finalized.
Remarks
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Called at the end of each drag.
Remarks
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Called at the start of each drag.
Remarks
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Triggers the DragStarted event.
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Triggers the DragStarting event.
Parameters
A map of options to pass to the method.
- evt - MarqueeSelectionEventArgs
- The event argument that contains context information.
Called after tryStop has been called.
Remarks
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation does nothing.
Called by the client in order to stop a current editing progress.
Remarks
false
Returns
- ↪boolean
true
if and only if the editing has been stopped or there was no edit in progress
See Also
Implements
Uninstalls this mode from the given context.
Remarks
This code should clean up all changes made to the canvas in the install method. After a mode has been uninstalled it can be installed again into the same or another canvas.
Overriding implementations should call the base implementation after their own code.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to deregister from. This is the same instance that had been passed to install during installation.
Implements
Events
Occurs when the drag has been canceled.
See Also
Event Registration
addDragCanceledListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragCanceledListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs before the drag will be canceled.
See Also
Event Registration
addDragCancelingListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragCancelingListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs the drag has been finished.
See Also
Event Registration
addDragFinishedListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragFinishedListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs before the drag will be finished.
See Also
Event Registration
addDragFinishingListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragFinishingListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs at the end of every drag.
See Also
Event Registration
addDraggedListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDraggedListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs at the start of every drag.
See Also
Event Registration
addDraggingListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDraggingListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs once the drag is initialized and has started.
See Also
Event Registration
addDragStartedListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragStartedListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Occurs once the drag is starting.
See Also
Event Registration
addDragStartingListener(function(this, MarqueeSelectionEventArgs):void)
Event Deregistration
removeDragStartingListener(function(this, MarqueeSelectionEventArgs):void)
Signature Details
function(sender: this, evt: MarqueeSelectionEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - MarqueeSelectionEventArgs
- An object that contains the event data.
Constants
A string that can be used to store a IVisualTemplate that can be used to create the visual that will be used to draw the marquee box.