Remarks
The ToolTipInputMode and ContextMenuInputMode use the same installed GraphInputMode.popoverManager to manage tooltips and popovers. Because tooltips use PopoverBehavior.HINT and the context-menu PopoverBehavior.AUTO, one of each can be shown at the same time.
To open your own popovers, you can either call open on the installed GraphInputMode.popoverManager to integrated with popovers from other modes (note the different PopoverBehaviors), or add another PopoverManager to the GraphInputMode.
See Also
Developer's Guide
API
- ToolTipInputMode, PopoverDescriptor, open
Members
Constructors
Properties
Gets the installed controller.
Gets or sets a custom parent element to which the popover is added as a child in the DOM.
By default, this property is null, which means that the popover is added to the CanvasComponent.overlayPanel.
If the CanvasComponent is contained in a shadow DOM, the popover is always added to the CanvasComponent.overlayPanel to ensure that it is contained inside the shadow DOM.
When specifying some other element as parent, it must be assured that the element is currently visible (i.e., has no style with property display: none).
This property acts as the default value for the PopoverDescriptor.parentElement property. So it can also be set specifically for each popover descriptor.
See Also
Gets whether any descriptor is currently open.
Gets an IEnumerable<T> collection of all currently active popover descriptors.
See Also
Developer's Guide
API
- isOpen
Gets 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 IInputModeContext.inputMode.Implements
IInputMode.priorityMethods
This will be called prior to the uninstalling of this instance and when other input modes temporarily acquire the mutex.
In order to stop an active input mode manually, client code should use the following idiom:
if (!mode.tryStop()) {
mode.cancel()
}Implements
IInputMode.cancelCreates an IInputModeContext for use with the PopoverDescriptor.update event.
Adjust the calculated popover position.
Parameters
- descriptor: PopoverDescriptor
- The popover descriptor for which the location is calculated.
- pageLocation: Point
- The calculated popover position relative to the document root.
Return Value
- Point
- The adjusted location relative to the document root.
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 IInputMode.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.installCalled after cancel has been called.
Can be overridden in subclasses to perform additional actions after the mode has been canceled.
This implementation closes all popovers.
Called after the ConcurrencyController.active property of the installed ConcurrencyController has been set to true.
true.Can be overridden in subclasses to perform additional actions after the mode has been activated.
Overriding implementations should invoke the base implementation.
Called after the ConcurrencyController.active property of the installed ConcurrencyController has been set to false.
false.Can be overridden in subclasses to perform additional actions after the mode has been deactivated.
Overriding implementations should invoke the base implementation.
Called after tryStop has been called.
Can be overridden in subclasses to perform additional actions after the mode has been stopped.
This implementation closes all popovers.
Opens a popover with the behavior configured by the specified descriptor.
Parameters
- descriptor: PopoverDescriptor
- The PopoverDescriptor that describes the properties and content of the popover to display.
Return Value
Throws
- Exception ({ name: 'InvalidOperationError' })
- Thrown if the PopoverManager is not installed on a canvas.
See Also
Developer's Guide
Overridden to only return true if this instance does not currently have the input mutex.
true if this instance does not currently have the input mutex.Return Value
- boolean
trueiff this instance does not own the mutex.
Implements
IInputMode.tryStopUninstalls this mode from the given context.
This code should clean up all changes made to the canvas in the IInputMode.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 IInputMode.install during installation.