public abstract class TaggingPresetItem extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,java.util.Set<TaggingPresetType>> |
TYPE_CACHE |
Constructor and Description |
---|
TaggingPresetItem() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addCommands(java.util.List<Tag> changedTags)
Adds the new tags to apply to selected OSM primitives when the preset holding this item is applied.
|
protected abstract boolean |
addToPanel(javax.swing.JPanel p,
java.util.Collection<OsmPrimitive> sel,
boolean presetInitiallyMatches)
Called by
TaggingPreset.createPanel(java.util.Collection<org.openstreetmap.josm.data.osm.OsmPrimitive>) during tagging preset panel creation. |
protected static java.lang.String |
fixPresetString(java.lang.String s) |
protected static java.lang.String |
getLocaleText(java.lang.String text,
java.lang.String textContext,
java.lang.String defaultText) |
protected static java.util.Set<TaggingPresetType> |
getType(java.lang.String types) |
protected void |
initAutoCompletionField(AutoCompletingTextField field,
java.util.List<java.lang.String> keys) |
protected void |
initAutoCompletionField(AutoCompletingTextField field,
java.lang.String... key) |
protected static javax.swing.ImageIcon |
loadImageIcon(java.lang.String iconName,
java.io.File zipIcons,
java.lang.Integer maxSize) |
static boolean |
matches(java.lang.Iterable<? extends TaggingPresetItem> data,
java.util.Map<java.lang.String,java.lang.String> tags)
Determine whether the given preset items match the tags
|
protected java.lang.Boolean |
matches(java.util.Map<java.lang.String,java.lang.String> tags)
Tests whether the tags match this item.
|
protected static java.lang.Integer |
parseInteger(java.lang.String str) |
private static final java.util.Map<java.lang.String,java.util.Set<TaggingPresetType>> TYPE_CACHE
public TaggingPresetItem()
protected void initAutoCompletionField(AutoCompletingTextField field, java.lang.String... key)
protected void initAutoCompletionField(AutoCompletingTextField field, java.util.List<java.lang.String> keys)
protected abstract boolean addToPanel(javax.swing.JPanel p, java.util.Collection<OsmPrimitive> sel, boolean presetInitiallyMatches)
TaggingPreset.createPanel(java.util.Collection<org.openstreetmap.josm.data.osm.OsmPrimitive>)
during tagging preset panel creation.
All components defining this tagging preset item must be added to given panel.p
- The panel where components must be addedsel
- The related selected OSM primitivespresetInitiallyMatches
- Whether this TaggingPreset
already matched before applying,
i.e. whether the map feature already existed on the primitive.true
if this item adds semantic tagging elements, false
otherwise.protected abstract void addCommands(java.util.List<Tag> changedTags)
changedTags
- The list of changed tags to modify if neededprotected java.lang.Boolean matches(java.util.Map<java.lang.String,java.lang.String> tags)
tags
- the tags of an OsmPrimitive
true
if matches (positive), null
if neutral, false
if mismatches (negative).protected static java.util.Set<TaggingPresetType> getType(java.lang.String types) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected static java.lang.String fixPresetString(java.lang.String s)
protected static java.lang.String getLocaleText(java.lang.String text, java.lang.String textContext, java.lang.String defaultText)
protected static java.lang.Integer parseInteger(java.lang.String str)
protected static javax.swing.ImageIcon loadImageIcon(java.lang.String iconName, java.io.File zipIcons, java.lang.Integer maxSize)
public static boolean matches(java.lang.Iterable<? extends TaggingPresetItem> data, java.util.Map<java.lang.String,java.lang.String> tags)
data
- the preset itemstags
- the tags to match