C

MarqueeSelectionInputMode

An IInputMode implementation that provides support for marquee selections through mouse or touch gestures.
ImplementsInheritance Hierarchy

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 secondary color of the set theme of the CanvasComponent and uses the yfiles-marquee-rect-template CSS class.

This mode is exclusive by default.

Examples

Typically the MarqueeSelectionInputMode is installed as child mode of a GraphEditorInputMode or GraphViewerInputMode and can be retrieved from the marqueeSelectionInputMode property.
Getting the MarqueeSelectionInputMode from its parent input mode
const marqueeSelectionInputMode = mode.marqueeSelectionInputMode

See Also

An example of how to style the marquee rectangle with CSS is given in CSS Styling of Marquee Rectangle .

Developer's Guide

Members

Show:

Constructors

Creates a new instance of the marquee selection mode.

Parameters

Properties

Gets or sets the event recognizer that determines whether to start creating the marquee.

By default, this recognizer detects left mouse button presses.

If this mode is a child mode of the GraphViewerInputMode, the recognizer is changed to left mouse button press with Shift held down. Note that this conflicts with the default value of subtractSelectionRecognizer, so in this case you will usually want to change one of these recognizers.

final

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether to start creating the marquee via touch.
Gets or sets the event recognizer that determines whether to cancel the marquee selection.
The default recognizer detects CANCEL and DRAG_CAPTURE_LOST events for MOUSE or PEN input or ESCAPE_DOWN.
final
Gets the installed controller.
protectedreadonlyfinal
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 MarqueeSelectionInputMode on its parent input mode
mode.marqueeSelectionInputMode.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 or sets the cursor to use during the dragging of the marquee when extendSelectionRecognizer is active.
The default is null meaning that marqueeCursor will be used instead.
conversionfinal

See Also

Developer's Guide
Gets or sets the event recognizer that determines if a selection is deemed an additive selection gesture, adding to the current selection.

If the event recognizer returns true for the current gesture, the elements which will be selected with that gesture will be added to the current selection. Otherwise, the selection will be cleared before adding the newly selected element.

Note that this will only have an influence on the currently shown marqueeCursor and the value of the selectionPolicy property. It is up to the handler of the drag-finished event to implement the selection behavior based on the policy value.

The default detects the current system and delegates either to META_IS_DOWN (macOS) or CTRL_IS_DOWN (other systems).

final

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether to finish creating the marquee.
The default recognizer detects MOUSE or PEN UP events.
final

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether to finish creating the marquee via touch.
The default recognizer is TOUCH_PRIMARY_UP.
final

See Also

Developer's Guide
Gets or sets the cursor to use during the dragging of the marquee.
Gets or sets the IObjectRenderer<MarqueeRenderTag> that visualizes the marquee selection rectangle.
When queried for an IVisualCreator to obtain the visualizations for the selection rectangle, this renderer is passed instances of MarqueeRenderTag as render tag.
final

Property Value

The renderer for the marquee rectangle.

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether to adjust the size of the marquee.
The default recognizer detects MOUSE or PEN left DRAG events.
final

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether to adjust the marquee size via touch.
The default recognizer is TOUCH_PRIMARY_DRAG.
final

See Also

Developer's Guide
Retrieves the IInputModeContext this mode has been installed in.
The value will be null if this mode is currently not installed. Use createInputModeContext to get a context that has this IInputMode as the inputMode.
protectedreadonlyfinal
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 the current or last marquee selection in world coordinates as a path.
This path can be used if a projection is set and the marquee is no longer a rectangle in world coordinates. If no projection is set, the resulting shape is identical to the selectionRectangle.
readonlyfinal

See Also

API
selectionRectangle
Gets the current or last SelectionPolicy as determined by the EventRecognizers.
readonlyfinal

See Also

Developer's Guide
Gets the current or last marquee selection rectangle.
readonlyfinal

See Also

API
selectionPath
Gets or sets the cursor to use during the dragging of the marquee when subtractSelectionRecognizer is active.
The default is null meaning that marqueeCursor will be used instead.
conversionfinal

See Also

Developer's Guide
Gets or sets the event recognizer that determines if a selection is deemed a subtractive selection gesture, removing the selection state from the current selection.

If the event recognizer returns true for the current gesture, the elements which will be selected with that gesture will be removed from the current selection.

Note that this will only have an influence on the currently shown marqueeCursor and the value of the selectionPolicy property. It is up to the handler of the drag-finished event to implement the selection behavior based on the policy value.

The default is SHIFT_IS_DOWN.

final

See Also

Developer's Guide
Gets or sets the cursor to use during the dragging of the marquee when toggleSelectionRecognizer is active.
The default is null meaning that marqueeCursor will be used instead.
conversionfinal

See Also

Developer's Guide
Gets or sets the event recognizer that determines if a selection is deemed a toggle selection gesture, inverting the selection for the elements in the marquee.

If the event recognizer returns true for the current gesture, the elements in the marquee will get their selection state toggled.

Note that this will only have an influence on the currently shown marqueeCursor and the value of the selectionPolicy property. It is up to the handler of the drag-finished event to implement the selection behavior based on the policy value.

The default is ALT_IS_DOWN.

final

See Also

Developer's Guide
Gets or sets a value indicating whether the marquee rectangle is drawn in view coordinates (which include projection), or intermediate coordinates.

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.

final

See Also

Developer's Guide
Gets or sets the cursor to use when it is valid to begin the marquee selection.
The default is null
conversionfinal

See Also

Developer's Guide
Gets or sets the event recognizer that determines whether it is valid to begin drawing the marquee.
The default recognizer is ALWAYS.
final

See Also

Developer's Guide

Methods

Calculates the location and size of the marquee rectangle.
The default implementation returns a rectangle that is exactly large enough to contain the two specified points.
When useViewCoordinates is true and a projection is set, startDragLocation and currentDragLocation are given in view coordinates instead of world coordinates.
protected

Parameters

startDragLocation: Point
the location in world coordinates where the drag has been started
currentDragLocation: Point
the current location of the drag in world coordinates

Return Value

Rect
the marquee rectangle to be determined from the given locations
Cancels any pending marquee selection.
Helper method that yields a suitably configured MarqueeSelectionEventArgs for this input mode.
Installs this mode into the given context that is provided by the canvas.

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

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

API
uninstall
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
Triggers the drag-canceled event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Triggers the drag-canceling event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Called once the drag has been finalized.
This method triggers the drag-finished event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Called before the drag will be finalized.
This method triggers the drag-finishing event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Called at the end of each drag.
This method triggers the dragged event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Called at the start of each drag.
This method triggers the dragging event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Triggers the drag-started event.
protected

Parameters

evt: MarqueeSelectionEventArgs
The event argument that contains context information.
Triggers the drag-starting event.
protected

Parameters

evt: MarqueeSelectionEventArgs
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
Will be called to request a stop of the current editing progress.
This should stop the current edit, if one is in progress, and possibly commit all pending changes. If stopping is not possible, this method can return false

Return Value

boolean
true if and only if the editing has been stopped or there was no edit in progress
Uninstalls this mode from the given context.

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

context: IInputModeContext
The context to deregister from. This is the same instance that had been passed to install during installation.

Events

Occurs when the drag has been canceled.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs before the drag will be canceled.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs the drag has been finished.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs before the drag will be finished.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs once the drag is initialized and has started.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs once the drag is starting.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs at the end of every drag.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide
Occurs at the start of every drag.
context: IInputModeContext
Gets the context for the current event.
policy: SelectionPolicy
Gets a value determining the SelectionPolicy that is currently set by the user.
rectangle: Rect
usePath: boolean
Gets a value determining whether path takes precedence over rectangle.

See Also

Developer's Guide