Class ShowHideLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.dialogs.layer.ShowHideLayerAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,IEnabledStateUpdating
,Layer.LayerAction
,MultikeyShortcutAction
public final class ShowHideLayerAction extends 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 WeakReference<Layer>
lastLayer
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 ShowHideLayerAction(LayerListDialog.LayerListModel model)
Creates aShowHideLayerAction
which will toggle the visibility of the currently selected layers
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
Component
createMenuComponent()
Creates and return the menu component.boolean
equals(Object obj)
void
executeMultikeyAction(int index, boolean repeat)
MultikeyShortcutAction.MultikeyInfo
getLastMultikeyAction()
List<MultikeyShortcutAction.MultikeyInfo>
getMultikeyCombinations()
Shortcut
getMultikeyShortcut()
int
hashCode()
boolean
supportLayers(List<Layer> layers)
Determines if this action supports a given list of layers.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
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
lastLayer
private transient WeakReference<Layer> lastLayer
-
multikeyShortcut
private final transient Shortcut multikeyShortcut
-
model
private final LayerListDialog.LayerListModel model
-
-
Constructor Detail
-
ShowHideLayerAction
public ShowHideLayerAction(LayerListDialog.LayerListModel model)
Creates aShowHideLayerAction
which will toggle the visibility of the currently selected layers- 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
-
executeMultikeyAction
public void executeMultikeyAction(int index, boolean repeat)
- Specified by:
executeMultikeyAction
in interfaceMultikeyShortcutAction
-
updateEnabledState
public void updateEnabledState()
Description copied from interface:IEnabledStateUpdating
Called after the layer model has changed.- Specified by:
updateEnabledState
in interfaceIEnabledStateUpdating
-
createMenuComponent
public Component createMenuComponent()
Description copied from interface:Layer.LayerAction
Creates and return the menu component.- Specified by:
createMenuComponent
in interfaceLayer.LayerAction
- Returns:
- the menu component
-
supportLayers
public boolean supportLayers(List<Layer> layers)
Description copied from interface:Layer.LayerAction
Determines if this action supports a given list of layers.- Specified by:
supportLayers
in interfaceLayer.LayerAction
- Parameters:
layers
- list of layers- Returns:
true
if this action supports the given list of layers,false
otherwise
-
getMultikeyCombinations
public List<MultikeyShortcutAction.MultikeyInfo> getMultikeyCombinations()
- Specified by:
getMultikeyCombinations
in interfaceMultikeyShortcutAction
-
getLastMultikeyAction
public MultikeyShortcutAction.MultikeyInfo getLastMultikeyAction()
- Specified by:
getLastMultikeyAction
in interfaceMultikeyShortcutAction
-
-