public class MergeLayerAction extends AbstractMergeAction
AbstractMergeAction.LayerListCellRendererJosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapterscchangeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
MergeLayerAction()
Constructs a new
MergeLayerAction. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
protected void |
doMerge(List<Layer> targetLayers,
Collection<Layer> sourceLayers) |
protected Layer |
getSourceLayer() |
void |
merge(Layer sourceLayer)
Merges the given source layer with another one, determined at runtime.
|
void |
merge(List<Layer> sourceLayers)
Merges a list of layers together.
|
protected void |
updateEnabledState()
Override in subclasses to update the enabled state of the action when
something in the JOSM state changes, i.e.
|
static boolean |
warnMergingUploadDiscouragedLayers(Layer sourceLayer,
Layer targetLayer)
Warns about a discouraged merge operation, ask for confirmation.
|
askTargetLayer, warnNoTargetLayersForSourceLayerdestroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledStateaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledpublic MergeLayerAction()
MergeLayerAction.protected void doMerge(List<Layer> targetLayers, Collection<Layer> sourceLayers)
public void merge(List<Layer> sourceLayers)
sourceLayers - The layers to mergepublic void merge(Layer sourceLayer)
sourceLayer - The source layer to mergepublic void actionPerformed(ActionEvent e)
protected void updateEnabledState()
JosmActionJosmAction.updateEnabledState(Collection) to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState in class JosmActionJosmAction.updateEnabledState(Collection),
JosmAction.initEnabledState()protected Layer getSourceLayer()
public static final boolean warnMergingUploadDiscouragedLayers(Layer sourceLayer, Layer targetLayer)
sourceLayer - The source layertargetLayer - The target layertrue if the user wants to cancel, false if they want to continue