Class ShowThumbnailAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.layer.geoimage.ShowThumbnailAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,Layer.LayerAction
public class ShowThumbnailAction extends javax.swing.AbstractAction implements Layer.LayerAction
Toggle the image display between thumbnails and symbols.- Since:
- 7935
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private GeoImageLayerlayer
-
Constructor Summary
Constructors Constructor Description ShowThumbnailAction(GeoImageLayer layer)Constructs a newToggleGeoImageThumbActionaction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent e)This is called after the menu entry was selected.java.awt.ComponentcreateMenuComponent()Create actual menu entry and define if it is enabled or not.private static booleanenabled(GeoImageLayer layer)Check if there is any suitable image to be toggled.booleansupportLayers(java.util.List<Layer> layers)Check if the current layer is supported.-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
layer
private final transient GeoImageLayer layer
-
-
Constructor Detail
-
ShowThumbnailAction
public ShowThumbnailAction(GeoImageLayer layer)
Constructs a newToggleGeoImageThumbActionaction.- Parameters:
layer- image layer
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
This is called after the menu entry was selected.- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener- Parameters:
e- action event
-
enabled
private static boolean enabled(GeoImageLayer layer)
Check if there is any suitable image to be toggled.- Parameters:
layer- image layer- Returns:
trueif there are images to be toggled,falseotherwise
-
createMenuComponent
public java.awt.Component createMenuComponent()
Create actual menu entry and define if it is enabled or not.- Specified by:
createMenuComponentin interfaceLayer.LayerAction- Returns:
- the menu component
-
supportLayers
public boolean supportLayers(java.util.List<Layer> layers)
Check if the current layer is supported.- Specified by:
supportLayersin interfaceLayer.LayerAction- Parameters:
layers- list of layers- Returns:
trueif this action supports the given list of layers,falseotherwise
-
-