public interface IEditLabelHelper
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.
EditLabelHelper,
GraphEditorInputMode.createLabel(com.yworks.yfiles.graph.ILabelOwner),
GraphEditorInputMode.editLabel(com.yworks.yfiles.graph.ILabel),
GraphEditorInputMode.addLabel(com.yworks.yfiles.graph.ILabelOwner),
GraphEditorInputMode.addLabelAddingListener(com.yworks.yfiles.utils.IEventHandler),
GraphEditorInputMode.addLabelEditingListener(com.yworks.yfiles.utils.IEventHandler)| Modifier and Type | Method and Description |
|---|---|
void |
onLabelAdding(LabelEditingEventArgs args)
Helper method that will be called when trying to add a label to an
ILabelOwner. |
void |
onLabelEditing(LabelEditingEventArgs args)
Helper method that will be called when trying to edit a label.
|
void onLabelAdding(LabelEditingEventArgs args)
ILabelOwner.
Implementations of this method can set the Style,
LayoutParameter,
PreferredSize, and Tag
for newly-added labels by setting the appropriate properties on args.
Setting the Cancel property on args to true will disallow label
creation.
args - The original event arguments.onLabelEditing(LabelEditingEventArgs)void onLabelEditing(LabelEditingEventArgs args)
This method can be called for editing labels for an ILabelOwner, in which case the Label
property on args 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 args 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 args 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(LabelEditingEventArgs).
Setting the Cancel property on args to true will disallow label
editing and creation.
args - The original event arguments.onLabelAdding(LabelEditingEventArgs)