Class AbstractAudioAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.audio.AbstractAudioAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,Destroyable
- Direct Known Subclasses:
AudioBackAction,AudioFastSlowAction,AudioFwdAction,AudioNextAction,AudioPlayPauseAction,AudioPrevAction
public abstract class AbstractAudioAction extends JosmAction
Base class for every action related to audio content.- Since:
- 12565
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.actions.JosmAction
sc
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAudioAction(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean registerInToolbar)Constructs a newBaseAudioAction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static booleanisAudioMarkerPresent()Checks if there is at least oneAudioMarkeris present in the current layout.protected booleanlistenToSelectionChange()Overwrite this ifJosmAction.updateEnabledState()should be called when the selection changed.protected voidupdateEnabledState()Override in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e.-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
AbstractAudioAction
protected AbstractAudioAction(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, boolean registerInToolbar)
Constructs a newBaseAudioAction.- Parameters:
name- the action's text as displayed on the menu (if it is added to a menu)iconName- the filename of the icon to usetooltip- a longer description of the action that will be displayed in the tooltipshortcut- a ready-created shortcut object or null if you don't want a shortcutregisterInToolbar- register this action for the toolbar preferences?
-
-
Method Detail
-
isAudioMarkerPresent
protected static boolean isAudioMarkerPresent()
Checks if there is at least oneAudioMarkeris present in the current layout.- Returns:
trueif at least oneAudioMarkeris present in the current layout,falseotherwise.
-
listenToSelectionChange
protected boolean listenToSelectionChange()
Description copied from class:JosmActionOverwrite this ifJosmAction.updateEnabledState()should be called when the selection changed. Default is true.- Overrides:
listenToSelectionChangein classJosmAction- Returns:
trueif aDataSelectionListenershould be registered.
-
updateEnabledState
protected void updateEnabledState()
Description copied from class:JosmActionOverride in subclasses to update the enabled state of the action when something in the JOSM state changes, i.e. when a layer is removed or added. SeeJosmAction.updateEnabledState(Collection)to respond to changes in the collection of selected primitives. Default behavior is empty.- Overrides:
updateEnabledStatein classJosmAction- See Also:
JosmAction.updateEnabledState(Collection),JosmAction.initEnabledState(),JosmAction.listenToLayerChange()
-
-