Package org.openstreetmap.josm.actions
Class SessionSaveAsAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.DiskAccessAction
-
- org.openstreetmap.josm.actions.SessionSaveAsAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,MapFrameListener
,Destroyable
- Direct Known Subclasses:
SaveLayersDialog.SaveSessionAction
public class SessionSaveAsAction extends DiskAccessAction implements MapFrameListener
Saves a JOSM session- Since:
- 4685
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SessionSaveAsAction.SessionSaveAsDialog
The "Save Session" dialog-
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 private MultiMap<Layer,Layer>
dependencies
private Map<Layer,SessionLayerExporter>
exporters
private List<Layer>
layers
private static BooleanProperty
SAVE_LOCAL_FILES_PROPERTY
-
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 Modifier Constructor Description SessionSaveAsAction()
Constructs a newSessionSaveAsAction
.protected
SessionSaveAsAction(boolean toolbar, boolean installAdapters)
Constructs a newSessionSaveAsAction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
destroy()
Called when the object has been destroyed.void
mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame)
Called after Main.mapFrame is initialized.void
saveSession()
Attempts to save the session.protected void
updateEnabledState()
Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.-
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, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, 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
-
exporters
private transient Map<Layer,SessionLayerExporter> exporters
-
dependencies
private transient MultiMap<Layer,Layer> dependencies
-
SAVE_LOCAL_FILES_PROPERTY
private static final BooleanProperty SAVE_LOCAL_FILES_PROPERTY
-
-
Constructor Detail
-
SessionSaveAsAction
public SessionSaveAsAction()
Constructs a newSessionSaveAsAction
.
-
SessionSaveAsAction
protected SessionSaveAsAction(boolean toolbar, boolean installAdapters)
Constructs a newSessionSaveAsAction
.- Parameters:
toolbar
- Register this action for the toolbar preferences?installAdapters
- False, if you don't want to install layer changed and selection changed adapters
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
- Overrides:
destroy
in classJosmAction
-
saveSession
public void saveSession() throws UserCancelException
Attempts to save the session.- Throws:
UserCancelException
- when the user has cancelled the save process.- Since:
- 8913
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmAction
Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)
to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledState
in classJosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,JosmAction.initEnabledState()
,JosmAction.listenToLayerChange()
-
mapFrameInitialized
public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame)
Description copied from interface:MapFrameListener
Called after Main.mapFrame is initialized. (After the first data is loaded). You can use this callback to tweak the newFrame to your needs, as example install an alternative Painter.- Specified by:
mapFrameInitialized
in interfaceMapFrameListener
- Parameters:
oldFrame
- The old MapFramenewFrame
- The new MapFrame
-
-