public class ImproveWayAccuracyAction extends MapMode implements MapViewPaintable, SelectionChangedListener, ModifierListener
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ImproveWayAccuracyAction.State |
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter| 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)
Constructs a new
ImproveWayAccuracyAction. |
| Modifier and Type | Method and Description |
|---|---|
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 |
modifiersChanged(int modifiers) |
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.
|
private void |
readPreferences() |
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.
|
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 transient Node candidateNode
private transient 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 transient Stroke selectTargetWayStroke
private transient Stroke moveNodeStroke
private transient Stroke addNodeStroke
private transient Stroke deleteNodeStroke
private int dotSize
private boolean selectionChangedBlocked
protected String oldModeHelpText
public ImproveWayAccuracyAction(MapFrame mapFrame)
ImproveWayAccuracyAction.mapFrame - Map framepublic void enterMode()
MapModeprivate void readPreferences()
public void exitMode()
MapModeprotected void updateStatusLine()
updateStatusLine in class MapModepublic String getModeHelpText()
getModeHelpText in class MapModepublic boolean layerIsSupported(Layer l)
MapModel is supported by this map mode.
By default, all tools will work with all layers.
Can be overwritten to require a special type of layerlayerIsSupported in class MapModel - layertrue if the layer is supported by this map modeprotected 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 MapViewPaintableg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.bbox - Bounding boxpublic void modifiersChanged(int modifiers)
modifiersChanged in interface ModifierListenerpublic 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()