public abstract class AbstractAudioAction extends JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Modifier | Constructor and Description |
---|---|
protected |
AbstractAudioAction(String name,
String iconName,
String tooltip,
Shortcut shortcut,
boolean registerInToolbar)
Constructs a new
BaseAudioAction . |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
isAudioMarkerPresent()
Checks if there is at least one
AudioMarker is present in the current layout. |
protected boolean |
listenToSelectionChange()
Overwrite this if
JosmAction.updateEnabledState() should be called when the selection changed. |
protected void |
updateEnabledState()
Override in subclasses to update the enabled state of the action when
something in the JOSM state changes, i.e.
|
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
protected AbstractAudioAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar)
BaseAudioAction
.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?protected static boolean isAudioMarkerPresent()
AudioMarker
is present in the current layout.true
if at least one AudioMarker
is present in the current
layout, false
otherwise.protected boolean listenToSelectionChange()
JosmAction
JosmAction.updateEnabledState()
should be called when the selection changed. Default is true.listenToSelectionChange
in class JosmAction
true
if a DataSelectionListener
should be registered.protected void updateEnabledState()
JosmAction
JosmAction.updateEnabledState(Collection)
to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
,
JosmAction.listenToLayerChange()