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 Layerlayerprivate LayerListDialog.LayerListModelmodelprivate ShortcutmultikeyShortcut
-
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 voidactionPerformed(java.awt.event.ActionEvent e)voidactiveOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)Called whenever the active or edit layer changed.voiddestroy()Called when the object has been destroyed.private voidexecute(Layer layer)voidexecuteMultikeyAction(int index, boolean repeat)Execute a multi key actionMultikeyShortcutAction.MultikeyInfogetLastMultikeyAction()java.util.List<MultikeyShortcutAction.MultikeyInfo>getMultikeyCombinations()ShortcutgetMultikeyShortcut()(package private) booleanisActiveLayer(Layer layer)voidupdateEnabledState()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:
getMultikeyShortcutin interfaceMultikeyShortcutAction
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
isActiveLayer
boolean isActiveLayer(Layer layer)
-
updateEnabledState
public void updateEnabledState()
Description copied from interface:IEnabledStateUpdatingCalled after the layer model has changed.- Specified by:
updateEnabledStatein interfaceIEnabledStateUpdating
-
activeOrEditLayerChanged
public void activeOrEditLayerChanged(MainLayerManager.ActiveLayerChangeEvent e)
Description copied from interface:MainLayerManager.ActiveLayerChangeListenerCalled 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:
activeOrEditLayerChangedin interfaceMainLayerManager.ActiveLayerChangeListener- Parameters:
e- The change event.
-
executeMultikeyAction
public void executeMultikeyAction(int index, boolean repeat)
Description copied from interface:MultikeyShortcutActionExecute a multi key action- Specified by:
executeMultikeyActionin interfaceMultikeyShortcutAction- Parameters:
index- The index to executerepeat-trueif 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:
getMultikeyCombinationsin interfaceMultikeyShortcutAction
-
getLastMultikeyAction
public MultikeyShortcutAction.MultikeyInfo getLastMultikeyAction()
- Specified by:
getLastMultikeyActionin interfaceMultikeyShortcutAction
-
destroy
public void destroy()
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable
-
-