Package org.openstreetmap.josm.actions
Class GpxExportAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.DiskAccessAction
-
- org.openstreetmap.josm.actions.GpxExportAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,Destroyable
- Direct Known Subclasses:
ExportRelationToGpxAction
public class GpxExportAction extends DiskAccessAction
Exports data to gpx.- Since:
- 78
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Modifier Constructor Description GpxExportAction()
Constructs a newGpxExportAction
.protected
GpxExportAction(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean register, java.lang.String toolbarId, boolean installAdapters)
Deferring constructor for child classes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
void
export(Layer layer)
Exports a layer to a file.protected Layer
getLayer()
Get the layer to export.protected boolean
listenToSelectionChange()
Overwrite this ifJosmAction.updateEnabledState()
should be called when the selection changed.protected void
updateEnabledState()
Refreshes the enabled state-
Methods inherited from class org.openstreetmap.josm.actions.DiskAccessAction
createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, showSavedNotification, showSavingNotification
-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
GpxExportAction
public GpxExportAction()
Constructs a newGpxExportAction
.
-
GpxExportAction
protected GpxExportAction(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean register, java.lang.String toolbarId, boolean installAdapters)
Deferring constructor for child classes.- Parameters:
name
- seeDiskAccessAction
iconName
- seeDiskAccessAction
tooltip
- seeDiskAccessAction
shortcut
- seeDiskAccessAction
register
- seeDiskAccessAction
toolbarId
- seeDiskAccessAction
installAdapters
- seeDiskAccessAction
- Since:
- 13210
-
-
Method Detail
-
getLayer
protected Layer getLayer()
Get the layer to export.- Returns:
- The layer to export, if supported, otherwise
null
.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
export
public void export(Layer layer)
Exports a layer to a file. Launches a file chooser to request the user to enter a file name.layer
must not be null.layer
must be of a supported type.- Parameters:
layer
- the layer- Throws:
java.lang.IllegalArgumentException
- if layer is nulljava.lang.IllegalArgumentException
- if layer is not of a supported type.- See Also:
GpxExporter.isSupportedLayer(org.openstreetmap.josm.gui.layer.Layer)
-
listenToSelectionChange
protected boolean listenToSelectionChange()
Description copied from class:JosmAction
Overwrite this ifJosmAction.updateEnabledState()
should be called when the selection changed. Default is true.- Overrides:
listenToSelectionChange
in classJosmAction
- Returns:
true
if aDataSelectionListener
should be registered.
-
updateEnabledState
protected void updateEnabledState()
Refreshes the enabled state- Overrides:
updateEnabledState
in classJosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
-