Class ActivateLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.layer.ActivateLayerAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,IEnabledStateUpdating
,MainLayerManager.ActiveLayerChangeListener
,MultikeyShortcutAction
,Destroyable
public final class ActivateLayerAction extends AbstractAction implements IEnabledStateUpdating, MainLayerManager.ActiveLayerChangeListener, MultikeyShortcutAction, Destroyable
The action to activate the currently selected layer- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.util.MultikeyShortcutAction
MultikeyShortcutAction.MultikeyInfo
-
-
Field Summary
Fields Modifier and Type Field Description private Layer
layer
private LayerListDialog.LayerListModel
model
private Shortcut
multikeyShortcut
-
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 Constructor Description ActivateLayerAction(LayerListDialog.LayerListModel model)
Constructs a newActivateLayerAction
.ActivateLayerAction(Layer layer, LayerListDialog.LayerListModel model)
Constructs a newActivateLayerAction
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
void
activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Called whenever the active or edit layer changed.void
destroy()
Called when the object has been destroyed.private void
execute(Layer layer)
void
executeMultikeyAction(int index, boolean repeat)
MultikeyShortcutAction.MultikeyInfo
getLastMultikeyAction()
List<MultikeyShortcutAction.MultikeyInfo>
getMultikeyCombinations()
Shortcut
getMultikeyShortcut()
(package private) boolean
isActiveLayer(Layer layer)
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
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
multikeyShortcut
private final transient Shortcut multikeyShortcut
-
model
private final LayerListDialog.LayerListModel model
-
-
Constructor Detail
-
ActivateLayerAction
public ActivateLayerAction(Layer layer, LayerListDialog.LayerListModel model)
Constructs a newActivateLayerAction
.- Parameters:
layer
- the layermodel
- layer list model
-
ActivateLayerAction
public ActivateLayerAction(LayerListDialog.LayerListModel model)
Constructs a newActivateLayerAction
.- Parameters:
model
- layer list model
-
-
Method Detail
-
getMultikeyShortcut
public Shortcut getMultikeyShortcut()
- Specified by:
getMultikeyShortcut
in interfaceMultikeyShortcutAction
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
-
isActiveLayer
boolean isActiveLayer(Layer layer)
-
updateEnabledState
public void updateEnabledState()
Description copied from interface:IEnabledStateUpdating
Called after the layer model has changed.- Specified by:
updateEnabledState
in interfaceIEnabledStateUpdating
-
activeOrEditLayerChanged
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Description copied from interface:MainLayerManager.ActiveLayerChangeListener
Called whenever the active or edit layer changed.You can be sure that this layer is still contained in this set.
Listeners are called in the EDT thread and you can manipulate the layer manager in the current thread.
- Specified by:
activeOrEditLayerChanged
in interfaceMainLayerManager.ActiveLayerChangeListener
- Parameters:
e
- The change event.
-
executeMultikeyAction
public void executeMultikeyAction(int index, boolean repeat)
- Specified by:
executeMultikeyAction
in interfaceMultikeyShortcutAction
-
getMultikeyCombinations
public List<MultikeyShortcutAction.MultikeyInfo> getMultikeyCombinations()
- Specified by:
getMultikeyCombinations
in interfaceMultikeyShortcutAction
-
getLastMultikeyAction
public MultikeyShortcutAction.MultikeyInfo getLastMultikeyAction()
- Specified by:
getLastMultikeyAction
in interfaceMultikeyShortcutAction
-
destroy
public void destroy()
Description copied from interface:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
-
-