public class ParallelWayAction extends MapMode implements ModifierListener, MapViewPaintable, Preferences.PreferenceChangedListener
| Modifier and Type | Class and Description |
|---|---|
private static class |
ParallelWayAction.Mode |
JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdaptersc| Constructor and Description |
|---|
ParallelWayAction(MapFrame mapFrame)
Constructs a new
ParallelWayAction. |
| Modifier and Type | Method and Description |
|---|---|
private void |
addSourceWay(Way w) |
private void |
clearSourceWays() |
void |
destroy()
Called when the object has been destroyed.
|
void |
enterMode()
Makes this map mode active.
|
void |
exitMode()
Makes this map mode inactive.
|
java.lang.String |
getModeHelpText() |
private static java.lang.String |
getStringPref(java.lang.String subKey,
java.lang.String def) |
private boolean |
initParallelWays(java.awt.Point p,
boolean copyTags) |
private boolean |
isModifiersValidForDragMode() |
boolean |
layerIsSupported(Layer layer)
Determines if layer
l is supported by this map mode. |
private boolean |
matchesCurrentModifiers(ModifiersSpec spec) |
void |
modifiersChanged(int modifiers) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds bbox)
Paint the dataset using the engine set.
|
void |
preferenceChanged(Preferences.PreferenceChangeEvent e)
Trigerred when a preference entry value changes.
|
private static java.lang.String |
prefKey(java.lang.String subKey) |
private void |
removeSourceWay(Way w) |
private static void |
removeWayHighlighting(java.util.Collection<Way> ways) |
private void |
resetMouseTrackingState() |
private boolean |
sanityCheck() |
private void |
setMode(ParallelWayAction.Mode mode) |
private void |
updateAllPreferences() |
private void |
updateCursor() |
private void |
updateFlagsChangeableAlways() |
private void |
updateFlagsOnlyChangeableOnPress() |
private void |
updateModeLocalPreferences() |
private boolean |
updateModifiersState(int modifiers) |
actionPerformed, mouseClicked, mouseEntered, mouseExited, mouseMoved, readPreferences, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateStatusLinegetCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledStateprivate ParallelWayAction.Mode mode
private boolean copyTags
private boolean copyTagsDefault
private boolean snap
private boolean snapDefault
private double snapThreshold
private double snapDistanceMetric
private double snapDistanceImperial
private double snapDistanceChinese
private double snapDistanceNautical
private transient ModifiersSpec snapModifierCombo
private transient ModifiersSpec copyTagsModifierCombo
private transient ModifiersSpec addToSelectionModifierCombo
private transient ModifiersSpec toggleSelectedModifierCombo
private transient ModifiersSpec setSelectedModifierCombo
private int initialMoveDelay
private java.awt.Point mousePressedPos
private boolean mouseIsDown
private long mousePressedTime
private boolean mouseHasBeenDragged
private transient WaySegment referenceSegment
private transient ParallelWays pWays
private transient java.util.Set<Way> sourceWays
private EastNorth helperLineStart
private EastNorth helperLineEnd
private transient java.awt.Stroke helpLineStroke
private transient java.awt.Stroke refLineStroke
private java.awt.Color mainColor
public ParallelWayAction(MapFrame mapFrame)
ParallelWayAction.mapFrame - Map framepublic void enterMode()
MapModepublic void exitMode()
MapModepublic java.lang.String getModeHelpText()
getModeHelpText in class MapModeprivate void updateAllPreferences()
private void updateModeLocalPreferences()
public boolean layerIsSupported(Layer layer)
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 MapModelayer - layertrue if the layer is supported by this map modepublic void modifiersChanged(int modifiers)
modifiersChanged in interface ModifierListenerprivate boolean updateModifiersState(int modifiers)
private void updateCursor()
private void setMode(ParallelWayAction.Mode mode)
private boolean sanityCheck()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class MapModepublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class MapModeprivate static void removeWayHighlighting(java.util.Collection<Way> ways)
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class MapModeprivate boolean matchesCurrentModifiers(ModifiersSpec spec)
public void paint(java.awt.Graphics2D g, MapView mv, Bounds bbox)
MapViewPaintablepaint in interface MapViewPaintableg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.bbox - Bounding boxprivate boolean isModifiersValidForDragMode()
private void updateFlagsOnlyChangeableOnPress()
private void updateFlagsChangeableAlways()
private void addSourceWay(Way w)
private void removeSourceWay(Way w)
private void clearSourceWays()
private void resetMouseTrackingState()
private boolean initParallelWays(java.awt.Point p, boolean copyTags)
private static java.lang.String prefKey(java.lang.String subKey)
private static java.lang.String getStringPref(java.lang.String subKey, java.lang.String def)
public void preferenceChanged(Preferences.PreferenceChangeEvent e)
Preferences.PreferenceChangedListenerpreferenceChanged in interface Preferences.PreferenceChangedListenerpreferenceChanged in class MapModee - the preference change eventpublic void destroy()
Destroyabledestroy in interface Destroyabledestroy in class JosmAction