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.
@FunctionalInterface public interface LabelCompositionStrategy
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.nameOrder
andmappaint.nameComplementOrder
.
- Since:
- 3987 (creation), 10599 (functional interface)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
Strategy where the label is given by the value of one of the configured "name tags".static class
LabelCompositionStrategy.StaticLabelCompositionStrategy
Strategy where the label is given by a static text specified in the MapCSS style file.static class
LabelCompositionStrategy.TagLookupCompositionStrategy
Strategy where the label is given by the content of a tag whose name specified in the MapCSS style file.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
compose(IPrimitive primitive)
Replies the text value to be rendered as label for the primitiveprimitive
.
-
-
-
Method Detail
-
compose
java.lang.String compose(IPrimitive primitive)
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
-
-