Interface LabelCompositionStrategy
- All Known Implementing Classes:
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy,LabelCompositionStrategy.StaticLabelCompositionStrategy,LabelCompositionStrategy.TagLookupCompositionStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Provides an abstract parent class and three concrete sub classes for various strategies on how to compose the text label which can be rendered close to a node or within an area in an OSM map.
The three strategies below support three rules for composing a label:
LabelCompositionStrategy.StaticLabelCompositionStrategy- the label is given by a static text specified in the MapCSS style fileLabelCompositionStrategy.TagLookupCompositionStrategy- the label is given by the content of a tag whose name specified in the MapCSS style fileLabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy- the label is given by the value of one of the configured "name tags". The list of relevant name tags can be configured in the JOSM preferences see the preference optionsmappaint.nameOrderandmappaint.nameComplementOrder.
- Since:
- 3987 (creation), 10599 (functional interface)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classStrategy where the label is given by the value of one of the configured "name tags".static classStrategy where the label is given by a static text specified in the MapCSS style file.static classStrategy where the label is given by the content of a tag whose name specified in the MapCSS style file. -
Method Summary
Modifier and TypeMethodDescriptioncompose(IPrimitive primitive) Replies the text value to be rendered as label for the primitiveprimitive.
-
Method Details
-
compose
Replies the text value to be rendered as label for the primitiveprimitive.- Parameters:
primitive- the primitive- Returns:
- the text value to be rendered or null, if primitive is null or if no suitable value could be composed
-