Package org.openstreetmap.josm.actions
Class PurgeAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.PurgeAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,Destroyable
public class PurgeAction extends JosmAction
The action to purge the selected primitives, i.e. remove them from the data layer, or remove their content and make them incomplete. This means, the deleted flag is not affected and JOSM simply forgets about these primitives. This action is undo-able. In order not to break previous commands in the undo buffer, we must re-add the identical object (and not semantically equal ones).- Since:
- 3431
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classPurgeAction.SelectionForcedPrimitiveRendererforce selection to be active for all entries-
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 javax.swing.JCheckBoxcbClearUndoRedoprotected OsmDataLayerlayerprotected booleanmodifiedprotected java.util.List<OsmPrimitive>toPurgeAdditionallySubset of toPurgeChecked.-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Constructor Description PurgeAction()Constructs a newPurgeAction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)private javax.swing.JPanelbuildPanel(boolean modified)PurgeCommandgetPurgeCommand(java.util.Collection<OsmPrimitive> sel)Creates command to purge selected OSM primitives.protected voidupdateEnabledState()Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.protected voidupdateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)Override in subclasses to update the enabled state of the action if the collection of selected primitives changes.-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setToolbarId, setTooltip, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
layer
protected transient OsmDataLayer layer
-
cbClearUndoRedo
protected javax.swing.JCheckBox cbClearUndoRedo
-
modified
protected boolean modified
-
toPurgeAdditionally
protected transient java.util.List<OsmPrimitive> toPurgeAdditionally
Subset of toPurgeChecked. Those that have not been in the selection.
-
-
Constructor Detail
-
PurgeAction
public PurgeAction()
Constructs a newPurgeAction.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
-
getPurgeCommand
public PurgeCommand getPurgeCommand(java.util.Collection<OsmPrimitive> sel)
Creates command to purge selected OSM primitives.- Parameters:
sel- selected OSM primitives- Returns:
- command to purge selected OSM primitives
- Since:
- 11252
-
buildPanel
private javax.swing.JPanel buildPanel(boolean modified)
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmActionOverride 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:
updateEnabledStatein classJosmAction- See Also:
JosmAction.updateEnabledState(Collection),JosmAction.initEnabledState(),JosmAction.listenToLayerChange()
-
updateEnabledState
protected void updateEnabledState(java.util.Collection<? extends OsmPrimitive> selection)
Description copied from class:JosmActionOverride in subclasses to update the enabled state of the action if the collection of selected primitives changes. This method is called with the new selection.- Overrides:
updateEnabledStatein classJosmAction- Parameters:
selection- the collection of selected primitives; may be empty, but not null- See Also:
JosmAction.updateEnabledState(),JosmAction.initEnabledState(),JosmAction.listenToSelectionChange()
-
-