org.openstreetmap.josm.actions
Class GpxExportAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.openstreetmap.josm.actions.JosmAction
          extended by org.openstreetmap.josm.actions.DiskAccessAction
              extended by 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

public class GpxExportAction
extends DiskAccessAction

Exports data to gpx.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields 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
GpxExportAction()
           
 
Method Summary
 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  void updateEnabledState()
          Refreshes the enabled state
 
Methods inherited from class org.openstreetmap.josm.actions.DiskAccessAction
createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser, createAndOpenFileChooser
 
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GpxExportAction

public GpxExportAction()
Method Detail

getLayer

protected Layer getLayer()
Get the layer to export.

Returns:
The layer to export, either a GpxLayer or OsmDataLayer.

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 an instance of OsmDataLayer or GpxLayer.

Parameters:
layer - the layer
Throws:
java.lang.IllegalArgumentException - thrown if layer is null
java.lang.IllegalArgumentException - thrown if layer is neither an instance of OsmDataLayer nor of GpxLayer

updateEnabledState

protected void updateEnabledState()
Refreshes the enabled state

Overrides:
updateEnabledState in class JosmAction
See Also:
JosmAction.updateEnabledState(Collection), JosmAction.initEnabledState()


JOSM