public class ImproveWayAccuracyAction extends MapMode implements SelectionChangedListener, ModifierExListener
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
ImproveWayAccuracyAction.State |
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter| Modifier and Type | Field and Description |
|---|---|
private static CachingProperty<java.awt.BasicStroke> |
ADD_NODE_STROKE |
private Node |
candidateNode |
private WaySegment |
candidateSegment |
private static java.lang.String |
CROSSHAIR |
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 static CachingProperty<java.awt.BasicStroke> |
DELETE_NODE_STROKE |
private static CachingProperty<java.lang.Integer> |
DOT_SIZE |
private boolean |
dragging |
private java.awt.Color |
guideColor |
private java.awt.Point |
mousePos |
private static CachingProperty<java.awt.BasicStroke> |
MOVE_NODE_INTERSECTING_STROKE |
private static CachingProperty<java.awt.BasicStroke> |
MOVE_NODE_STROKE |
private MapView |
mv |
protected java.lang.String |
oldModeHelpText |
private static CachingProperty<java.awt.BasicStroke> |
SELECT_TARGET_WAY_STROKE |
private boolean |
selectionChangedBlocked |
private static long |
serialVersionUID |
private ImproveWayAccuracyAction.State |
state |
private Way |
targetWay |
private AbstractMapViewPaintable |
temporaryLayer |
sc| Constructor and Description |
|---|
ImproveWayAccuracyAction()
Constructs a new
ImproveWayAccuracyAction. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
drawIntersectingWayHelperLines(MapView mv,
MapViewPath b) |
void |
enterMode()
Makes this map mode active.
|
void |
exitMode()
Makes this map mode inactive.
|
java.lang.String |
getModeHelpText()
Returns a short translated help message describing how this map mode can be used, to be displayed in status line.
|
boolean |
layerIsSupported(Layer l)
Determines if layer
l is supported by this map mode. |
void |
modifiersExChanged(int modifiers)
Called when the extended modifiers are changed
|
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.
|
protected 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, getPreservedPrimitives, isEditableDataLayer, mouseClicked, mouseEntered, mousePressed, preferenceChanged, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersExcheckAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFutureprivate static final java.lang.String CROSSHAIR
private ImproveWayAccuracyAction.State state
private static final long serialVersionUID
private transient Node candidateNode
private transient 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 static final CachingProperty<java.awt.BasicStroke> SELECT_TARGET_WAY_STROKE
private static final CachingProperty<java.awt.BasicStroke> MOVE_NODE_STROKE
private static final CachingProperty<java.awt.BasicStroke> MOVE_NODE_INTERSECTING_STROKE
private static final CachingProperty<java.awt.BasicStroke> ADD_NODE_STROKE
private static final CachingProperty<java.awt.BasicStroke> DELETE_NODE_STROKE
private static final CachingProperty<java.lang.Integer> DOT_SIZE
private boolean selectionChangedBlocked
protected java.lang.String oldModeHelpText
private final transient AbstractMapViewPaintable temporaryLayer
public ImproveWayAccuracyAction()
ImproveWayAccuracyAction.public void enterMode()
MapModeprotected void readPreferences()
readPreferences in class MapModepublic void exitMode()
MapModeprotected void updateStatusLine()
updateStatusLine in class MapModepublic java.lang.String getModeHelpText()
MapModegetModeHelpText 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(),
JosmAction.listenToLayerChange()public void paint(java.awt.Graphics2D g, MapView mv, Bounds bbox)
g - The graphicsmv - The map viewbbox - The bounding boxprotected void drawIntersectingWayHelperLines(MapView mv, MapViewPath b)
public void modifiersExChanged(int modifiers)
ModifierExListenermodifiersExChanged in interface ModifierExListenermodifiers - The new extended modifierspublic 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()