Class GpxExporter
java.lang.Object
org.openstreetmap.josm.gui.io.importexport.FileExporter
org.openstreetmap.josm.gui.io.importexport.GpxExporter
- All Implemented Interfaces:
GpxConstants,MainLayerManager.ActiveLayerChangeListener
Exports data to a .gpx file. Data may be native GPX or OSM data which will be converted.
- Since:
- 1949
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
GpxConstants.ColorFormat -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final String[]private static final Stringprivate static final String[]Fields inherited from class org.openstreetmap.josm.gui.io.importexport.FileExporter
filterFields inherited from interface org.openstreetmap.josm.data.gpx.GpxConstants
EXTENSION_ABBREVIATIONS, FIX_VALUES, GARMIN_COLORS, GPX_CMT, GPX_DESC, GPX_NAME, GPX_PREFIX, GPX_SRC, JOSM_CREATOR_NAME, META_AUTHOR_EMAIL, META_AUTHOR_LINK, META_AUTHOR_NAME, META_BOUNDS, META_COPYRIGHT_AUTHOR, META_COPYRIGHT_LICENSE, META_COPYRIGHT_YEAR, META_DESC, META_KEYWORDS, META_LINKS, META_NAME, META_PREFIX, META_TIME, PT_AGEOFDGPSDATA, PT_COURSE, PT_DGPSID, PT_ELE, PT_FIX, PT_GEOIDHEIGHT, PT_HDOP, PT_MAGVAR, PT_PDOP, PT_SAT, PT_STD_HDEV, PT_STD_VDEV, PT_SYM, PT_TIME, PT_TYPE, PT_VDOP, RTE_TRK_KEYS, RTKLIB_AGE, RTKLIB_Q, RTKLIB_RATIO, RTKLIB_SDE, RTKLIB_SDEU, RTKLIB_SDN, RTKLIB_SDNE, RTKLIB_SDU, RTKLIB_SDUN, WPT_KEYS, XML_URI_EXTENSIONS_DRAWING, XML_URI_EXTENSIONS_GARMIN, XML_URI_EXTENSIONS_JOSM, XML_URI_XSD, XML_XSD_EXTENSIONS_DRAWING, XML_XSD_EXTENSIONS_GARMIN, XML_XSD_EXTENSIONS_JOSM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptFile(File pathname, Layer layer) Check if this exporter can export a certain layer to a certain file.private static voidaddDependencies(GpxData data, JCheckBox author, JosmTextField authorName, JosmTextField email, JosmTextField copyright, JButton predefined, JosmTextField copyrightYear, JLabel nameLabel, JLabel emailLabel, JLabel copyrightLabel, JLabel copyrightYearLabel, JLabel warning) Add all those listeners to handle the enable state of the fields.private static voidenableCopyright(GpxData data, JosmTextField copyright, JButton predefined, JosmTextField copyrightYear, JLabel copyrightLabel, JLabel copyrightYearLabel, JLabel warning, boolean enable) voidexportData(File file, Layer layer) Execute the data export.private voidexportData(File file, Layer layer, boolean quiet) voidexportDataQuiet(File file, Layer layer) Execute the data export without prompting the user.private static GpxDatagetGpxData(Layer layer, File file) Returns the list of supported layers.static booleanisSupportedLayer(Layer layer) Determines if the given layer is supported by this action.Methods inherited from class org.openstreetmap.josm.gui.io.importexport.FileExporter
activeOrEditLayerChanged, isCanceled, isEnabled, setCanceled, setEnabled
-
Field Details
-
SUPPORTED_LAYERS
-
GPL_WARNING
-
PUBLIC_DOMAIN
- See Also:
-
LICENSES
-
URLS
-
-
Constructor Details
-
GpxExporter
public GpxExporter()Constructs a newGpxExporter.
-
-
Method Details
-
acceptFile
Description copied from class:FileExporterCheck if this exporter can export a certain layer to a certain file. Most exporters support just a single layer type.- Overrides:
acceptFilein classFileExporter- Parameters:
pathname- the target file name (check file extension using theFileExporter.filterlayer- the layer requested for export- Returns:
- true, if the exporter can handle the layer and filename is okay
-
exportData
Description copied from class:FileExporterExecute the data export. (To be overridden by subclasses.)- Overrides:
exportDatain classFileExporter- Parameters:
file- target filelayer- the layer to export- Throws:
IOException- in case of an IO error
-
exportDataQuiet
Description copied from class:FileExporterExecute the data export without prompting the user. (To be overridden by subclasses.)- Overrides:
exportDataQuietin classFileExporter- Parameters:
file- target filelayer- the layer to export- Throws:
IOException- in case of an IO error
-
exportData
- Throws:
IOException
-
getSupportedLayers
Returns the list of supported layers.- Returns:
- the list of supported layers
- Since:
- 18068
-
isSupportedLayer
Determines if the given layer is supported by this action.- Parameters:
layer- layer to test- Returns:
trueif the given layer is supported by this action- Since:
- 18068
-
getGpxData
-
enableCopyright
private static void enableCopyright(GpxData data, JosmTextField copyright, JButton predefined, JosmTextField copyrightYear, JLabel copyrightLabel, JLabel copyrightYearLabel, JLabel warning, boolean enable) -
addDependencies
private static void addDependencies(GpxData data, JCheckBox author, JosmTextField authorName, JosmTextField email, JosmTextField copyright, JButton predefined, JosmTextField copyrightYear, JLabel nameLabel, JLabel emailLabel, JLabel copyrightLabel, JLabel copyrightYearLabel, JLabel warning) Add all those listeners to handle the enable state of the fields.- Parameters:
data- GPX dataauthor- Author checkboxauthorName- Author name textfieldemail- E-mail textfieldcopyright- Copyright textfieldpredefined- Predefined buttoncopyrightYear- Copyright year textfieldnameLabel- Name labelemailLabel- E-mail labelcopyrightLabel- Copyright labelcopyrightYearLabel- Copyright year labelwarning- Warning label
-