Class ActivateLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.layer.ActivateLayerAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,IEnabledStateUpdating
,MainLayerManager.ActiveLayerChangeListener
,MultikeyShortcutAction
,Destroyable
public final class ActivateLayerAction extends javax.swing.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
-
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(java.awt.event.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)
Execute a multi key actionMultikeyShortcutAction.MultikeyInfo
getLastMultikeyAction()
java.util.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
-
-
-
-
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(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
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)
Description copied from interface:MultikeyShortcutAction
Execute a multi key action- Specified by:
executeMultikeyAction
in interfaceMultikeyShortcutAction
- Parameters:
index
- The index to executerepeat
-true
if the last action should be executed if no action is found for the given index.
-
getMultikeyCombinations
public java.util.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
-
-