public class ParallelWayAction extends MapMode implements ModifierExListener
Modifier and Type | Class and Description |
---|---|
private static class |
ParallelWayAction.KeyboardModifiersProperty
A property that holds the keyboard modifiers.
|
(package private) static class |
ParallelWayAction.Mode |
(package private) static class |
ParallelWayAction.Modifier |
private class |
ParallelWayAction.ParallelWayLayer |
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
sc
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 |
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.
|
private boolean |
initParallelWays(java.awt.Point p,
boolean copyTags) |
private boolean |
isModifiersValidForDragMode() |
boolean |
layerIsSupported(Layer l)
Determines if layer
l is supported by this map mode. |
private boolean |
matchesCurrentModifiers(CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> spec) |
private boolean |
matchesCurrentModifiers(java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean> spec) |
void |
modifiersExChanged(int modifiers)
Called when the extended modifiers are changed
|
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
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 |
updateCursor() |
private void |
updateFlagsChangeableAlways() |
private void |
updateFlagsOnlyChangeableOnPress() |
private boolean |
updateModifiersState(int modifiers) |
actionPerformed, getPreservedPrimitives, isEditableDataLayer, mouseClicked, mouseEntered, mouseExited, mouseMoved, preferenceChanged, readPreferences, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateKeyModifiersEx, updateStatusLine
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setTooltip, updateEnabledState, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
private static final CachingProperty<java.awt.BasicStroke> HELPER_LINE_STROKE
private static final CachingProperty<java.awt.BasicStroke> REF_LINE_STROKE
private static final CachingProperty<java.lang.Double> SNAP_THRESHOLD
private static final CachingProperty<java.lang.Boolean> SNAP_DEFAULT
private static final CachingProperty<java.lang.Boolean> COPY_TAGS_DEFAULT
private static final CachingProperty<java.lang.Integer> INITIAL_MOVE_DELAY
private static final CachingProperty<java.lang.Double> SNAP_DISTANCE_METRIC
private static final CachingProperty<java.lang.Double> SNAP_DISTANCE_IMPERIAL
private static final CachingProperty<java.lang.Double> SNAP_DISTANCE_CHINESE
private static final CachingProperty<java.lang.Double> SNAP_DISTANCE_NAUTICAL
private static final CachingProperty<java.awt.Color> MAIN_COLOR
private static final CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> SNAP_MODIFIER_COMBO
private static final CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> COPY_TAGS_MODIFIER_COMBO
private static final CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> ADD_TO_SELECTION_MODIFIER_COMBO
private static final CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> TOGGLE_SELECTED_MODIFIER_COMBO
private static final CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> SET_SELECTED_MODIFIER_COMBO
private ParallelWayAction.Mode mode
private boolean copyTags
private boolean snap
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 final ParallelWayAction.ParallelWayLayer temporaryLayer
public ParallelWayAction(MapFrame mapFrame)
ParallelWayAction
.mapFrame
- Map framepublic void enterMode()
MapMode
public void exitMode()
MapMode
public java.lang.String getModeHelpText()
MapMode
getModeHelpText
in class MapMode
public boolean layerIsSupported(Layer l)
MapMode
l
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 MapMode
l
- layertrue
if the layer is supported by this map modepublic void modifiersExChanged(int modifiers)
ModifierExListener
modifiersExChanged
in interface ModifierExListener
modifiers
- The new extended modifiersprivate 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.MouseListener
mousePressed
in class MapMode
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class MapMode
private static void removeWayHighlighting(java.util.Collection<Way> ways)
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class MapMode
private boolean matchesCurrentModifiers(CachingProperty<java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean>> spec)
private boolean matchesCurrentModifiers(java.util.Map<ParallelWayAction.Modifier,java.lang.Boolean> spec)
private 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)