Class MergeAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.layer.MergeAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,IEnabledStateUpdating
,Layer.LayerAction
,Layer.MultiLayerAction
public final class MergeAction extends javax.swing.AbstractAction implements IEnabledStateUpdating, Layer.LayerAction, Layer.MultiLayerAction
The action to merge the currently selected layer into another layer.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description MergeAction(java.util.List<Layer> layers, LayerListDialog.LayerListModel model)
Constructs a newMergeAction
.private
MergeAction(Layer layer, java.util.List<Layer> layers, LayerListDialog.LayerListModel model)
Constructs a newMergeAction
.MergeAction(Layer layer, LayerListDialog.LayerListModel model)
Constructs a newMergeAction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
java.awt.Component
createMenuComponent()
Creates and return the menu component.MergeAction
getMultiLayerAction(java.util.List<Layer> layers)
Returns the action for a given list of layers.boolean
supportLayers(java.util.List<Layer> layers)
Determines if this action supports a given list of layers.void
updateEnabledState()
Called after the layer model has changed.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
MergeAction
public MergeAction(Layer layer, LayerListDialog.LayerListModel model)
Constructs a newMergeAction
.- Parameters:
layer
- the layermodel
- layer list model- Throws:
java.lang.IllegalArgumentException
- iflayer
is null
-
MergeAction
public MergeAction(java.util.List<Layer> layers, LayerListDialog.LayerListModel model)
Constructs a newMergeAction
.- Parameters:
layers
- the layer listmodel
- layer list model- Throws:
java.lang.IllegalArgumentException
- iflayers
is null
-
MergeAction
private MergeAction(Layer layer, java.util.List<Layer> layers, LayerListDialog.LayerListModel model)
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 Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
updateEnabledState
public void updateEnabledState()
Description copied from interface:IEnabledStateUpdating
Called after the layer model has changed.- Specified by:
updateEnabledState
in interfaceIEnabledStateUpdating
-
supportLayers
public boolean supportLayers(java.util.List<Layer> layers)
Description copied from interface:Layer.LayerAction
Determines if this action supports a given list of layers.- Specified by:
supportLayers
in interfaceLayer.LayerAction
- Parameters:
layers
- list of layers- Returns:
true
if this action supports the given list of layers,false
otherwise
-
createMenuComponent
public java.awt.Component createMenuComponent()
Description copied from interface:Layer.LayerAction
Creates and return the menu component.- Specified by:
createMenuComponent
in interfaceLayer.LayerAction
- Returns:
- the menu component
-
getMultiLayerAction
public MergeAction getMultiLayerAction(java.util.List<Layer> layers)
Description copied from interface:Layer.MultiLayerAction
Returns the action for a given list of layers.- Specified by:
getMultiLayerAction
in interfaceLayer.MultiLayerAction
- Parameters:
layers
- list of layers- Returns:
- the action for the given list of layers
-
-