standardMouseClick<T extends GraphObject> method

bool standardMouseClick<T extends GraphObject>([
  1. T? navig(
    1. GraphObject
    )?,
  2. bool pred(
    1. T
    )?
])

Implement the standard behavior for mouse clicks, searching for and calling click handler functions on GraphObjects or on Diagram, and raising the corresponding DiagramEvent.

A click on a GraphObject of the diagram will raise one of the following DiagramEvents: "ObjectSingleClicked", "ObjectDoubleClicked", or "ObjectContextClicked". This will also look at the corresponding click property: GraphObject#click, GraphObject#doubleClick, or GraphObject#contextClick. If the value is a function, this will call it, passing the current InputEvent and the GraphObject. If the value is null, it tries looking at the parent GraphObject#panel, and so on, walking up the visual tree until it finds the appropriate function to call. After calling the click function, if the value of InputEvent#handled is false, this method will continue walking up the visual tree looking for more click functions to call. Once it has looked at the top-level object (a Part) for a click function, this method stops.

A click in the background of the diagram will raise one of the following DiagramEvents: "BackgroundSingleClicked", "BackgroundDoubleClicked", or "BackgroundContextClicked". This will also look at the corresponding click property: Diagram#click, Diagram#doubleClick, or Diagram#contextClick. If the value is a function, this will call it, passing the current InputEvent.

This method is not responsible for selecting or deselecting any parts. Call #standardMouseSelect for that functionality.

Note that this calls GraphObject#isEnabledObject on the target object; if it returns false, no click action will occur.

The ClickSelectingTool calls this method in its override of #doMouseUp in order to raise "click" events. Note that by default GraphObjects in Layers that are Layer#isTemporary will not be "clicked". To change that behavior it is easiest to set GraphObject#isActionable to true on those objects for which you wish to handle "click" events. Then the ActionTool's #doMouseUp override will raise the standard "click" events.

This method may be overridden, but you should consider calling this base method in order to get all of its functionality. Please read the Introduction page on Extensions for how to override methods and how to call this base method. @expose @param {function(GraphObject):GraphObject | null=} navig An optional custom navigation function to find target objects. @param {function(GraphObject):boolean | null=} pred An optional custom predicate function to find target objects. No value means that only objects in layers holding permanent objects. @return {boolean} true if InputEvent#handled had been set to true on the Diagram#lastInput.

Implementation

_i2.bool standardMouseClick<T extends _i3.GraphObject>([
  T? Function(_i3.GraphObject)? navig,
  _i2.bool Function(T)? pred,
]) =>
    _i4.callMethod(
      this,
      'standardMouseClick',
      [
        navig == null
            ? _i5.undefined
            : _i4.allowInterop((p0) => () => navig(p0) ?? _i5.undefined),
        pred == null ? _i5.undefined : _i4.allowInterop(pred),
      ],
    );