Class ConvertFromGpxLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerAction<GpxLayer>
-
- org.openstreetmap.josm.gui.layer.gpx.ConvertFromGpxLayerAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
public class ConvertFromGpxLayerAction extends ConvertToDataLayerAction<GpxLayer>
Converts aGpxLayer
to aOsmDataLayer
.- Since:
- 14129 (extracted from
ConvertToDataLayerAction
) - See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ConvertFromGpxLayerAction.TagConversionDialogRadioButtonActionListener
private static class
ConvertFromGpxLayerAction.TagConversionDialogResponse
-
Field Summary
Fields Modifier and Type Field Description private static String
GPX_SETTING
-
Fields inherited from class org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerAction
layer
-
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
Constructors Constructor Description ConvertFromGpxLayerAction(GpxLayer layer)
Creates a newFromGpxLayer
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addAttributes(Map<String,Object> attr, OsmPrimitive p, List<String> keys, boolean check, boolean none, String gpxPrefix)
private static void
addExtensions(GpxExtensionCollection exts, OsmPrimitive p, boolean seg, List<String> keys, boolean check, String gpxPrefix)
DataSet
convert()
Performs the conversion to aDataSet
.static DataSet
convert(GpxData data, String convertTags, String gpxPrefix)
static DataSet
filterDataSet(DataSet ds, List<String> listPos, String gpxPrefix)
Filters the tags of the givenDataSet
private static ConvertFromGpxLayerAction.TagConversionDialogResponse
showTagConversionDialog(List<String> keys, List<String> listPos, List<String> listNeg)
Shows the TagConversionDialog asking the user whether to keep all, some or no tags-
Methods inherited from class org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerAction
actionPerformed
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
GPX_SETTING
private static final String GPX_SETTING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConvertFromGpxLayerAction
public ConvertFromGpxLayerAction(GpxLayer layer)
Creates a newFromGpxLayer
.- Parameters:
layer
- the source layer
-
-
Method Detail
-
convert
public DataSet convert()
Description copied from class:ConvertToDataLayerAction
Performs the conversion to aDataSet
.- Specified by:
convert
in classConvertToDataLayerAction<GpxLayer>
- Returns:
- the resulting dataset
-
convert
public static DataSet convert(GpxData data, String convertTags, String gpxPrefix)
- Parameters:
data
- GPX data to convertconvertTags
- "list", "ask" or "no"gpxPrefix
- GPX prefix for tags- Returns:
- the converted dataset
- Since:
- 18078
-
addAttributes
private static void addAttributes(Map<String,Object> attr, OsmPrimitive p, List<String> keys, boolean check, boolean none, String gpxPrefix)
-
addExtensions
private static void addExtensions(GpxExtensionCollection exts, OsmPrimitive p, boolean seg, List<String> keys, boolean check, String gpxPrefix)
-
filterDataSet
public static DataSet filterDataSet(DataSet ds, List<String> listPos, String gpxPrefix)
Filters the tags of the givenDataSet
-
showTagConversionDialog
private static ConvertFromGpxLayerAction.TagConversionDialogResponse showTagConversionDialog(List<String> keys, List<String> listPos, List<String> listNeg)
Shows the TagConversionDialog asking the user whether to keep all, some or no tags- Parameters:
keys
- The keys present during the current conversionlistPos
- The keys that were previously selectedlistNeg
- The keys that were previously unselected- Returns:
ConvertFromGpxLayerAction.TagConversionDialogResponse
containing the selection
-
-