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 GeoImageLayer
layer
-
Constructor Summary
Constructors Constructor Description ShowThumbnailAction(GeoImageLayer layer)
Constructs a newToggleGeoImageThumbAction
action.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
This is called after the menu entry was selected.java.awt.Component
createMenuComponent()
Create actual menu entry and define if it is enabled or not.private static boolean
enabled(GeoImageLayer layer)
Check if there is any suitable image to be toggled.boolean
supportLayers(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 newToggleGeoImageThumbAction
action.- 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:
actionPerformed
in 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:
true
if there are images to be toggled,false
otherwise
-
createMenuComponent
public java.awt.Component createMenuComponent()
Create actual menu entry and define if it is enabled or not.- Specified by:
createMenuComponent
in interfaceLayer.LayerAction
- Returns:
- the menu component
-
supportLayers
public boolean supportLayers(java.util.List<Layer> layers)
Check if the current layer is supported.- Specified by:
supportLayers
in interfaceLayer.LayerAction
- Parameters:
layers
- list of layers- Returns:
true
if this action supports the given list of layers,false
otherwise
-
-