Class GenericSessionExporter<T extends Layer>
- java.lang.Object
-
- org.openstreetmap.josm.io.session.AbstractSessionExporter<T>
-
- org.openstreetmap.josm.io.session.GenericSessionExporter<T>
-
- Type Parameters:
T
- Type of exported layer
- All Implemented Interfaces:
SessionLayerExporter
- Direct Known Subclasses:
GpxTracksSessionExporter
,NoteSessionExporter
,OsmDataSessionExporter
public abstract class GenericSessionExporter<T extends Layer> extends AbstractSessionExporter<T>
Generic superclass ofOsmDataSessionExporter
andGpxTracksSessionExporter
layer exporters.- Since:
- 9470
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
GenericSessionExporter.LayerSaveAction
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
extension
private javax.swing.JRadioButton
include
private javax.swing.JRadioButton
link
private java.lang.String
type
private java.lang.String
version
-
Fields inherited from class org.openstreetmap.josm.io.session.AbstractSessionExporter
export, layer
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericSessionExporter(T layer, java.lang.String type, java.lang.String version, java.lang.String extension)
Constructs a newGenericSessionExporter
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addDataFile(java.io.OutputStream out)
org.w3c.dom.Element
export(SessionWriter.ExportSupport support)
Save meta data to the .jos file.javax.swing.JPanel
getExportPanel()
The GUI for exporting this layer.boolean
requiresZip()
Return true, if some data needs to be included in the zip archive.-
Methods inherited from class org.openstreetmap.josm.io.session.AbstractSessionExporter
getDependencies, shallExport
-
-
-
-
Constructor Detail
-
GenericSessionExporter
protected GenericSessionExporter(T layer, java.lang.String type, java.lang.String version, java.lang.String extension)
Constructs a newGenericSessionExporter
.- Parameters:
layer
- layer to exporttype
- layer session typeversion
- layer session versionextension
- data file extension
-
-
Method Detail
-
getExportPanel
public javax.swing.JPanel getExportPanel()
Description copied from interface:SessionLayerExporter
The GUI for exporting this layer.- Returns:
- the export panel
-
export
public org.w3c.dom.Element export(SessionWriter.ExportSupport support) throws java.io.IOException
Description copied from interface:SessionLayerExporter
Save meta data to the .jos file. Return a layer XML element. Usesupport
to save files in the zip archive as needed.- Parameters:
support
- support class providing export utilities- Returns:
- the resulting XML element
- Throws:
java.io.IOException
- if any I/O error occurs
-
requiresZip
public boolean requiresZip()
Description copied from interface:SessionLayerExporter
Return true, if some data needs to be included in the zip archive. This decision depends on the user selection in the export panel. If any layer requires zip, the user can only save as .joz. Otherwise both .jos and .joz are possible.- Specified by:
requiresZip
in interfaceSessionLayerExporter
- Overrides:
requiresZip
in classAbstractSessionExporter<T extends Layer>
- Returns:
true
if some data needs to be included in the zip archive,false
otherwise.
-
addDataFile
protected abstract void addDataFile(java.io.OutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
-