public class ImproveWayAccuracyAction extends MapMode implements MapViewPaintable, SelectionChangedListener, ModifierListener
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ImproveWayAccuracyAction.State |
| Modifier and Type | Field and Description |
|---|---|
private java.awt.Stroke |
addNodeStroke |
private Node |
candidateNode |
private WaySegment |
candidateSegment |
private java.awt.Cursor |
cursorImprove |
private java.awt.Cursor |
cursorImproveAdd |
private java.awt.Cursor |
cursorImproveAddLock |
private java.awt.Cursor |
cursorImproveDelete |
private java.awt.Cursor |
cursorImproveLock |
private java.awt.Cursor |
cursorSelect |
private java.awt.Cursor |
cursorSelectHover |
private java.awt.Stroke |
deleteNodeStroke |
private int |
dotSize |
private boolean |
dragging |
private java.awt.Color |
guideColor |
private java.awt.Point |
mousePos |
private java.awt.Stroke |
moveNodeStroke |
private MapView |
mv |
protected java.lang.String |
oldModeHelpText |
private boolean |
selectionChangedBlocked |
private java.awt.Stroke |
selectTargetWayStroke |
private static long |
serialVersionUID |
private ImproveWayAccuracyAction.State |
state |
private Way |
targetWay |
sc| 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.
|
java.lang.String |
getModeHelpText() |
boolean |
layerIsSupported(Layer l) |
void |
modifiersChanged(int modifiers) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds bbox)
Redraws temporary layer.
|
private void |
readPreferences() |
void |
selectionChanged(java.util.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, updateEnabledStateprivate ImproveWayAccuracyAction.State state
private static final long serialVersionUID
private Node candidateNode
private WaySegment candidateSegment
private java.awt.Point mousePos
private boolean dragging
private final java.awt.Cursor cursorSelect
private final java.awt.Cursor cursorSelectHover
private final java.awt.Cursor cursorImprove
private final java.awt.Cursor cursorImproveAdd
private final java.awt.Cursor cursorImproveDelete
private final java.awt.Cursor cursorImproveAddLock
private final java.awt.Cursor cursorImproveLock
private java.awt.Color guideColor
private java.awt.Stroke selectTargetWayStroke
private java.awt.Stroke moveNodeStroke
private java.awt.Stroke addNodeStroke
private java.awt.Stroke deleteNodeStroke
private int dotSize
private boolean selectionChangedBlocked
protected java.lang.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 java.lang.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(java.awt.Graphics2D g, MapView mv, Bounds bbox)
paint in interface MapViewPaintablemv - The object that can translate GeoPoints to screen coordinates.public void modifiersChanged(int modifiers)
modifiersChanged in interface ModifierListenerpublic void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListenerselectionChanged in interface SelectionChangedListenernewSelection - The new selection.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class MapModepublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class MapModepublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class MapModepublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.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()