Class MergeAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.gui.dialogs.layer.MergeAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,IEnabledStateUpdating,Layer.LayerAction,Layer.MultiLayerAction
public final class MergeAction
extends AbstractAction
implements IEnabledStateUpdating, Layer.LayerAction, Layer.MultiLayerAction
The action to merge the currently selected layer into another layer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Layerprivate final LayerListDialog.LayerListModelFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsModifierConstructorDescriptionMergeAction(List<Layer> layers, LayerListDialog.LayerListModel model) Constructs a newMergeAction.privateMergeAction(Layer layer, List<Layer> layers, LayerListDialog.LayerListModel model) Constructs a newMergeAction.MergeAction(Layer layer, LayerListDialog.LayerListModel model) Constructs a newMergeAction. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates and return the menu component.getMultiLayerAction(List<Layer> layers) Returns the action for a given list of layers.booleansupportLayers(List<Layer> layers) Determines if this action supports a given list of layers.voidCalled after the layer model has changed.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
layer
-
layers
-
model
-
-
Constructor Details
-
MergeAction
Constructs a newMergeAction.- Parameters:
layer- the layermodel- layer list model- Throws:
IllegalArgumentException- iflayeris null
-
MergeAction
Constructs a newMergeAction.- Parameters:
layers- the layer listmodel- layer list model- Throws:
IllegalArgumentException- iflayersis null
-
MergeAction
Constructs a newMergeAction.- Parameters:
layer- the layer (null if layer list if specified)layers- the layer list (null if a single layer is specified)model- layer list model
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
updateEnabledState
Description copied from interface:IEnabledStateUpdatingCalled after the layer model has changed.- Specified by:
updateEnabledStatein interfaceIEnabledStateUpdating
-
supportLayers
Description copied from interface:Layer.LayerActionDetermines if this action supports a given list of layers.- Specified by:
supportLayersin interfaceLayer.LayerAction- Parameters:
layers- list of layers- Returns:
trueif this action supports the given list of layers,falseotherwise
-
createMenuComponent
Description copied from interface:Layer.LayerActionCreates and return the menu component.- Specified by:
createMenuComponentin interfaceLayer.LayerAction- Returns:
- the menu component
-
getMultiLayerAction
Description copied from interface:Layer.MultiLayerActionReturns the action for a given list of layers.- Specified by:
getMultiLayerActionin interfaceLayer.MultiLayerAction- Parameters:
layers- list of layers- Returns:
- the action for the given list of layers
-