- I
Remarks
const compositeLabelModel = new CompositeLabelModel()
compositeLabelModel.addModel(new ExteriorNodeLabelModel())
compositeLabelModel.addModel(new StretchNodeLabelModel())
compositeLabelModel.addParameter(InteriorNodeLabelModel.CENTER)Members
Constructors
Properties
Gets a list of CompositeLabelModelParameter that were created by addParameter.
Methods
Adds another ILabelModel to this model's collection of label models.
Note that parameters created from the labelModel will be wrapped by this class and the resulting parameters will use this model instance as its model.
The model is stored by reference and subsequent modification of the model will be reflected by this instance.
Also, the method allows for associating a weight that will be associated with each parameter created by the labelModel.
Parameters
- labelModel: ILabelModel
- The label model to add to this instance.
- weight?: number
- The weight to associate with parameters created by this model. If the value is not set, the default is
1.0
Adds the model of the labelModelParameter to this model's collection of label models and returns the labelModelParameter wrapped in a CompositeLabelModelParameter.
labelModelParameter to this model's collection of label models and returns the labelModelParameter wrapped in a CompositeLabelModelParameter.Note that parameters created from the added model will also be wrapped by this class and the resulting parameters will use this model instance as its model.
The model is stored by reference and subsequent modification of the model will be reflected by this instance.
Also, the method allows for associating a profit that will be associated with the return parameter as well as with each parameter created by the added model.
Parameters
- labelModelParameter: ILabelModelParameter
- The parameter whose model should be added to this instance and which is wrapped and returned.
- profit?: number
- The profit to associate with the wrapped parameters and all parameters created by this model. If the value is not set, the default is
1.0
Return Value
- CompositeLabelModelParameter
- The given
labelModelParameterwrapped in a CompositeLabelModelParameter.
Adds another parameter to this model's collection of parameters.
Note that the parameter will be wrapped by this class and the resulting parameter, which will use this model instance as its model, will be returned. The parameter is stored by reference, and subsequent modification of the parameter or its associated model will be reflected by this instance.
Also, the method allows for associating a weight with each parameter.
Parameters
- layoutParameter: ILabelModelParameter
- The parameter to add to this instance.
- weight?: number
- The weight to associate with the parameter. If the value is not set, the default is
1.0
Return Value
- CompositeLabelModelParameter
- A new parameter that wraps the provided parameter and uses this instance as its model.
Tries to find a parameter that best matches the given layout for the provided label instance.
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.
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.
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.getGeometryReturns an enumerator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
Parameters
- label: ILabel
- The label instance to use.
Return Value
- IEnumerable<ILabelModelParameter>
- A possibly empty enumerator over a set of label model parameters.