Class TagConflictResolutionUtil
- java.lang.Object
-
- org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil
-
public final class TagConflictResolutionUtil extends Object
Collection of utility methods for tag conflict resolution
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TagConflictResolutionUtil.AutomaticChoice
Preference for a particular choice from a group for automatic tag conflict resolution.static class
TagConflictResolutionUtil.AutomaticChoiceGroup
Preference for an automatic tag conflict resolver which choose from a group of possiblechoice
values.static class
TagConflictResolutionUtil.AutomaticCombine
Preference for automatic tag-conflict resolver by combining the tag values using a separator.(package private) static interface
TagConflictResolutionUtil.AutomaticTagConflictResolver
An automatic tag conflict resolver interface.
-
Field Summary
Fields Modifier and Type Field Description private static Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver>
automaticTagConflictResolvers
private static Collection<TagConflictResolutionUtil.AutomaticChoice>
defaultAutomaticTagConflictChoices
Default preferences for the list of AutomaticChoice tag conflict resolvers.private static Collection<TagConflictResolutionUtil.AutomaticCombine>
defaultAutomaticTagConflictCombines
Default preferences for the list of AutomaticCombine tag conflict resolvers.private static String
GRP_CA_CANVEC
The group identifier for Canadian CANVEC choicesprivate static String
GRP_FR_CADASTRE
The group identifier for French Cadastre choicesprivate static String
KEY_SOURCE
The OSM key 'source'
-
Constructor Summary
Constructors Modifier Constructor Description private
TagConflictResolutionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
applyAutomaticTagConflictResolution(TagCollection tc)
Automatically resolve some tag conflicts.static void
applyAutomaticTagConflictResolution(TagCollection tc, Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver> resolvers)
Automatically resolve some given conflicts using the given resolvers.static void
completeTagCollectionForEditing(TagCollection tc)
Completes tags in the tag collectiontc
with the empty value for each tag.static Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver>
getAutomaticTagConflictResolvers()
Get the AutomaticTagConflictResolvers configured in the Preferences or the default ones.static void
normalizeTagCollectionBeforeEditing(TagCollection tc, Collection<? extends OsmPrimitive> merged)
Normalizes the tags in the tag collectiontc
before resolving tag conflicts.
-
-
-
Field Detail
-
KEY_SOURCE
private static final String KEY_SOURCE
The OSM key 'source'- See Also:
- Constant Field Values
-
GRP_FR_CADASTRE
private static final String GRP_FR_CADASTRE
The group identifier for French Cadastre choices- See Also:
- Constant Field Values
-
GRP_CA_CANVEC
private static final String GRP_CA_CANVEC
The group identifier for Canadian CANVEC choices- See Also:
- Constant Field Values
-
defaultAutomaticTagConflictCombines
private static final Collection<TagConflictResolutionUtil.AutomaticCombine> defaultAutomaticTagConflictCombines
Default preferences for the list of AutomaticCombine tag conflict resolvers.
-
defaultAutomaticTagConflictChoices
private static final Collection<TagConflictResolutionUtil.AutomaticChoice> defaultAutomaticTagConflictChoices
Default preferences for the list of AutomaticChoice tag conflict resolvers.
-
automaticTagConflictResolvers
private static volatile Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver> automaticTagConflictResolvers
-
-
Constructor Detail
-
TagConflictResolutionUtil
private TagConflictResolutionUtil()
-
-
Method Detail
-
normalizeTagCollectionBeforeEditing
public static void normalizeTagCollectionBeforeEditing(TagCollection tc, Collection<? extends OsmPrimitive> merged)
Normalizes the tags in the tag collectiontc
before resolving tag conflicts. Removes irrelevant tags like "created_by". For tags which are not present on at least one of the merged nodes, the empty value "" is added to the list of values for this tag, but only if there are at least two primitives with tags, and at least one tagged primitive do not have this tag.- Parameters:
tc
- the tag collectionmerged
- the collection of merged primitives
-
completeTagCollectionForEditing
public static void completeTagCollectionForEditing(TagCollection tc)
Completes tags in the tag collectiontc
with the empty value for each tag. If the empty value is present the tag conflict resolution dialog will offer an option for removing the tag and not only options for selecting one of the current values of the tag.- Parameters:
tc
- the tag collection
-
applyAutomaticTagConflictResolution
public static void applyAutomaticTagConflictResolution(TagCollection tc)
Automatically resolve some tag conflicts. The list of automatic resolution is taken from the preferences.- Parameters:
tc
- the tag collection- Since:
- 11606
-
getAutomaticTagConflictResolvers
public static Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver> getAutomaticTagConflictResolvers()
Get the AutomaticTagConflictResolvers configured in the Preferences or the default ones.- Returns:
- the configured AutomaticTagConflictResolvers.
- Since:
- 11606
-
applyAutomaticTagConflictResolution
public static void applyAutomaticTagConflictResolution(TagCollection tc, Collection<TagConflictResolutionUtil.AutomaticTagConflictResolver> resolvers)
Automatically resolve some given conflicts using the given resolvers.- Parameters:
tc
- the tag collection.resolvers
- the list of automatic tag conflict resolvers to apply.- Since:
- 11606
-
-