|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy
org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
public static class LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.mappaint.LabelCompositionStrategy |
---|
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy, LabelCompositionStrategy.StaticLabelCompositionStrategy, LabelCompositionStrategy.TagLookupCompositionStrategy |
Field Summary | |
---|---|
static java.lang.String[] |
DEFAULT_NAME_TAGS
The list of default name tags from which a label candidate is derived. |
private java.util.List<java.lang.String> |
nameTags
|
Constructor Summary | |
---|---|
LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy()
Creates the strategy and initializes its name tags from the preferences. |
Method Summary | |
---|---|
java.lang.String |
compose(OsmPrimitive primitive)
Replies the text value to be rendered as label for the primitive primitive . |
java.util.List<java.lang.String> |
getNameTags()
Replies an unmodifiable list of the name tags used to compose the label. |
private java.lang.String |
getPrimitiveName(OsmPrimitive n)
|
void |
initNameTagsFromPreferences()
Initializes the name tags to use from a list of default name tags (see DEFAULT_NAME_TAGS ) and from name tags configured in the preferences
using the preference key mappaint.nameOrder. |
void |
setNameTags(java.util.List<java.lang.String> nameTags)
Sets the name tags to be looked up in order to build up the label |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] DEFAULT_NAME_TAGS
private java.util.List<java.lang.String> nameTags
Constructor Detail |
---|
public LabelCompositionStrategy.DeriveLabelFromNameTagsCompositionStrategy()
Creates the strategy and initializes its name tags from the preferences.
Note: If the list of name tags in the preferences changes, strategy instances
are not notified. It's up to the client to listen to preference changes and
invoke initNameTagsFromPreferences()
accordingly.
Method Detail |
---|
public void setNameTags(java.util.List<java.lang.String> nameTags)
nameTags
- the name tags. null values are ignore.public java.util.List<java.lang.String> getNameTags()
public void initNameTagsFromPreferences()
DEFAULT_NAME_TAGS
) and from name tags configured in the preferences
using the preference key mappaint.nameOrder.
private java.lang.String getPrimitiveName(OsmPrimitive n)
public java.lang.String compose(OsmPrimitive primitive)
LabelCompositionStrategy
primitive
.
compose
in class LabelCompositionStrategy
primitive
- the primitive
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |