ContextMenuTool$Typings extension

on

Properties

currentContextMenu ↔ dynamic
Gets or sets the currently showing context menu, or null if there is none. This is typically only set in #showContextMenu and not by the user. It is also typically set to null in #hideContextMenu.
getter/setter pair
currentObject GraphObject?
Gets or sets the GraphObject found at the mouse point that has a context menu. This property remembers the result returned by #findObjectWithContextMenu if it is a GraphObject. This value is passed to #showContextMenu as the second argument. The value will be null if the context menu is for the diagram rather than for a particular GraphObject.
getter/setter pair
defaultTouchContextMenu ↔ dynamic
Gets or sets the HTMLInfo or Adornment that acts as the default touch context menu. On touch devices, this context menu will appear even there is no context menu defined.
getter/setter pair
mouseDownPoint Point
This read-only property returns the original mouse-down point in document coordinates.
getter/setter pair

Methods

canStart() bool
Return true if it's a single mouse right click that hasn't moved Tool#isBeyondDragSize and that is on a GraphObject with a GraphObject#contextMenu. This is also true if the mouse right click is in the diagram background and the diagram's Diagram#contextMenu is non-null.
doActivate() → void
Do nothing, activation is special and relies on doMouseUp
doMouseDown() → void
Activate this but also execute the normal behavior that would happen on a mouse-up if this tool is in the ToolManager#mouseDownTools list. Perform ActionTool#doMouseDown if a ContextMenuButton was hit.
doMouseMove() → void
Handle mouse-enter, mouse-over, and mouse-leave events, as well as tooltips.
doMouseUp() → void
If there is something found by #findObjectWithContextMenu, call #showContextMenu with that object's GraphObject#contextMenu or the Diagram#contextMenu.
findObjectWithContextMenu([Object? obj]) → dynamic
Find a GraphObject at the current mouse point with a GraphObject#contextMenu, or return the Diagram if there is a Diagram#contextMenu.
hideContextMenu() → void
Hide any context menu.
hideDefaultContextMenu() → void
This is the HTMLInfo#hide method for the #defaultTouchContextMenu.
positionContextMenu(Adornment contextmenu, [GraphObject? obj]) → void
This is called by #showContextMenu to position the context menu within the viewport. It normally goes just below the cursor. But if the mouse is too close to the right edge or the bottom edge of the viewport, it is positioned left and/or above the cursor.
showContextMenu(Object contextmenu, [GraphObject? obj]) → void
Show an Adornment or HTMLInfo as a context menu.
showDefaultContextMenu() → void
This is the HTMLInfo#show method for the #defaultTouchContextMenu.