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:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action
public class ConvertFromGpxLayerAction extends ConvertToDataLayerAction<GpxLayer>
Converts aGpxLayerto aOsmDataLayer.- Since:
- 14129 (extracted from
ConvertToDataLayerAction) - See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConvertFromGpxLayerAction.TagConversionDialogRadioButtonActionListenerprivate static classConvertFromGpxLayerAction.TagConversionDialogResponse
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringGPX_SETTING-
Fields inherited from class org.openstreetmap.josm.gui.layer.gpx.ConvertToDataLayerAction
layer
-
-
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 voidaddAttributes(java.util.Map<java.lang.String,java.lang.Object> attr, OsmPrimitive p, java.util.List<java.lang.String> keys, boolean check, boolean none, java.lang.String gpxPrefix)private static voidaddExtensions(GpxExtensionCollection exts, OsmPrimitive p, boolean seg, java.util.List<java.lang.String> keys, boolean check, java.lang.String gpxPrefix)DataSetconvert()Performs the conversion to aDataSet.static DataSetconvert(GpxData data, java.lang.String convertTags, java.lang.String gpxPrefix)static DataSetfilterDataSet(DataSet ds, java.util.List<java.lang.String> listPos, java.lang.String gpxPrefix)Filters the tags of the givenDataSetprivate static ConvertFromGpxLayerAction.TagConversionDialogResponseshowTagConversionDialog(java.util.List<java.lang.String> keys, java.util.List<java.lang.String> listPos, java.util.List<java.lang.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 java.lang.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:ConvertToDataLayerActionPerforms the conversion to aDataSet.- Specified by:
convertin classConvertToDataLayerAction<GpxLayer>- Returns:
- the resulting dataset
-
convert
public static DataSet convert(GpxData data, java.lang.String convertTags, java.lang.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(java.util.Map<java.lang.String,java.lang.Object> attr, OsmPrimitive p, java.util.List<java.lang.String> keys, boolean check, boolean none, java.lang.String gpxPrefix)
-
addExtensions
private static void addExtensions(GpxExtensionCollection exts, OsmPrimitive p, boolean seg, java.util.List<java.lang.String> keys, boolean check, java.lang.String gpxPrefix)
-
filterDataSet
public static DataSet filterDataSet(DataSet ds, java.util.List<java.lang.String> listPos, java.lang.String gpxPrefix)
Filters the tags of the givenDataSet
-
showTagConversionDialog
private static ConvertFromGpxLayerAction.TagConversionDialogResponse showTagConversionDialog(java.util.List<java.lang.String> keys, java.util.List<java.lang.String> listPos, java.util.List<java.lang.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.TagConversionDialogResponsecontaining the selection
-
-