C

SmartEdgeLabelModel

An edge label model that allows placement at any position.
ImplementsInheritance Hierarchy

Remarks

Similar to EdgeSegmentLabelModel, a position is specified by an edge segment and a ratio on that segment, amongst others. During changes of the edge path, the label keeps its relative location with respect to the bends of the reference segment in a similar way.

In contrast to EdgeSegmentLabelModel, the distance from the edge path is not a property of the model but of the particular parameter. In addition, this class does not implement ILabelModelParameterProvider and therefore, labels with this model can be moved freely and are not restricted to a fixed set of candidates at a given distance from the edge.

If autoRotation is enabled, labels are automatically rotated according to the angle of the corresponding reference edge segment.

During movements, labels with this model snap to notable positions if the MoveInputMode provides a GraphSnapContext that is enabled and has a suitable configuration.

See Also

Developer's Guide

Members

No filters for this type

Constructors

Initializes a new instance of this class.

Parameters

Properties

Gets or sets the rotation angle of all labels with this model.

Property Value

The rotation angle of all labels with this model.
Gets or sets whether or not edge labels are automatically rotated according to the angle of the corresponding reference edge segment.
By default, this feature is enabled.

Property Value

true if edge labels are automatically rotated; false otherwise.

Methods

Creates a parameter where the label is attached to the edge segment that contains the edge's midpoint.
final

Parameters

distance?: number
The distance between the label's box and the edge's path. The default is 0.
segmentRatio?: number
The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the source side of the segment, a ratio of 1.0 at the target side. Ratios less than 0.0 or greater than 1.0 will be interpreted as absolute values in world coordinates. The default is 0.5.

Return Value

SmartEdgeLabelModelParameter
A label parameter that describes the provided parameters for this model instance.
Creates a parameter that measures the provided segment index from the source side of the edge path.
final

Parameters

segmentIndex: number
The zero-based index of the segment beginning from the source side.
distance?: number
The distance between the label's box and the edge's path. The default is 0.
segmentRatio?: number
The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the source side of the segment, a ratio of 1.0 at the target side. Ratios less than 0.0 or greater than 1.0 will be interpreted as absolute values in world coordinates. The default is 0.5.

Return Value

SmartEdgeLabelModelParameter
A label parameter that describes the provided parameters for this model instance.
Creates a parameter that measures the provided segment index from the target side of the edge path.
final

Parameters

segmentIndex: number
The zero-based index of the segment beginning from the target side.
distance?: number
The distance between the label's box and the edge's path. The default is 0.
segmentRatio?: number
The ratio at which to place the label at the segment. A ratio of 0.0 will place the label at the target side of the segment, a ratio of 1.0 at the source side. Ratios less than 0.0 or greater than 1.0 will be interpreted as absolute values in world coordinates. The default is 0.5.

Return Value

SmartEdgeLabelModelParameter
A label parameter that describes the provided parameters for this model instance.
Tries to find a parameter that best matches the given layout for the provided label instance.
This method does not necessarily have to find a parameter that exactly matches the specified layout.
final

Parameters

label: ILabel
The label to find a parameter for.
layout: IOrientedRectangle
The anticipated layout for the label.

Return Value

ILabelModelParameter
A non-null parameter that can be used for the label to approximate the provided layout.
Provides a lookup context for the given label.
final

Parameters

label: ILabel
The label to use in the context.

Return Value

ILookup
An implementation of the ILookup interface that can be used to query additional aspects of the label.
Calculates the geometry of the given label using the given model parameter.
final

Parameters

label: ILabel
The label to calculate the geometry for.
layoutParameter: ILabelModelParameter
A parameter that is compatible with this model. Typically, this is a parameter that has been created by this model, and its property model returns this instance.

Return Value

IOrientedRectangle
An IOrientedRectangle that describes the geometry of the label. This is typically designed as a flyweight, therefore clients should not cache the instance but store the values if they need a snapshot for later use.