|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
org.openstreetmap.josm.gui.tagging.TaggingPreset
public class TaggingPreset
This class read encapsulate one tagging preset. A class method can read in all predefined presets, either shipped with JOSM or that are in the config directory. It is also able to construct dialogs out of preset definitions.
Nested Class Summary | |
---|---|
static class |
TaggingPreset.Check
|
static class |
TaggingPreset.Combo
|
static class |
TaggingPreset.ComboMultiSelect
|
static class |
TaggingPreset.ConcatenatingJList
Class that allows list values to be assigned and retrieved as a comma-delimited string. |
static class |
TaggingPreset.Item
|
static class |
TaggingPreset.Key
|
static class |
TaggingPreset.KeyedItem
|
static class |
TaggingPreset.Label
|
static class |
TaggingPreset.Link
|
private static class |
TaggingPreset.MatchType
Enum denoting how a match (see TaggingPreset.Item.matches(java.util.Map ) is performed. |
static class |
TaggingPreset.MultiSelect
|
static class |
TaggingPreset.Optional
|
static class |
TaggingPreset.PresetListEntry
|
private static class |
TaggingPreset.PresetPanel
|
static class |
TaggingPreset.PresetType
|
static class |
TaggingPreset.Role
|
static class |
TaggingPreset.Roles
|
static class |
TaggingPreset.Space
|
static class |
TaggingPreset.Text
|
static class |
TaggingPreset.Usage
|
Field Summary | |
---|---|
java.util.List<TaggingPreset.Item> |
data
|
static int |
DIALOG_ANSWER_APPLY
|
static int |
DIALOG_ANSWER_CANCEL
|
static int |
DIALOG_ANSWER_NEW_RELATION
|
static java.lang.String |
DIFFERENT
|
TaggingPresetMenu |
group
|
private static java.util.HashMap<java.lang.String,java.lang.String> |
lastValue
|
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 |
private static BooleanProperty |
PROP_FILL_DEFAULT
|
private static java.util.Map<java.lang.String,java.util.EnumSet<TaggingPreset.PresetType>> |
typeCache
|
java.util.EnumSet<TaggingPreset.PresetType> |
types
The types as preparsed collection. |
private static java.io.File |
zipIcons
|
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
TaggingPreset()
Create an empty tagging preset. |
Method Summary | |
---|---|
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 |
(package private) static TaggingPreset.Usage |
determineBooleanUsage(java.util.Collection<OsmPrimitive> sel,
java.lang.String key)
|
(package private) static TaggingPreset.Usage |
determineTextUsage(java.util.Collection<OsmPrimitive> sel,
java.lang.String key)
|
private static java.lang.String |
fixPresetString(java.lang.String s)
|
java.util.List<Tag> |
getChangedTags()
|
java.lang.String |
getLocaleName()
|
java.lang.String |
getName()
|
static java.util.LinkedList<java.lang.String> |
getPresetSources()
|
java.lang.String |
getRawName()
|
static java.util.EnumSet<TaggingPreset.PresetType> |
getType(java.lang.String types)
|
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. |
protected static javax.swing.ImageIcon |
loadImageIcon(java.lang.String iconName,
java.io.File zipIcons)
|
boolean |
matches(java.util.Collection<TaggingPreset.PresetType> t,
java.util.Map<java.lang.String,java.lang.String> tags,
boolean onlyShowable)
|
static java.util.Collection<TaggingPreset> |
readAll(java.util.Collection<java.lang.String> sources,
boolean validate)
|
static java.util.List<TaggingPreset> |
readAll(java.io.Reader in,
boolean validate)
|
static java.util.Collection<TaggingPreset> |
readAll(java.lang.String source,
boolean validate)
|
static java.util.Collection<TaggingPreset> |
readFromPreferences(boolean validate)
|
void |
setDisplayName()
Change the display name without changing the toolbar value. |
void |
setIcon(java.lang.String iconName)
|
void |
setName_template_filter(java.lang.String filter)
|
void |
setName_template(java.lang.String pattern)
|
void |
setType(java.lang.String types)
|
int |
showDialog(java.util.Collection<OsmPrimitive> sel,
boolean showNewRelation)
|
private static java.lang.String[] |
splitEscaped(char delimiter,
java.lang.String s)
allow escaped comma in comma separated list: "A\, B\, C,one\, two" --> ["A, B, C", "one, two"] |
private boolean |
supportsRelation()
|
java.lang.String |
toString()
|
boolean |
typeMatches(java.util.Collection<TaggingPreset.PresetType> t)
|
protected void |
updateEnabledState()
|
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 static final java.lang.String OPTIONAL_TOOLTIP_TEXT
private static java.io.File zipIcons
private static final BooleanProperty PROP_FILL_DEFAULT
public static final java.lang.String DIFFERENT
public java.util.EnumSet<TaggingPreset.PresetType> types
public java.util.List<TaggingPreset.Item> data
public TemplateEntry nameTemplate
public SearchCompiler.Match nameTemplateFilter
private static java.util.HashMap<java.lang.String,java.lang.String> lastValue
private static final java.util.Map<java.lang.String,java.util.EnumSet<TaggingPreset.PresetType>> typeCache
private boolean originalSelectionEmpty
Constructor Detail |
---|
public TaggingPreset()
Method Detail |
---|
static TaggingPreset.Usage determineTextUsage(java.util.Collection<OsmPrimitive> sel, java.lang.String key)
static TaggingPreset.Usage determineBooleanUsage(java.util.Collection<OsmPrimitive> sel, java.lang.String key)
private static java.lang.String[] splitEscaped(char delimiter, java.lang.String s)
delimiter
- the delimiter, e.g. a comma. separates the entries and
must be escaped within one entrys
- the stringpublic void setDisplayName()
public java.lang.String getLocaleName()
public java.lang.String getName()
public java.lang.String getRawName()
protected static javax.swing.ImageIcon loadImageIcon(java.lang.String iconName, java.io.File zipIcons)
public void setIcon(java.lang.String iconName)
public static java.util.EnumSet<TaggingPreset.PresetType> getType(java.lang.String types) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void setType(java.lang.String types) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void setName_template(java.lang.String pattern) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void setName_template_filter(java.lang.String filter) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public static java.util.List<TaggingPreset> readAll(java.io.Reader in, boolean validate) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public static java.util.Collection<TaggingPreset> readAll(java.lang.String source, boolean validate) throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public static java.util.Collection<TaggingPreset> readAll(java.util.Collection<java.lang.String> sources, boolean validate)
public static java.util.LinkedList<java.lang.String> getPresetSources()
public static java.util.Collection<TaggingPreset> readFromPreferences(boolean validate)
public TaggingPreset.PresetPanel createPanel(java.util.Collection<OsmPrimitive> selected)
public boolean isShowable()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public 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 tag
public java.util.List<Tag> getChangedTags()
private static java.lang.String fixPresetString(java.lang.String s)
public static Command createCommand(java.util.Collection<OsmPrimitive> sel, java.util.List<Tag> changedTags)
private boolean supportsRelation()
protected void updateEnabledState()
public void activeLayerChange(Layer oldLayer, Layer newLayer)
MapView.LayerChangeListener
activeLayerChange
in interface MapView.LayerChangeListener
oldLayer
- The previous active layernewLayer
- The new activer layerpublic void layerAdded(Layer newLayer)
MapView.LayerChangeListener
layerAdded
in interface MapView.LayerChangeListener
newLayer
- The new added layerpublic void layerRemoved(Layer oldLayer)
MapView.LayerChangeListener
layerRemoved
in interface MapView.LayerChangeListener
oldLayer
- The old removed layerpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean typeMatches(java.util.Collection<TaggingPreset.PresetType> t)
public boolean matches(java.util.Collection<TaggingPreset.PresetType> t, java.util.Map<java.lang.String,java.lang.String> tags, boolean onlyShowable)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |