Class LabelCompositionStrategy.StaticLabelCompositionStrategy
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy.StaticLabelCompositionStrategy
-
- All Implemented Interfaces:
LabelCompositionStrategy
- Enclosing interface:
- LabelCompositionStrategy
public static class LabelCompositionStrategy.StaticLabelCompositionStrategy extends java.lang.Object implements LabelCompositionStrategy
Strategy where the label is given by a static text specified in the MapCSS style file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.styleelement.LabelCompositionStrategy
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy, LabelCompositionStrategy.StaticLabelCompositionStrategy, LabelCompositionStrategy.TagLookupCompositionStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
defaultLabel
-
Constructor Summary
Constructors Constructor Description StaticLabelCompositionStrategy(java.lang.String defaultLabel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
compose(IPrimitive primitive)
Replies the text value to be rendered as label for the primitiveprimitive
.boolean
equals(java.lang.Object obj)
java.lang.String
getDefaultLabel()
int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
defaultLabel
private final java.lang.String defaultLabel
-
-
Constructor Detail
-
StaticLabelCompositionStrategy
public StaticLabelCompositionStrategy(java.lang.String defaultLabel)
-
-
Method Detail
-
compose
public java.lang.String compose(IPrimitive primitive)
Description copied from interface:LabelCompositionStrategy
Replies the text value to be rendered as label for the primitiveprimitive
.- Specified by:
compose
in interfaceLabelCompositionStrategy
- 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
-
getDefaultLabel
public java.lang.String getDefaultLabel()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-