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 |
sc
changeSupport, enabled
ACCELERATOR_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, updateKeyModifiers
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
private 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()
MapMode
public void exitMode()
MapMode
protected void updateStatusLine()
updateStatusLine
in class MapMode
public 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(Graphics2D g, MapView mv, Bounds bbox)
paint
in interface MapViewPaintable
mv
- The object that can translate GeoPoints to screen coordinates.public void eventDispatched(AWTEvent event)
eventDispatched
in interface AWTEventListener
public void selectionChanged(Collection<? extends OsmPrimitive> newSelection)
SelectionChangedListener
selectionChanged
in interface SelectionChangedListener
newSelection
- The new selection.public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MapMode
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class MapMode
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MapMode
public void mouseExited(MouseEvent e)
mouseExited
in interface 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()