public class ParallelWayAction extends MapMode implements ModifierListener, MapViewPaintable, Preferences.PreferenceChangedListener
Modifier and Type | Class and Description |
---|---|
private static class |
ParallelWayAction.Mode |
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
ParallelWayAction(MapFrame mapFrame) |
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.
|
String |
getModeHelpText() |
private String |
getStringPref(String subKey,
String def) |
private boolean |
initParallelWays(Point p,
boolean copyTags) |
private boolean |
isModifiersValidForDragMode() |
boolean |
layerIsSupported(Layer layer) |
private boolean |
matchesCurrentModifiers(ModifiersSpec spec) |
void |
modifiersChanged(int modifiers) |
void |
mouseDragged(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
paint(Graphics2D g,
MapView mv,
Bounds bbox)
Paint the dataset using the engine set.
|
void |
preferenceChanged(Preferences.PreferenceChangeEvent e) |
private String |
prefKey(String subKey) |
private void |
removeSourceWay(Way w) |
private void |
removeWayHighlighting(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, requestFocusInMapView, updateKeyModifiers, updateKeyModifiers, updateKeyModifiers, updateStatusLine
getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState, updateEnabledState
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
private 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 ModifiersSpec snapModifierCombo
private ModifiersSpec copyTagsModifierCombo
private ModifiersSpec addToSelectionModifierCombo
private ModifiersSpec toggleSelectedModifierCombo
private ModifiersSpec setSelectedModifierCombo
private int initialMoveDelay
private Point mousePressedPos
private boolean mouseIsDown
private long mousePressedTime
private boolean mouseHasBeenDragged
private WaySegment referenceSegment
private ParallelWays pWays
private Set<Way> sourceWays
private EastNorth helperLineStart
private EastNorth helperLineEnd
Stroke helpLineStroke
Stroke refLineStroke
public ParallelWayAction(MapFrame mapFrame)
public void enterMode()
MapMode
public void exitMode()
MapMode
public String getModeHelpText()
getModeHelpText
in class MapMode
private void updateAllPreferences()
private void updateModeLocalPreferences()
public boolean layerIsSupported(Layer layer)
layerIsSupported
in class MapMode
public void modifiersChanged(int modifiers)
modifiersChanged
in interface ModifierListener
private boolean updateModifiersState(int modifiers)
private void updateCursor()
private void setMode(ParallelWayAction.Mode mode)
private boolean sanityCheck()
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class MapMode
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class MapMode
private void removeWayHighlighting(Collection<Way> ways)
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class MapMode
private boolean matchesCurrentModifiers(ModifiersSpec spec)
public void paint(Graphics2D g, MapView mv, Bounds bbox)
MapViewPaintable
paint
in interface MapViewPaintable
mv
- The object that can translate GeoPoints to screen coordinates.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(Point p, boolean copyTags)
private String getStringPref(String subKey, String def)
public void preferenceChanged(Preferences.PreferenceChangeEvent e)
preferenceChanged
in interface Preferences.PreferenceChangedListener
public void destroy()
Destroyable
destroy
in interface Destroyable
destroy
in class JosmAction