public abstract class MapMode extends JosmAction implements MouseListener, MouseMotionListener
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter| Modifier and Type | Field and Description |
|---|---|
protected boolean |
alt |
protected boolean |
ctrl |
protected Cursor |
cursor |
protected boolean |
shift |
scchangeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
MapMode(String name,
String iconName,
String tooltip,
MapFrame mapFrame,
Cursor cursor)
Constructor for mapmodes with a menu (no shortcut will be registered)
|
MapMode(String name,
String iconName,
String tooltip,
Shortcut shortcut,
MapFrame mapFrame,
Cursor cursor)
Constructor for mapmodes without a menu
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e)
Call selectMapMode(this) on the parent mapFrame.
|
void |
enterMode()
Makes this map mode active.
|
void |
exitMode()
Makes this map mode inactive.
|
String |
getModeHelpText() |
boolean |
layerIsSupported(Layer l)
Determines if layer
l is supported by this map mode. |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
protected void |
requestFocusInMapView() |
protected void |
updateKeyModifiers(InputEvent e) |
protected void |
updateKeyModifiers(int modifiers) |
protected void |
updateKeyModifiers(MouseEvent e) |
protected void |
updateStatusLine() |
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledStateaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledpublic MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor)
name - the action's texticonName - icon filename in mapmode directorytooltip - a longer description of the action that will be displayed in the tooltip.shortcut - a ready-created shortcut object or null if you don't want a shortcut.mapFrame - unused but kept for plugin compatibility. Can be nullcursor - cursor displayed when map mode is activepublic MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor)
name - the action's texticonName - icon filename in mapmode directorytooltip - a longer description of the action that will be displayed in the tooltip.mapFrame - unused but kept for plugin compatibility. Can be nullcursor - cursor displayed when map mode is activepublic void enterMode()
public void exitMode()
protected void updateStatusLine()
public String getModeHelpText()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic boolean layerIsSupported(Layer l)
l is supported by this map mode.
By default, all tools will work with all layers.
Can be overwritten to require a special type of layerl - layertrue if the layer is supported by this map modeprotected void updateKeyModifiers(InputEvent e)
protected void updateKeyModifiers(MouseEvent e)
protected void updateKeyModifiers(int modifiers)
protected void requestFocusInMapView()
public void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenerpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenerpublic void mousePressed(MouseEvent e)
mousePressed in interface MouseListenerpublic void mouseClicked(MouseEvent e)
mouseClicked in interface MouseListenerpublic void mouseEntered(MouseEvent e)
mouseEntered in interface MouseListenerpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenerpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListener