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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.util.MultikeyShortcutAction
MultikeyShortcutAction.MultikeyInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Layerprivate final LayerListDialog.LayerListModelprivate final ShortcutFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields 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
ConstructorsConstructorDescriptionConstructs a newActivateLayerAction.ActivateLayerAction(Layer layer, LayerListDialog.LayerListModel model) Constructs a newActivateLayerAction. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCalled whenever the active or edit layer changed.voiddestroy()Called when the object has been destroyed.private voidvoidexecuteMultikeyAction(int index, boolean repeat) Execute a multi key action(package private) booleanisActiveLayer(Layer layer) voidCalled after the layer model has changed.Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
layer
-
multikeyShortcut
-
model
-
-
Constructor Details
-
ActivateLayerAction
Constructs a newActivateLayerAction.- Parameters:
layer- the layermodel- layer list model
-
ActivateLayerAction
Constructs a newActivateLayerAction.- Parameters:
model- layer list model
-
-
Method Details
-
getMultikeyShortcut
- Specified by:
getMultikeyShortcutin interfaceMultikeyShortcutAction
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
execute
-
isActiveLayer
-
updateEnabledState
Description copied from interface:IEnabledStateUpdatingCalled after the layer model has changed.- Specified by:
updateEnabledStatein interfaceIEnabledStateUpdating
-
activeOrEditLayerChanged
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
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
- Specified by:
getMultikeyCombinationsin interfaceMultikeyShortcutAction
-
getLastMultikeyAction
- Specified by:
getLastMultikeyActionin interfaceMultikeyShortcutAction
-
destroy
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable
-