public class TaggingPreset extends AbstractAction implements MapView.LayerChangeListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
TaggingPreset.PresetPanel |
| Modifier and Type | Field and Description |
|---|---|
List<TaggingPresetItem> |
data |
static int |
DIALOG_ANSWER_APPLY |
static int |
DIALOG_ANSWER_CANCEL |
static int |
DIALOG_ANSWER_NEW_RELATION |
TaggingPresetMenu |
group |
String |
locale_name |
String |
name |
String |
name_context |
TemplateEntry |
nameTemplate |
SearchCompiler.Match |
nameTemplateFilter |
static String |
OPTIONAL_TOOLTIP_TEXT |
private boolean |
originalSelectionEmpty
True whenever the original selection given into createSelection was empty
|
TaggingPresetItems.Roles |
roles |
EnumSet<TaggingPresetType> |
types
The types as preparsed collection.
|
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
TaggingPreset()
Create an empty tagging preset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed.
|
static Command |
createCommand(Collection<OsmPrimitive> sel,
List<Tag> changedTags) |
TaggingPreset.PresetPanel |
createPanel(Collection<OsmPrimitive> selected) |
Collection<OsmPrimitive> |
createSelection(Collection<OsmPrimitive> participants)
Removes all unsuitable OsmPrimitives from the given list
|
List<Tag> |
getChangedTags() |
ImageIcon |
getIcon()
Returns the preset icon.
|
String |
getLocaleName() |
static Collection<TaggingPreset> |
getMatchingPresets(Collection<TaggingPresetType> t,
Map<String,String> tags,
boolean onlyShowable) |
String |
getName() |
String |
getRawName() |
boolean |
isShowable() |
void |
layerAdded(Layer newLayer)
Notifies this listener that a layer has been added.
|
void |
layerRemoved(Layer oldLayer)
Notifies this listener that a layer has been removed.
|
boolean |
matches(Collection<TaggingPresetType> t,
Map<String,String> tags,
boolean onlyShowable) |
void |
setDisplayName()
Change the display name without changing the toolbar value.
|
void |
setIcon(String iconName)
Called from the XML parser to set the icon.
|
void |
setName_template_filter(String filter) |
void |
setName_template(String pattern) |
void |
setType(String types)
Called from the XML parser to set the types this preset affects.
|
int |
showDialog(Collection<OsmPrimitive> sel,
boolean showNewRelation) |
String |
suggestRoleForOsmPrimitive(OsmPrimitive osm) |
private boolean |
supportsRelation() |
String |
toString() |
boolean |
typeMatches(Collection<TaggingPresetType> t) |
protected void |
updateEnabledState() |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledpublic static final int DIALOG_ANSWER_APPLY
public static final int DIALOG_ANSWER_NEW_RELATION
public static final int DIALOG_ANSWER_CANCEL
public TaggingPresetMenu group
public String name_context
public String locale_name
public static final String OPTIONAL_TOOLTIP_TEXT
public EnumSet<TaggingPresetType> types
public List<TaggingPresetItem> data
public TaggingPresetItems.Roles roles
public TemplateEntry nameTemplate
public SearchCompiler.Match nameTemplateFilter
private boolean originalSelectionEmpty
public TaggingPreset()
public void setDisplayName()
public String getLocaleName()
public String getRawName()
public final ImageIcon getIcon()
null if none definedpublic void setIcon(String iconName)
public void setType(String types) throws SAXException
SAXExceptionpublic void setName_template(String pattern) throws SAXException
SAXExceptionpublic void setName_template_filter(String filter) throws SAXException
SAXExceptionpublic TaggingPreset.PresetPanel createPanel(Collection<OsmPrimitive> selected)
public boolean isShowable()
public String suggestRoleForOsmPrimitive(OsmPrimitive osm)
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic int showDialog(Collection<OsmPrimitive> sel, boolean showNewRelation)
public Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants)
participants - List of possible OsmPrimitives to tagpublic List<Tag> getChangedTags()
public static Command createCommand(Collection<OsmPrimitive> sel, List<Tag> changedTags)
private boolean supportsRelation()
protected void updateEnabledState()
public void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListeneractiveLayerChange in interface MapView.LayerChangeListeneroldLayer - The previous active layernewLayer - The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListenerlayerAdded in interface MapView.LayerChangeListenernewLayer - The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListenerlayerRemoved in interface MapView.LayerChangeListeneroldLayer - The old removed layerpublic boolean typeMatches(Collection<TaggingPresetType> t)
public boolean matches(Collection<TaggingPresetType> t, Map<String,String> tags, boolean onlyShowable)
public static Collection<TaggingPreset> getMatchingPresets(Collection<TaggingPresetType> t, Map<String,String> tags, boolean onlyShowable)