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, updateKeyModifiers
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState
private 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()
MapMode
private void readPreferences()
public void exitMode()
MapMode
protected void updateStatusLine()
updateStatusLine
in class MapMode
public java.lang.String getModeHelpText()
getModeHelpText
in class MapMode
public boolean layerIsSupported(Layer l)
layerIsSupported
in class MapMode
protected void updateEnabledState()
JosmAction
JosmAction.updateEnabledState(Collection)
to respond to changes in the collection
of selected primitives.
Default behavior is empty.updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
public void paint(java.awt.Graphics2D g, MapView mv, Bounds bbox)
paint
in interface MapViewPaintable
mv
- The object that can translate GeoPoints to screen coordinates.public void modifiersChanged(int modifiers)
modifiersChanged
in interface ModifierListener
public void selectionChanged(java.util.Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListener
selectionChanged
in interface SelectionChangedListener
newSelection
- The new selection.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class MapMode
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class MapMode
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class MapMode
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class MapMode
private void updateCursor()
public void updateCursorDependentObjectsIfNeeded()
public void startSelecting()
public void startImproving(Way targetWay)
targetWay
- Way that is going to be improvedprivate void updateStateByCurrentSelection()