Class AddNoteAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.actions.JosmAction
-
- org.openstreetmap.josm.actions.mapmode.MapMode
-
- org.openstreetmap.josm.actions.mapmode.AddNoteAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.io.Serializable,java.lang.Cloneable,java.util.EventListener,javax.swing.Action,KeyPressReleaseListener,PreferenceChangedListener,Destroyable
public class AddNoteAction extends MapMode implements KeyPressReleaseListener
Map mode to add a new note. Listens for a mouse click and then prompts the user for text and adds a note to the note layer- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.actions.JosmAction
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
-
-
Constructor Summary
Constructors Constructor Description AddNoteAction(NoteData data)Construct a new map mode.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoKeyPressed(java.awt.event.KeyEvent e)This is called when key press event is actually pressed (no fake events while holding key)voiddoKeyReleased(java.awt.event.KeyEvent e)This is called when key press event is actually released (no fake events while holding key)voidenterMode()Makes this map mode active.voidexitMode()Makes this map mode inactive.java.lang.StringgetModeHelpText()Returns a short translated help message describing how this map mode can be used, to be displayed in status line.protected booleanlistenToLayerChange()Overwrite this ifJosmAction.updateEnabledState()should be called when the active / available layers change.protected booleanlistenToSelectionChange()Overwrite this ifJosmAction.updateEnabledState()should be called when the selection changed.voidmouseClicked(java.awt.event.MouseEvent e)-
Methods inherited from class org.openstreetmap.josm.actions.mapmode.MapMode
actionPerformed, isEditableDataLayer, layerIsSupported, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, preferenceChanged, readPreferences, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersEx, updateStatusLine
-
Methods inherited from class org.openstreetmap.josm.actions.JosmAction
buildActiveLayerChangeAdapter, buildLayerChangeAdapter, checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, setHelpId, setToolbarId, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
AddNoteAction
public AddNoteAction(NoteData data)
Construct a new map mode.- Parameters:
data- Note data container. Must not be null- Since:
- 11713
-
-
Method Detail
-
getModeHelpText
public java.lang.String getModeHelpText()
Description copied from class:MapModeReturns a short translated help message describing how this map mode can be used, to be displayed in status line.- Overrides:
getModeHelpTextin classMapMode- Returns:
- a short translated help message describing how this map mode can be used
-
enterMode
public void enterMode()
Description copied from class:MapModeMakes this map mode active.
-
exitMode
public void exitMode()
Description copied from class:MapModeMakes this map mode inactive.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Overrides:
mouseClickedin classMapMode
-
doKeyPressed
public void doKeyPressed(java.awt.event.KeyEvent e)
Description copied from interface:KeyPressReleaseListenerThis is called when key press event is actually pressed (no fake events while holding key)- Specified by:
doKeyPressedin interfaceKeyPressReleaseListener- Parameters:
e- key event
-
doKeyReleased
public void doKeyReleased(java.awt.event.KeyEvent e)
Description copied from interface:KeyPressReleaseListenerThis is called when key press event is actually released (no fake events while holding key)- Specified by:
doKeyReleasedin interfaceKeyPressReleaseListener- Parameters:
e- key event
-
listenToLayerChange
protected boolean listenToLayerChange()
Description copied from class:JosmActionOverwrite this ifJosmAction.updateEnabledState()should be called when the active / available layers change. Default is true.- Overrides:
listenToLayerChangein classJosmAction- Returns:
trueif aLayerManager.LayerChangeListenerand aMainLayerManager.ActiveLayerChangeListenershould be registered.
-
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.
-
-