public class TaggingPreset extends javax.swing.AbstractAction implements MapView.LayerChangeListener, Predicate<OsmPrimitive>
| Modifier and Type | Class and Description |
|---|---|
private static class |
TaggingPreset.PresetDialog |
private static class |
TaggingPreset.PresetPanel |
class |
TaggingPreset.ToolbarButtonAction
Action that adds or removes the button on main toolbar
|
| Modifier and Type | Field and Description |
|---|---|
java.util.List<TaggingPresetItem> |
data |
static int |
DIALOG_ANSWER_APPLY |
static int |
DIALOG_ANSWER_CANCEL |
static int |
DIALOG_ANSWER_NEW_RELATION |
TaggingPresetMenu |
group |
java.lang.String |
locale_name |
java.lang.String |
name |
java.lang.String |
name_context |
TemplateEntry |
nameTemplate |
SearchCompiler.Match |
nameTemplateFilter |
static java.lang.String |
OPTIONAL_TOOLTIP_TEXT |
private boolean |
originalSelectionEmpty
True whenever the original selection given into createSelection was empty
|
boolean |
preset_name_label |
TaggingPresetItems.Roles |
roles |
java.util.EnumSet<TaggingPresetType> |
types
The types as preparsed collection.
|
| Constructor and Description |
|---|
TaggingPreset()
Create an empty tagging preset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
activeLayerChange(Layer oldLayer,
Layer newLayer)
Notifies this listener that the active layer has changed.
|
static Command |
createCommand(java.util.Collection<OsmPrimitive> sel,
java.util.List<Tag> changedTags) |
TaggingPreset.PresetPanel |
createPanel(java.util.Collection<OsmPrimitive> selected) |
java.util.Collection<OsmPrimitive> |
createSelection(java.util.Collection<OsmPrimitive> participants)
Removes all unsuitable OsmPrimitives from the given list
|
boolean |
evaluate(OsmPrimitive p)
Determines whether the object passes the test or not
|
java.util.List<Tag> |
getChangedTags() |
javax.swing.ImageIcon |
getIcon()
Returns the preset icon.
|
java.lang.String |
getLocaleName() |
static java.util.Collection<TaggingPreset> |
getMatchingPresets(java.util.Collection<TaggingPresetType> t,
java.util.Map<java.lang.String,java.lang.String> tags,
boolean onlyShowable) |
java.lang.String |
getName() |
java.lang.String |
getRawName() |
java.lang.String |
getToolbarString() |
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(java.util.Collection<TaggingPresetType> t,
java.util.Map<java.lang.String,java.lang.String> tags,
boolean onlyShowable) |
void |
setDisplayName()
Change the display name without changing the toolbar value.
|
void |
setIcon(java.lang.String iconName)
Called from the XML parser to set the icon.
|
void |
setName_template_filter(java.lang.String filter) |
void |
setName_template(java.lang.String pattern) |
void |
setType(java.lang.String types)
Called from the XML parser to set the types this preset affects.
|
int |
showDialog(java.util.Collection<OsmPrimitive> sel,
boolean showNewRelation) |
java.lang.String |
suggestRoleForOsmPrimitive(OsmPrimitive osm) |
private boolean |
supportsRelation() |
java.lang.String |
toString() |
boolean |
typeMatches(java.util.Collection<TaggingPresetType> t) |
protected void |
updateEnabledState() |
public 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 java.lang.String name
public java.lang.String name_context
public java.lang.String locale_name
public boolean preset_name_label
public static final java.lang.String OPTIONAL_TOOLTIP_TEXT
public java.util.EnumSet<TaggingPresetType> types
public java.util.List<TaggingPresetItem> data
public TaggingPresetItems.Roles roles
public TemplateEntry nameTemplate
public SearchCompiler.Match nameTemplateFilter
private boolean originalSelectionEmpty
public TaggingPreset()
public void setDisplayName()
public java.lang.String getLocaleName()
public java.lang.String getName()
public java.lang.String getRawName()
public final javax.swing.ImageIcon getIcon()
null if none definedpublic void setIcon(java.lang.String iconName)
public void setType(java.lang.String types) throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void setName_template(java.lang.String pattern) throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic void setName_template_filter(java.lang.String filter) throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionpublic TaggingPreset.PresetPanel createPanel(java.util.Collection<OsmPrimitive> selected)
public boolean isShowable()
public java.lang.String suggestRoleForOsmPrimitive(OsmPrimitive osm)
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic int showDialog(java.util.Collection<OsmPrimitive> sel, boolean showNewRelation)
public java.util.Collection<OsmPrimitive> createSelection(java.util.Collection<OsmPrimitive> participants)
participants - List of possible OsmPrimitives to tagpublic java.util.List<Tag> getChangedTags()
public static Command createCommand(java.util.Collection<OsmPrimitive> sel, java.util.List<Tag> changedTags)
private boolean supportsRelation()
protected final 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 java.lang.String toString()
toString in class java.lang.Objectpublic boolean typeMatches(java.util.Collection<TaggingPresetType> t)
public boolean evaluate(OsmPrimitive p)
Predicateevaluate in interface Predicate<OsmPrimitive>p - The object to evaluatetrue if the object passes the test, false otherwisepublic boolean matches(java.util.Collection<TaggingPresetType> t, java.util.Map<java.lang.String,java.lang.String> tags, boolean onlyShowable)
public static java.util.Collection<TaggingPreset> getMatchingPresets(java.util.Collection<TaggingPresetType> t, java.util.Map<java.lang.String,java.lang.String> tags, boolean onlyShowable)
public java.lang.String getToolbarString()