An IInputMode used for recognizing the gesture of creating IBends in an IGraph.
Remarks
This mode is used by GraphEditorInputMode but can be used stand-alone, too. Client code should register with the BendCreated event to perform additional actions after the bend has been created.
This mode is exclusive by default.
Examples
CreateBendInputMode
is installed as child mode of a GraphEditorInputMode and can be retrieved from the createBendInputMode property.Type Details
- yfiles module
- view-editor
- yfiles-umd modules
- view-editor, view-table, view
- Legacy UMD name
- yfiles.input.CreateBendInputMode
Constructors
Creates a new instance that will use the IGraph from the inputModeContext to create bends in.
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.
- armedCursor - Cursor
The cursor to use when this mode is in "armed" state. This option sets the armedCursor property on the created object.
- pressedRecognizer - function(Object, EventArgs):boolean
An event recognizer that determines when the user begins to move the selection. 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
An event recognizer that determines when the user is moving the selection. 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
An event recognizer that determines when the user has finished the move. 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.
- prepareRecognizerTouch - function(Object, EventArgs):boolean
An event recognizer that determines when the user begins to move the selection via touch. This option sets the prepareRecognizerTouch 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.
- movedRecognizerTouch - function(Object, EventArgs):boolean
An event recognizer that determines when the user begins actually moves the selection via touch. This option sets the movedRecognizerTouch 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
An event recognizer that determines when the finalized the gesture 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.
- beginHitTestable - IHitTestable
The IHitTestable that determines where bends may be created. This option sets the beginHitTestable property on the created object.
- splitOrthogonalSegmentRecognizer - function(Object, EventArgs):boolean
An event recognizer that determines whether the bend creation should be treated as a split segment operation. This option sets the splitOrthogonalSegmentRecognizer 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.
- splitOrthogonalSegment - boolean
A value indicating whether an orthogonal segment should be split by the last bend creation. This option sets the splitOrthogonalSegment property on the created object.
- useExistingBend - boolean
A property that determines whether this mode should use an existing bend in createBend if there is one found at the given location. This option sets the useExistingBend property on the created object.
See Also
Properties
Gets or sets the cursor to use when this mode is in "armed" state.
Gets or sets the IHitTestable that determines where bends may be created.
Gets the installed controller.
Gets or sets an event recognizer that determines when the user is moving the 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 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 graph this mode is acting upon.
Gets the context instance this mode is currently installed in or null
if this instance is not installed.
Remarks
Implements
Gets the location where the bend creation gesture was initialized.
Gets or sets an event recognizer that determines when the user begins actually moves the selection via touch.
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.
Gets or sets an event recognizer that determines when the user begins to move the selection via touch.
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.
Gets or sets an event recognizer that determines when the user begins to move the 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 priority of this input mode.
Remarks
See Also
Implements
Gets or sets an event recognizer that determines when the user has finished the move.
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 an event recognizer that determines when the finalized the gesture via touch.
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.
Gets or sets a value indicating whether an orthogonal segment should be split by the last bend creation.
Remarks
true
, implementation are advised to treat the bend creation as a gesture that splits the segment into two.See Also
Gets or sets an event recognizer that determines whether the bend creation should be treated as a split segment operation.
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 a property that determines whether this mode should use an existing bend in createBend if there is one found at the given location.
Remarks
true
Methods
Called when a bend creation gesture can be started at the current mouse pointer location.
Remarks
Cancels the editing of this mode.
Remarks
See Also
Implements
Creates the bend.
Remarks
Parameters
A map of options to pass to the method.
Returns
- ↪IBend
- The created bend or
null
.
See Also
Creates an IInputModeContext for use with the upcoming createBend call in createBend.
Returns
- ↪IInputModeContext
- An instance of IInputModeContext.
Called when a bend creation gesture can no longer be started at the current mouse pointer location.
Remarks
null
.Updates the splitOrthogonalSegment property and then delegates to createBend.
Remarks
Parameters
A map of options to pass to the method.
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
Triggers the BendCreated event.
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 - InputModeEventArgs
- The event argument that contains context information.
Triggered at the end of each drag.
Remarks
Parameters
A map of options to pass to the method.
- evt - InputModeEventArgs
- The event argument that contains context information.
Triggered at the start of each drag.
Remarks
Parameters
A map of options to pass to the method.
- evt - InputModeEventArgs
- 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 once a bend creation gesture has been recognized.
Event Registration
addBendCreatedListener(function(this, BendEventArgs):void)
Event Deregistration
removeBendCreatedListener(function(this, BendEventArgs):void)
Signature Details
function(sender: this, evt: BendEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - BendEventArgs
- An object that contains the event data.
Occurs when the drag has been canceled.
Event Registration
addDragCanceledListener(function(this, InputModeEventArgs):void)
Event Deregistration
removeDragCanceledListener(function(this, InputModeEventArgs):void)
Signature Details
function(sender: this, evt: InputModeEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - InputModeEventArgs
- An object that contains the event data.
Occurs at the end of every drag.
Event Registration
addDraggedListener(function(this, InputModeEventArgs):void)
Event Deregistration
removeDraggedListener(function(this, InputModeEventArgs):void)
Signature Details
function(sender: this, evt: InputModeEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - InputModeEventArgs
- An object that contains the event data.
Occurs at the start of every drag.
Event Registration
addDraggingListener(function(this, InputModeEventArgs):void)
Event Deregistration
removeDraggingListener(function(this, InputModeEventArgs):void)
Signature Details
function(sender: this, evt: InputModeEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - InputModeEventArgs
- An object that contains the event data.