This port label model can be used to specify any position and orientation of a label.
Implements
- I
Remarks
The position of the label is stored relative to the position of the port the label belongs to.
See Also
Developer's Guide
Members
No filters for this type
Methods
Creates a parameter instance that anchors the label to the port at a given position.
Creates a parameter instance that anchors the label to the port at a given position.
The parameter will use the ratio and offset values to determine a point on both the label and the port. It will place the label in such a way that both points coincide.
final
Parameters
- locationOffset: Point
- The offset to apply to the port's location.
- labelRatio: Point
- The ratio that describes the point on the label's layout relative to its size.
- labelOffset?: Point
- The offset to apply to the point on the label after the ratio has been determined. This defaults to (0,0), representing no further offset.
- angle?: number
- The angle by which the label should be rotated around the point described using the ratio and offset, measured in radians. The default is 0.
Return Value
- FreePortLabelModelParameter
- A parameter that exactly fits the described location.
Throws
- Exception ({ name: 'ArgumentError' })
locationOffset,labelRatioorlabelOffsetcontains one or more NaN values.
Tries to find a parameter that best matches the given layout for the provided label instance.
Tries to find a parameter that best matches the given layout for the provided label instance.
This implementation will match the provided layout perfectly.
final
Parameters
- label: ILabel
- The label to find a parameter for.
- layout: IOrientedRectangle
- The anticipated layout for the label.
Return Value
- ILabelModelParameter
- A non-
nullparameter that can be used for the label to approximate the provided layout.
Provides a lookup context for the given label.
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.
Implements
ILabelModel.getContextCalculates the geometry of the given label using the given model parameter.
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.
Implements
ILabelModel.getGeometryConstants
A predefined parameter instance that places the label anchored at the center of the port and has no rotation.
A predefined parameter instance that places the label anchored at the center of the port and has no rotation.
A shared public instance that can be used to obtain parameters.
A shared public instance that can be used to obtain parameters.