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:
ActionListener,Serializable,Cloneable,EventListener,Action,Destroyable
- Direct Known Subclasses:
ExportRelationToGpxAction
Exports data to gpx.
- Since:
- 78
- See Also:
-
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
scFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidExports a layer to a file.protected LayergetLayer()Get the layer to export.protected booleanOverwrite this ifJosmAction.updateEnabledState()should be called when the selection changed.protected voidRefreshes the enabled stateMethods inherited from class org.openstreetmap.josm.actions.DiskAccessAction
createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, showSavedNotification, showSavingNotificationMethods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFutureMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
GpxExportAction
public GpxExportAction()Constructs a newGpxExportAction. -
GpxExportAction
protected GpxExportAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, String toolbarId, boolean installAdapters) Deferring constructor for child classes.- Parameters:
name- seeDiskAccessActioniconName- seeDiskAccessActiontooltip- seeDiskAccessActionshortcut- seeDiskAccessActionregister- seeDiskAccessActiontoolbarId- seeDiskAccessActioninstallAdapters- seeDiskAccessAction- Since:
- 13210
-
-
Method Details
-
getLayer
Get the layer to export.- Returns:
- The layer to export, if supported, otherwise
null.
-
actionPerformed
-
export
Exports a layer to a file. Launches a file chooser to request the user to enter a file name.layermust not be null.layermust be of a supported type.- Parameters:
layer- the layer- Throws:
IllegalArgumentException- if layer is nullIllegalArgumentException- if layer is not of a supported type.- See Also:
-
listenToSelectionChange
Description copied from class:JosmActionOverwrite this ifJosmAction.updateEnabledState()should be called when the selection changed. Default is true.- Overrides:
listenToSelectionChangein classJosmAction- Returns:
trueif aDataSelectionListenershould be registered.
-
updateEnabledState
Refreshes the enabled state- Overrides:
updateEnabledStatein classJosmAction- See Also:
-