org.openstreetmap.josm.actions.mapmode
Class ParallelWayAction
java.lang.Object
javax.swing.AbstractAction
org.openstreetmap.josm.actions.JosmAction
org.openstreetmap.josm.actions.mapmode.MapMode
org.openstreetmap.josm.actions.mapmode.ParallelWayAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.AWTEventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, MapViewPaintable, Destroyable
public class ParallelWayAction
- extends MapMode
- implements java.awt.event.AWTEventListener, MapViewPaintable
MapMode for making parallel ways.
All calculations are done in projected coordinates.
- See Also:
- Serialized Form
Fields inherited from class org.openstreetmap.josm.actions.JosmAction |
sc |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
mode
private ParallelWayAction.Mode mode
copyTags
private boolean copyTags
copyTagsDefault
private boolean copyTagsDefault
snap
private boolean snap
snapDefault
private boolean snapDefault
snapThreshold
private double snapThreshold
snapDistanceMetric
private double snapDistanceMetric
snapDistanceImperial
private double snapDistanceImperial
snapDistanceChinese
private double snapDistanceChinese
snapModifierCombo
private ModifiersSpec snapModifierCombo
copyTagsModifierCombo
private ModifiersSpec copyTagsModifierCombo
addToSelectionModifierCombo
private ModifiersSpec addToSelectionModifierCombo
toggleSelectedModifierCombo
private ModifiersSpec toggleSelectedModifierCombo
setSelectedModifierCombo
private ModifiersSpec setSelectedModifierCombo
initialMoveDelay
private int initialMoveDelay
mv
private final MapView mv
mousePressedPos
private java.awt.Point mousePressedPos
mouseIsDown
private boolean mouseIsDown
mousePressedTime
private long mousePressedTime
mouseHasBeenDragged
private boolean mouseHasBeenDragged
referenceSegment
private WaySegment referenceSegment
pWays
private ParallelWays pWays
sourceWays
java.util.LinkedHashSet<Way> sourceWays
helperLineStart
private EastNorth helperLineStart
helperLineEnd
private EastNorth helperLineEnd
ParallelWayAction
public ParallelWayAction(MapFrame mapFrame)
enterMode
public void enterMode()
- Overrides:
enterMode
in class MapMode
exitMode
public void exitMode()
- Overrides:
exitMode
in class MapMode
getModeHelpText
public java.lang.String getModeHelpText()
- Overrides:
getModeHelpText
in class MapMode
updateAllPreferences
private void updateAllPreferences()
updateModeLocalPreferences
private void updateModeLocalPreferences()
layerIsSupported
public boolean layerIsSupported(Layer layer)
- Overrides:
layerIsSupported
in class MapMode
eventDispatched
public void eventDispatched(java.awt.AWTEvent e)
- Specified by:
eventDispatched
in interface java.awt.event.AWTEventListener
updateModifiersState
private boolean updateModifiersState(java.awt.event.InputEvent e)
updateCursor
private void updateCursor()
setMode
private void setMode(ParallelWayAction.Mode mode)
isValidModifierCombination
private boolean isValidModifierCombination()
sanityCheck
private boolean sanityCheck()
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interface java.awt.event.MouseListener
- Overrides:
mousePressed
in class MapMode
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interface java.awt.event.MouseListener
- Overrides:
mouseReleased
in class MapMode
removeWayHighlighting
private void removeWayHighlighting(java.util.Collection<Way> ways)
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged
in interface java.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in class MapMode
matchesCurrentModifiers
private boolean matchesCurrentModifiers(ModifiersSpec spec)
paint
public void paint(java.awt.Graphics2D g,
MapView mv,
Bounds bbox)
- Description copied from interface:
MapViewPaintable
- Paint the dataset using the engine set.
- Specified by:
paint
in interface MapViewPaintable
mv
- The object that can translate GeoPoints to screen coordinates.
isModifiersValidForDragMode
private boolean isModifiersValidForDragMode()
updateFlagsOnlyChangeableOnPress
private void updateFlagsOnlyChangeableOnPress()
updateFlagsChangeableAlways
private void updateFlagsChangeableAlways()
addSourceWay
private void addSourceWay(Way w)
removeSourceWay
private void removeSourceWay(Way w)
clearSourceWays
private void clearSourceWays()
resetMouseTrackingState
private void resetMouseTrackingState()
initParallelWays
private boolean initParallelWays(java.awt.Point p,
boolean copyTags)
prefKey
private java.lang.String prefKey(java.lang.String subKey)
getStringPref
private java.lang.String getStringPref(java.lang.String subKey,
java.lang.String def)
getStringPref
private java.lang.String getStringPref(java.lang.String subKey)
JOSM