C

InputModeItemChangedEventArgs<TItem, TDetail>

Event data used by an IInputMode to signal the modification of a single InputModeItemEventArgs<TModelItem>.item.

Remarks

This specialized subclass of the InputModeItemEventArgs<TModelItem> class provides detailed context information about the state before the InputModeItemEventArgs<TModelItem>.item was modified.

If the item is an INode, the details property holds a NodeEventArgs instance that provides additional information about the parent node and the group node status of the node before the modification.

If the item is an IEdge, the details property holds a EdgeEventArgs instance that provides the source and target port information of the edge before the modification.

If the item is an IPort, the details property holds a PortEventArgs instance that provides the owner of the port before the modification.

If the item is an ILabel, the details property holds a LabelEventArgs instance that provides the owner of the label before the modification.

If the item is an IBend, the details property holds a BendEventArgs instance that provides owner and index information of the bend before the modification.

Type Parameters

TItem

The type of the changed item.

TDetail

Holder of additional details, see above.

Examples

Processing the details
function OnItemDeleted(
  e: InputModeItemChangedEventArgs<IModelItem, EventArgs>,
) {
  if (e.details instanceof NodeEventArgs) {
    const ne = e.details as NodeEventArgs
    console.log(`Old parent: ${ne.parent}`)
  } else if (e.details instanceof EdgeEventArgs) {
    const ee = e.details as EdgeEventArgs
    console.log(`Old source port owner: ${ee.sourcePortOwner}`)
    console.log(`Old target port owner: ${ee.targetPortOwner}`)
  } else if (e.details instanceof PortEventArgs) {
    const pe = e.details as PortEventArgs
    console.log(`Old port owner: ${pe.owner}`)
  } else if (e.details instanceof LabelEventArgs) {
    const le = e.details as LabelEventArgs
    console.log(`Old label owner: ${le.owner}`)
  } else if (e.details instanceof BendEventArgs) {
    const be = e.details as BendEventArgs
    console.log(`Old bend owner: ${be.owner}`)
  }
}

Members

Show:

Constructors

Initializes a new instance of the InputModeItemChangedEventArgs<TItem, TDetail> class.

Parameters

context: IInputModeContext
The context to initialize the InputModeEventArgs.context property with.
item: TItem
The item that is affected.
detail: TDetail
Additional information about the element's state prior to the modification.

Properties

Gets the context for the current event.
readonlyfinal

Property Value

The context.
Gets additional information about the element's state prior to the modification.
readonlyfinal

Property Value

Additional information about the element's state prior to the modification.
Gets the item affected by the modification.
readonlyfinal

Property Value

The affected item.