public class DescriptorWrapperLabelModel extends Object implements ILabelModel, ILabelCandidateDescriptorProvider, ILabelModelParameterProvider
descriptor.| Constructor and Description |
|---|
DescriptorWrapperLabelModel()
Creates a new instance that uses
FreeLabelModel.INSTANCE as inner model. |
DescriptorWrapperLabelModel(ILabelModel innerModel)
Initializes a new instance of the
DescriptorWrapperLabelModel class. |
| 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. |
ILabelCandidateDescriptor |
getDescriptor()
Gets the descriptor.
|
ILabelCandidateDescriptor |
getDescriptor(ILabel label,
ILabelModelParameter layoutParameter)
Gets the descriptor for a given pair of a label and a
ILabelModelParameter. |
IOrientedRectangle |
getGeometry(ILabel label,
ILabelModelParameter layoutParameter)
Calculates the
geometry of the given label using the given model parameter. |
ILabelModel |
getInnerModel()
Gets the inner label model.
|
IEnumerable<ILabelModelParameter> |
getParameters(ILabel label,
ILabelModel model)
Returns an enumerator over a set of possible
ILabelModelParameter instances that can be used for the given label
and model. |
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that implements the given type or
null. |
void |
setDescriptor(ILabelCandidateDescriptor value)
Sets the descriptor.
|
void |
setInnerModel(ILabelModel value)
Sets the inner label model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookuppublic DescriptorWrapperLabelModel()
FreeLabelModel.INSTANCE as inner model.public DescriptorWrapperLabelModel(ILabelModel innerModel)
DescriptorWrapperLabelModel class.innerModel - The wrapped label model.public final ILabelModelParameter createDefaultParameter()
createDefaultParameter in interface ILabelModelInnerModelpublic final ILookup getContext(ILabel label, ILabelModelParameter layoutParameter)
ILabelModellookup context for the given combination of label and parameter.getContext in interface ILabelModellabel - 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.EMPTYpublic final ILabelCandidateDescriptor getDescriptor()
setDescriptor(ILabelCandidateDescriptor)public final ILabelCandidateDescriptor getDescriptor(ILabel label, ILabelModelParameter layoutParameter)
ILabelCandidateDescriptorProviderILabelModelParameter.getDescriptor in interface ILabelCandidateDescriptorProviderlabel - The label to possibly assign the layoutParameter.layoutParameter - The parameter to provide a descriptor for if applied to the given label.null.public final IOrientedRectangle getGeometry(ILabel label, ILabelModelParameter layoutParameter)
ILabelModelgeometry of the given label using the given model parameter.getGeometry in interface ILabelModellabel - 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.public final ILabelModel getInnerModel()
setInnerModel(ILabelModel)public final IEnumerable<ILabelModelParameter> getParameters(ILabel label, ILabelModel model)
ILabelModelParameterProviderILabelModelParameter instances that can be used for the given label
and model.getParameters in interface ILabelModelParameterProviderlabel - The label instance to use.model - The model to provide parameters for.public final <TLookup> TLookup lookup(Class<TLookup> type)
ILookupnull.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.public final void setDescriptor(ILabelCandidateDescriptor value)
value - The Descriptor to set.getDescriptor()public final void setInnerModel(ILabelModel value)
value - The InnerModel to set.getInnerModel()