Class MVTLayer.EnableLayerAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.layer.imagery.MVTLayer.EnableLayerAction
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,Layer.LayerAction
- Enclosing class:
- MVTLayer
private static class MVTLayer.EnableLayerAction extends AbstractAction implements Layer.LayerAction
-
-
Field Summary
Fields Modifier and Type Field Description private Consumer<String>
consumer
private String
layer
private BooleanSupplier
state
-
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 EnableLayerAction(String layer, BooleanSupplier state, Consumer<String> consumer)
-
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
supportLayers(List<Layer> layers)
Determines if this action supports a given list of layers.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
EnableLayerAction
EnableLayerAction(String layer, BooleanSupplier state, Consumer<String> consumer)
-
-
Method Detail
-
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interfaceActionListener
-
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
-
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
-
-