Helper interface to customize interactive label editing.
Remarks
Implementations of this interface can be put into the ILookup of ILabelOwners and ILabels so that it is possible to tweak the behavior on a case by case basis.
Conceptually, in most cases, implementations of this interface behaves like an additional event handler for LabelAdding and LabelEditing. If no event handler handled those events, an IEditLabelHelper will be queried from the ILookup and the unhandled event arguments passed to the respective methods.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.input.IEditLabelHelper
See Also
Methods
Helper method that will be called when trying to add a label to an ILabelOwner.
Remarks
Implementations of this method can set the style, layoutParameter, preferredSize, and tag for newly-added labels by setting the appropriate properties on evt
.
Setting the cancel property on evt
to true
will disallow label creation.
Parameters
A map of options to pass to the method.
- evt - LabelEditingEventArgs
- The original event arguments.
See Also
Helper method that will be called when trying to edit a label.
Remarks
This method can be called for editing labels for an ILabelOwner, in which case the label property on evt
will be null
, but the owner property will be non-null
. It can also be called for editing a specific label, in which case the label property on evt
will be non-null
, and the owner property will be set to the label's owner.
Implementations of this method can set a specific label to be edited, by setting the label property of the evt
to an existing label instance. This label does not need to belong to the same owner that is queried for. Setting the label property to null
will not edit an existing label, but instead add a new one on the ILabelOwner set in the owner property.
When a new label is added, the properties style, layoutParameter, preferredSize, and tag are used for the newly-created label, just as in onLabelAdding.
Setting the cancel property on evt
to true
will disallow label editing and creation.
Parameters
A map of options to pass to the method.
- evt - LabelEditingEventArgs
- The original event arguments.
See Also
Static Methods
Creates an implementation of the interface IEditLabelHelper from the given definition.
Remarks
Parameters
A map of options to pass to the method.
- onLabelAdding - function(LabelEditingEventArgs):void
Helper method that will be called when trying to add a label to an ILabelOwner.
This property holds the implementation for onLabelAdding.
- onLabelEditing - function(LabelEditingEventArgs):void
Helper method that will be called when trying to edit a label.
This property holds the implementation for onLabelEditing.
Returns
- ↪IEditLabelHelper
- An instance of the IEditLabelHelper interface based on the given definition.