- I
Remarks
This mode is used by GraphEditorInputMode but can be used stand-alone, too. Client code should register with the bend-created 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.const createBendInputMode = mode.createBendInputModeMembers
Constructors
Creates a new instance that will use the IGraph from the parentInputModeContext to create bends in.
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 or sets the event recognizer that determines when the user begins bend creation.
Gets the installed controller.
Examples
mode.createBendInputMode.enabled = false// mode is an instance of GraphEditorInputMode
mode.createBendInputMode.enabled = false
mode.createEdgeInputMode.allowCreateBend = falseThe 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 or sets the event recognizer that determines when the user has finished bend creation.
Gets the graph this mode is acting upon.
Gets the location where the bend creation gesture was initialized.
Gets or sets the event recognizer that determines when the user is moving the new bend.
Retrieves the IInputModeContext this mode has been installed in.
null if this mode is currently not installed. Use createInputModeContext to obtain a context that has this IInputMode as the inputMode.Implements
IInputMode.prioritytrue, implementations 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.
Property Value
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.
trueGets or sets the event recognizer that determines whether the current location is valid to begin a bend creation gesture.
Methods
See Also
API
- onCanceled
Implements
IInputMode.cancelParameters
Return Value
- IBend
- The created bend or
null.
See Also
Creates an implementation of IInputModeContext that is specific to this mode.
This is needed for events that are triggered by this InputMode to signal 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.
Return Value
- IInputModeContext
- A readily configured IInputModeContext.
See Also
null.Updates the splitOrthogonalSegment property and then delegates to createBend.
Parameters
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
Implements
IInputMode.installTriggers the bend-created event.
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.
Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should call the base implementation.
Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should call the base implementation.
Triggers the drag-canceled event.
Triggered at the end of each drag.
Parameters
- evt: InputModeEventArgs
- The event argument that contains context information.
Triggered at the start of each drag.
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.
falseReturn Value
- boolean
trueif and only if the editing has been stopped or there was no edit in progress
Implements
IInputMode.tryStopUninstalls 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.
Implements
IInputMode.uninstallEvents
Occurs once a bend has been interactively created by this input mode.
Properties of
InputModeItemEventArgs<IBend>- context: IInputModeContext
- Gets the context for the current event.
- item: TModelItem
- Gets the item which has been created or changed.
Occurs when the drag has been canceled.
Properties of
InputModeEventArgs- context: IInputModeContext
- Gets the context for the current event.
Occurs at the end of every drag.
Properties of
InputModeEventArgs- context: IInputModeContext
- Gets the context for the current event.
Occurs at the start of every drag.
Properties of
InputModeEventArgs- context: IInputModeContext
- Gets the context for the current event.