public abstract class LabelCompositionStrategy extends Object
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
content of a tag whose name specified in the MapCSS style file, see the preference
options mappaint.nameOrder and mappaint.nameComplementOrder.Modifier and Type | Class and Description |
---|---|
static class |
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy |
static class |
LabelCompositionStrategy.StaticLabelCompositionStrategy |
static class |
LabelCompositionStrategy.TagLookupCompositionStrategy |
Constructor and Description |
---|
LabelCompositionStrategy() |
Modifier and Type | Method and Description |
---|---|
abstract String |
compose(OsmPrimitive primitive)
Replies the text value to be rendered as label for the primitive
primitive . |
public LabelCompositionStrategy()
public abstract String compose(OsmPrimitive primitive)
primitive
.primitive
- the primitive