public class ImproveWayAccuracyAction extends MapMode implements MapViewPaintable, SelectionChangedListener, AWTEventListener
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ImproveWayAccuracyAction.State |
| Modifier and Type | Field and Description |
|---|---|
private Stroke |
addNodeStroke |
private Node |
candidateNode |
private WaySegment |
candidateSegment |
private Cursor |
cursorImprove |
private Cursor |
cursorImproveAdd |
private Cursor |
cursorImproveAddLock |
private Cursor |
cursorImproveDelete |
private Cursor |
cursorImproveLock |
private Cursor |
cursorSelect |
private Cursor |
cursorSelectHover |
private Stroke |
deleteNodeStroke |
private int |
dotSize |
private boolean |
dragging |
private Color |
guideColor |
private Point |
mousePos |
private Stroke |
moveNodeStroke |
private MapView |
mv |
protected String |
oldModeHelpText |
private boolean |
selectionChangedBlocked |
private Stroke |
selectTargetWayStroke |
private static long |
serialVersionUID |
private ImproveWayAccuracyAction.State |
state |
private Way |
targetWay |
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 |
|---|
ImproveWayAccuracyAction(MapFrame mapFrame) |
| Modifier and Type | Method and Description |
|---|---|
void |
enterMode()
Makes this map mode active.
|
void |
eventDispatched(AWTEvent event) |
void |
exitMode()
Makes this map mode inactive.
|
String |
getModeHelpText() |
boolean |
layerIsSupported(Layer l) |
void |
mouseDragged(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics2D g,
MapView mv,
Bounds bbox)
Redraws temporary layer.
|
void |
selectionChanged(Collection<? extends OsmPrimitive> newSelection)
Informs the listener that the selection in the dataset has changed.
|
void |
startImproving(Way targetWay)
Switches to Improving state
|
void |
startSelecting()
Switches to Selecting state
|
private void |
updateCursor()
Sets new cursor depending on state, mouse position
|
void |
updateCursorDependentObjectsIfNeeded()
Updates these objects under cursor: targetWay, candidateNode,
candidateSegment
|
protected void |
updateEnabledState()
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.
|
private void |
updateStateByCurrentSelection()
Updates the state according to the current selection.
|
protected void |
updateStatusLine() |
actionPerformed, mouseClicked, mouseEntered, mousePressed, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersdestroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledStateaddPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledprivate ImproveWayAccuracyAction.State state
private static final long serialVersionUID
private Node candidateNode
private WaySegment candidateSegment
private boolean dragging
private final Cursor cursorSelect
private final Cursor cursorSelectHover
private final Cursor cursorImprove
private final Cursor cursorImproveAdd
private final Cursor cursorImproveDelete
private final Cursor cursorImproveAddLock
private final Cursor cursorImproveLock
private Color guideColor
private Stroke selectTargetWayStroke
private Stroke moveNodeStroke
private Stroke addNodeStroke
private Stroke deleteNodeStroke
private int dotSize
private boolean selectionChangedBlocked
protected String oldModeHelpText
public ImproveWayAccuracyAction(MapFrame mapFrame)
public void enterMode()
MapModepublic void exitMode()
MapModeprotected void updateStatusLine()
updateStatusLine in class MapModepublic String getModeHelpText()
getModeHelpText in class MapModepublic boolean layerIsSupported(Layer l)
layerIsSupported in class MapModeprotected void updateEnabledState()
JosmActionJosmAction.updateEnabledState(Collection) to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState in class JosmActionJosmAction.updateEnabledState(Collection),
JosmAction.initEnabledState()public void paint(Graphics2D g, MapView mv, Bounds bbox)
paint in interface MapViewPaintablemv - The object that can translate GeoPoints to screen coordinates.public void eventDispatched(AWTEvent event)
eventDispatched in interface AWTEventListenerpublic void selectionChanged(Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListenerselectionChanged in interface SelectionChangedListenernewSelection - The new selection.public void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenermouseDragged in class MapModepublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenermouseMoved in class MapModepublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenermouseReleased in class MapModepublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenermouseExited in class MapModeprivate void updateCursor()
public void updateCursorDependentObjectsIfNeeded()
public void startSelecting()
public void startImproving(Way targetWay)
targetWay - Way that is going to be improvedprivate void updateStateByCurrentSelection()