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.StringdefaultLabel
-
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.Stringcompose(IPrimitive primitive)Replies the text value to be rendered as label for the primitiveprimitive.booleanequals(java.lang.Object obj)java.lang.StringgetDefaultLabel()inthashCode()java.lang.StringtoString()
-
-
-
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:LabelCompositionStrategyReplies the text value to be rendered as label for the primitiveprimitive.- Specified by:
composein 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:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-