public interface ILabelModel extends ILookup
ILabel
instances with respect to specific ILabelModelParameter
s.
In addition to defining the geometry of a label with respect to a specific
ILabelModelParameter
, a label model is typically the factory of the label model parameters that are
compatible with it, too.
Typically, the label model defines a, possibly infinite, compilation of valid geometries for labels, and a specific label model parameter specifies an exact geometry for a label.
By design, the same instance of a label model can be shared by multiple label model parameters. Similarly, the same instance of a label model parameter can be shared by multiple labels.
This interface supports the ILookup.lookup(java.lang.Class)
method that can be used to query additional aspects
of the implementation.
ILabelModelParameter
,
ILabel
,
IGraph
Modifier and Type | Method and Description |
---|---|
ILabelModelParameter |
createDefaultParameter()
Creates a default parameter that can be used for this model.
|
ILookup |
getContext(ILabel label,
ILabelModelParameter layoutParameter)
Provides a
lookup context for the given combination of label and parameter. |
IOrientedRectangle |
getGeometry(ILabel label,
ILabelModelParameter layoutParameter)
Calculates the
geometry of the given label using the given model parameter. |
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, lookup, safeLookup
ILabelModelParameter createDefaultParameter()
ILookup getContext(ILabel label, ILabelModelParameter layoutParameter)
lookup context
for the given combination of label and parameter.label
- The label to use in the context.layoutParameter
- The parameter to use for the label in the context.ILookup
interface that can be used to query additional aspects of the label/parameter
combination.ILookup.EMPTY
IOrientedRectangle getGeometry(ILabel label, ILabelModelParameter layoutParameter)
geometry
of the given label using the given model parameter.label
- The label to calculate the geometry for.layoutParameter
- 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.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.