Class ShowHideLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.layer.ShowHideLayerAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,IEnabledStateUpdating,Layer.LayerAction,MultikeyShortcutAction
public final class ShowHideLayerAction extends javax.swing.AbstractAction implements IEnabledStateUpdating, Layer.LayerAction, MultikeyShortcutAction
Action which will toggle the visibility of the currently selected layers.- 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 java.lang.ref.WeakReference<Layer>lastLayerprivate LayerListDialog.LayerListModelmodelprivate ShortcutmultikeyShortcut
-
Constructor Summary
Constructors Constructor Description ShowHideLayerAction(LayerListDialog.LayerListModel model)Creates aShowHideLayerActionwhich will toggle the visibility of the currently selected layers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)java.awt.ComponentcreateMenuComponent()Creates and return the menu component.booleanequals(java.lang.Object obj)voidexecuteMultikeyAction(int index, boolean repeat)Execute a multi key actionMultikeyShortcutAction.MultikeyInfogetLastMultikeyAction()java.util.List<MultikeyShortcutAction.MultikeyInfo>getMultikeyCombinations()ShortcutgetMultikeyShortcut()inthashCode()booleansupportLayers(java.util.List<Layer> layers)Determines if this action supports a given list of layers.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
-
ShowHideLayerAction
public ShowHideLayerAction(LayerListDialog.LayerListModel model)
Creates aShowHideLayerActionwhich will toggle the visibility of the currently selected layers- 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
-
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.
-
updateEnabledState
public void updateEnabledState()
Description copied from interface:IEnabledStateUpdatingCalled after the layer model has changed.- Specified by:
updateEnabledStatein interfaceIEnabledStateUpdating
-
createMenuComponent
public java.awt.Component createMenuComponent()
Description copied from interface:Layer.LayerActionCreates and return the menu component.- Specified by:
createMenuComponentin interfaceLayer.LayerAction- Returns:
- the menu component
-
supportLayers
public boolean supportLayers(java.util.List<Layer> layers)
Description copied from interface:Layer.LayerActionDetermines if this action supports a given list of layers.- Specified by:
supportLayersin interfaceLayer.LayerAction- Parameters:
layers- list of layers- Returns:
trueif this action supports the given list of layers,falseotherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getMultikeyCombinations
public java.util.List<MultikeyShortcutAction.MultikeyInfo> getMultikeyCombinations()
- Specified by:
getMultikeyCombinationsin interfaceMultikeyShortcutAction
-
getLastMultikeyAction
public MultikeyShortcutAction.MultikeyInfo getLastMultikeyAction()
- Specified by:
getLastMultikeyActionin interfaceMultikeyShortcutAction
-
-