Changeset 12630 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
- Timestamp:
- 2017-08-24T00:15:51+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r12620 r12630 40 40 import org.openstreetmap.josm.data.osm.visitor.paint.WireframeMapRenderer; 41 41 import org.openstreetmap.josm.gui.ExtendedDialog; 42 import org.openstreetmap.josm.gui.MainApplication; 42 43 import org.openstreetmap.josm.gui.MapFrame; 43 44 import org.openstreetmap.josm.gui.MapView; … … 209 210 virtualManager.init(); 210 211 // This is required to update the cursors when ctrl/shift/alt is pressed 211 Main.map.keyDetector.addModifierExListener(this); 212 Main.map.keyDetector.addKeyListener(this); 212 MapFrame map = MainApplication.getMap(); 213 map.keyDetector.addModifierExListener(this); 214 map.keyDetector.addKeyListener(this); 213 215 } 214 216 … … 220 222 mv.removeMouseMotionListener(this); 221 223 mv.setVirtualNodesEnabled(false); 222 Main.map.keyDetector.removeModifierExListener(this); 223 Main.map.keyDetector.removeKeyListener(this); 224 MapFrame map = MainApplication.getMap(); 225 map.keyDetector.removeModifierExListener(this); 226 map.keyDetector.removeKeyListener(this); 224 227 removeHighlighting(); 225 228 } … … 227 230 @Override 228 231 public void modifiersExChanged(int modifiers) { 229 if (!Main .isDisplayingMapView() || oldEvent == null) return;232 if (!MainApplication.isDisplayingMapView() || oldEvent == null) return; 230 233 if (giveUserFeedback(oldEvent, modifiers)) { 231 234 mv.repaint(); … … 568 571 startingDraggingPos = null; 569 572 mouseReleaseTime = System.currentTimeMillis(); 573 MapFrame map = MainApplication.getMap(); 570 574 571 575 if (mode == Mode.SELECT) { … … 578 582 // Select Draw Tool if no selection has been made 579 583 if (!cancelDrawMode && getLayerManager().getEditDataSet().selectionEmpty()) { 580 Main.map.selectDrawTool(true);584 map.selectDrawTool(true); 581 585 updateStatusLine(); 582 586 return; … … 599 603 // We need to do it like this as otherwise drawAction will see a double 600 604 // click and switch back to SelectMode 601 Main.worker.execute(() -> Main.map.selectDrawTool(true));605 Main.worker.execute(() -> map.selectDrawTool(true)); 602 606 return; 603 607 } … … 630 634 @Override 631 635 public void doKeyPressed(KeyEvent e) { 632 if (!repeatedKeySwitchLassoOption || !Main .isDisplayingMapView() || !getShortcut().isEvent(e))636 if (!repeatedKeySwitchLassoOption || !MainApplication.isDisplayingMapView() || !getShortcut().isEvent(e)) 633 637 return; 634 638 if (Logging.isDebugEnabled()) { … … 636 640 } 637 641 e.consume(); 642 MapFrame map = MainApplication.getMap(); 638 643 if (!lassoMode) { 639 Main.map.selectMapMode(Main.map.mapModeSelectLasso);644 map.selectMapMode(map.mapModeSelectLasso); 640 645 } else { 641 Main.map.selectMapMode(Main.map.mapModeSelect);646 map.selectMapMode(map.mapModeSelect); 642 647 } 643 648 } … … 751 756 Collection<Way> ways = ds.getSelectedWays(); 752 757 if (doesImpactStatusLine(affectedNodes, ways)) { 753 Main .map.statusLine.setDist(ways);758 MainApplication.getMap().statusLine.setDist(ways); 754 759 } 755 760 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.