public class ImproveWayAccuracyAction extends MapMode implements SelectionChangedListener, ModifierListener
| 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 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 |
moveNodeIntersectingStroke |
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 |
private AbstractMapViewPaintable |
temporaryLayer |
sc| Constructor and Description |
|---|
ImproveWayAccuracyAction(MapFrame mapFrame)
Constructs a new
ImproveWayAccuracyAction. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
drawIntersectingWayHelperLines(MapView mv,
java.awt.geom.GeneralPath b) |
void |
enterMode()
Makes this map mode active.
|
void |
exitMode()
Makes this map mode inactive.
|
java.lang.String |
getModeHelpText() |
boolean |
layerIsSupported(Layer l)
Determines if layer
l is supported by this map mode. |
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.
|
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, mouseClicked, mouseEntered, mousePressed, preferenceChanged, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersdestroy, getCurrentDataSet, getEditLayer, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, waitFutureprivate 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 transient java.awt.Stroke selectTargetWayStroke
private transient java.awt.Stroke moveNodeStroke
private transient java.awt.Stroke moveNodeIntersectingStroke
private transient java.awt.Stroke addNodeStroke
private transient java.awt.Stroke deleteNodeStroke
private int dotSize
private boolean selectionChangedBlocked
protected java.lang.String oldModeHelpText
private final transient AbstractMapViewPaintable temporaryLayer
public ImproveWayAccuracyAction(MapFrame mapFrame)
ImproveWayAccuracyAction.mapFrame - Map framepublic void enterMode()
MapModeprotected void readPreferences()
readPreferences in class MapModepublic void exitMode()
MapModeprotected void updateStatusLine()
updateStatusLine in class MapModepublic java.lang.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(),
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, java.awt.geom.GeneralPath b)
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()