public abstract class MapMode extends JosmAction implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
Modifier and Type | Field and Description |
---|---|
protected boolean |
alt |
protected boolean |
ctrl |
protected java.awt.Cursor |
cursor |
protected boolean |
shift |
sc
Constructor and Description |
---|
MapMode(java.lang.String name,
java.lang.String iconName,
java.lang.String tooltip,
MapFrame mapFrame,
java.awt.Cursor cursor)
Constructor for mapmodes with an menu (no shortcut will be registered)
|
MapMode(java.lang.String name,
java.lang.String iconName,
java.lang.String tooltip,
Shortcut shortcut,
MapFrame mapFrame,
java.awt.Cursor cursor)
Constructor for mapmodes without an menu
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Call selectMapMode(this) on the parent mapFrame.
|
void |
enterMode()
Makes this map mode active.
|
void |
exitMode()
Makes this map mode inactive.
|
java.lang.String |
getModeHelpText() |
boolean |
layerIsSupported(Layer l)
Determines if layer
l is supported by this map mode. |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
protected void |
requestFocusInMapView() |
protected void |
updateKeyModifiers(java.awt.event.InputEvent e) |
protected void |
updateKeyModifiers(int modifiers) |
protected void |
updateKeyModifiers(java.awt.event.MouseEvent e) |
protected void |
updateStatusLine() |
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledState
protected final java.awt.Cursor cursor
protected boolean ctrl
protected boolean alt
protected boolean shift
public MapMode(java.lang.String name, java.lang.String iconName, java.lang.String tooltip, Shortcut shortcut, MapFrame mapFrame, java.awt.Cursor cursor)
mapFrame
- unused but kept for plugin compatibility. Can be null
public void enterMode()
public void exitMode()
protected void updateStatusLine()
public java.lang.String getModeHelpText()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public 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(java.awt.event.InputEvent e)
protected void updateKeyModifiers(java.awt.event.MouseEvent e)
protected void updateKeyModifiers(int modifiers)
protected void requestFocusInMapView()
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener