portTargeted property

void Function(Node, GraphObject, bool, [Node?, GraphObject?])? get portTargeted

Gets or sets a function that is called as the tool targets the nearest valid port. The first two arguments specify the port by providing the Node that it is in and the GraphObject that is the actual port object. The next two arguments are the temporary port that has been moved and styled to be like the valid port. These values will be either the #temporaryToNode and #temporaryToPort or the #temporaryFromNode and #temporaryFromPort, depending on which end of the temporary link is being updated. The fifth argument is true if the target port represents a potential "to" end of a link; it is false if it is for the "from" end of a link.

When there is no valid port within the #portGravity, the first two arguments are null.

The function, if supplied, must not add or remove any links or nodes or port objects, nor may it change the validity of any potential link connection.

Implementation

void Function(
  _i3.Node,
  _i3.GraphObject,
  _i2.bool, [
  _i3.Node?,
  _i3.GraphObject?,
])? get portTargeted => (
      _i3.Node p2,
      _i3.GraphObject p3,
      _i2.bool p4, [
      _i3.Node? p0,
      _i3.GraphObject? p1,
    ]) =>
        _i4.callMethod(
          _i4.getProperty(
            this,
            'portTargeted',
          ),
          r'call',
          [
            this,
            p0 ?? _i5.undefined,
            p1 ?? _i5.undefined,
            p2,
            p3,
            p4,
          ],
        );
set portTargeted (void value(Node, GraphObject, bool, [Node?, GraphObject?])?)

Implementation

set portTargeted(
    void Function(
      _i3.Node,
      _i3.GraphObject,
      _i2.bool, [
      _i3.Node?,
      _i3.GraphObject?,
    ])? value) {
  _i4.setProperty(
    this,
    'portTargeted',
    value == null ? _i5.undefined : _i4.allowInterop(value),
  );
}