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:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.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 java.util.Set<ExportRelationToGpxAction.Mode>
mode
Mode of this ExportToGpxActionprotected java.util.Collection<Relation>
relations
Primitives this action works on-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description ExportRelationToGpxAction()
Construct a new ExportRelationToGpxAction with default modeExportRelationToGpxAction(java.util.Set<ExportRelationToGpxAction.Mode> mode)
Constructs a newExportRelationToGpxAction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
protected Layer
getLayer()
Get the layer to export.private <T> java.util.Iterator<T>
modeAwareIterator(java.util.List<T> list)
private static java.lang.String
name(java.util.Set<ExportRelationToGpxAction.Mode> mode)
void
setPrimitives(java.util.Collection<? extends IPrimitive> primitives)
Specifies the working set of primitives.private static java.lang.String
tooltip(java.util.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
-
-
-
-
Field Detail
-
mode
protected final java.util.Set<ExportRelationToGpxAction.Mode> mode
Mode of this ExportToGpxAction
-
-
Constructor Detail
-
ExportRelationToGpxAction
public ExportRelationToGpxAction()
Construct a new ExportRelationToGpxAction with default mode
-
ExportRelationToGpxAction
public ExportRelationToGpxAction(java.util.Set<ExportRelationToGpxAction.Mode> mode)
Constructs a newExportRelationToGpxAction
- Parameters:
mode
- which mode to use, seeExportRelationToGpxAction.Mode
-
-
Method Detail
-
name
private static java.lang.String name(java.util.Set<ExportRelationToGpxAction.Mode> mode)
-
tooltip
private static java.lang.String tooltip(java.util.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> java.util.Iterator<T> modeAwareIterator(java.util.List<T> list)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classGpxExportAction
- Parameters:
e
- the ActionEvent
-
setPrimitives
public void setPrimitives(java.util.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()
-
-