Class ExportRelationToGpxAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.DiskAccessAction
-
- org.openstreetmap.josm.actions.GpxExportAction
-
- org.openstreetmap.josm.actions.relation.ExportRelationToGpxAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,IPrimitiveAction
,Destroyable
public class ExportRelationToGpxAction extends GpxExportAction implements IPrimitiveAction
Exports the current relation to a single GPX track, currently for type=route and type=superroute relations only.- Since:
- 13210
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExportRelationToGpxAction.Mode
Enumeration of export variants-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<ExportRelationToGpxAction.Mode>
mode
Mode of this ExportToGpxActionprotected Collection<Relation>
relations
Primitives this action works on-
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
Constructors Constructor Description ExportRelationToGpxAction()
Construct a new ExportRelationToGpxAction with default modeExportRelationToGpxAction(Set<ExportRelationToGpxAction.Mode> mode)
Constructs a newExportRelationToGpxAction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
protected Layer
getLayer()
Get the layer to export.private <T> Iterator<T>
modeAwareIterator(List<T> list)
private static String
name(Set<ExportRelationToGpxAction.Mode> mode)
void
setPrimitives(Collection<? extends IPrimitive> primitives)
Specifies the working set of primitives.private static String
tooltip(Set<ExportRelationToGpxAction.Mode> mode)
protected void
updateEnabledState()
Refreshes the enabled state-
Methods inherited from class org.openstreetmap.josm.actions.GpxExportAction
export, listenToSelectionChange
-
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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
mode
protected final Set<ExportRelationToGpxAction.Mode> mode
Mode of this ExportToGpxAction
-
relations
protected Collection<Relation> relations
Primitives this action works on
-
-
Constructor Detail
-
ExportRelationToGpxAction
public ExportRelationToGpxAction()
Construct a new ExportRelationToGpxAction with default mode
-
ExportRelationToGpxAction
public ExportRelationToGpxAction(Set<ExportRelationToGpxAction.Mode> mode)
Constructs a newExportRelationToGpxAction
- Parameters:
mode
- which mode to use, seeExportRelationToGpxAction.Mode
-
-
Method Detail
-
name
private static String name(Set<ExportRelationToGpxAction.Mode> mode)
-
tooltip
private static String tooltip(Set<ExportRelationToGpxAction.Mode> mode)
-
getLayer
protected Layer getLayer()
Description copied from class:GpxExportAction
Get the layer to export.- Overrides:
getLayer
in classGpxExportAction
- Returns:
- The layer to export, if supported, otherwise
null
.
-
modeAwareIterator
private <T> Iterator<T> modeAwareIterator(List<T> list)
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classGpxExportAction
- Parameters:
e
- the ActionEvent
-
setPrimitives
public void setPrimitives(Collection<? extends IPrimitive> primitives)
Description copied from interface:IPrimitiveAction
Specifies the working set of primitives.- Specified by:
setPrimitives
in interfaceIPrimitiveAction
- Parameters:
primitives
- The new working set of primitives. Can be null or empty
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:GpxExportAction
Refreshes the enabled state- Overrides:
updateEnabledState
in classGpxExportAction
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
-