org.openstreetmap.josm.actions.mapmode
Class ImproveWayAccuracyAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.mapmode.MapMode
org.openstreetmap.josm.actions.mapmode.ImproveWayAccuracyAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.AWTEventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, SelectionChangedListener, MapViewPaintable, Destroyable
public class ImproveWayAccuracyAction
- extends MapMode
- implements MapViewPaintable, SelectionChangedListener, java.awt.event.AWTEventListener
- See Also:
- Serialized Form
Fields inherited from class org.openstreetmap.josm.actions.JosmAction |
sc |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
state
private ImproveWayAccuracyAction.State state
mv
private MapView mv
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
targetWay
private Way targetWay
candidateNode
private Node candidateNode
candidateSegment
private WaySegment candidateSegment
mousePos
private java.awt.Point mousePos
dragging
private boolean dragging
cursorSelect
private final java.awt.Cursor cursorSelect
cursorSelectHover
private final java.awt.Cursor cursorSelectHover
cursorImprove
private final java.awt.Cursor cursorImprove
cursorImproveAdd
private final java.awt.Cursor cursorImproveAdd
cursorImproveDelete
private final java.awt.Cursor cursorImproveDelete
cursorImproveAddLock
private final java.awt.Cursor cursorImproveAddLock
cursorImproveLock
private final java.awt.Cursor cursorImproveLock
guideColor
private final java.awt.Color guideColor
selectTargetWayStroke
private final java.awt.BasicStroke selectTargetWayStroke
moveNodeStroke
private final java.awt.BasicStroke moveNodeStroke
addNodeStroke
private final java.awt.BasicStroke addNodeStroke
deleteNodeStroke
private final java.awt.BasicStroke deleteNodeStroke
selectionChangedBlocked
private boolean selectionChangedBlocked
oldModeHelpText
protected java.lang.String oldModeHelpText
ImproveWayAccuracyAction
public ImproveWayAccuracyAction(MapFrame mapFrame)
enterMode
public void enterMode()
- Overrides:
enterMode
in class MapMode
exitMode
public void exitMode()
- Overrides:
exitMode
in class MapMode
updateStatusLine
protected void updateStatusLine()
- Overrides:
updateStatusLine
in class MapMode
getModeHelpText
public java.lang.String getModeHelpText()
- Overrides:
getModeHelpText
in class MapMode
layerIsSupported
public boolean layerIsSupported(Layer l)
- Overrides:
layerIsSupported
in class MapMode
updateEnabledState
protected void updateEnabledState()
- Description copied from class:
JosmAction
- Override 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.
See
JosmAction.updateEnabledState(Collection)
to respond to changes in the collection
of selected primitives.
Default behavior is empty.
- Overrides:
updateEnabledState
in class JosmAction
- See Also:
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
paint
public void paint(java.awt.Graphics2D g,
MapView mv,
Bounds bbox)
- Redraws temporary layer. Highlights targetWay in select mode. Draws
preview lines in improve mode and highlights the candidateNode
- Specified by:
paint
in interface MapViewPaintable
mv
- The object that can translate GeoPoints to screen coordinates.
eventDispatched
public void eventDispatched(java.awt.AWTEvent event)
- Specified by:
eventDispatched
in interface java.awt.event.AWTEventListener
selectionChanged
public void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
- Description copied from interface:
SelectionChangedListener
- Informs the listener that the selection in the dataset has changed.
- Specified by:
selectionChanged
in interface SelectionChangedListener
- Parameters:
newSelection
- The new selection.
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in class MapMode
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMoved
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in class MapMode
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class MapMode
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited
in interface java.awt.event.MouseListener
- Overrides:
mouseExited
in class MapMode
updateCursor
private void updateCursor()
- Sets new cursor depending on state, mouse position
updateCursorDependentObjectsIfNeeded
public void updateCursorDependentObjectsIfNeeded()
- Updates these objects under cursor: targetWay, candidateNode,
candidateSegment
startSelecting
public void startSelecting()
- Switches to Selecting state
startImproving
public void startImproving(Way targetWay)
- Switches to Improving state
- Parameters:
targetWay
- Way that is going to be improved
updateStateByCurrentSelection
private void updateStateByCurrentSelection()
- Updates the state according to the current selection. Goes to Improve
state if a single way or node is selected. Extracts a way by a node in
the second case.
JOSM