Ticket #3910: lassoOnS-5389.patch
File lassoOnS-5389.patch, 3.1 KB (added by , 12 years ago) |
---|
-
src/org/openstreetmap/josm/gui/MapFrame.java
112 112 public final SelectAction mapModeSelect; 113 113 private final MapMode mapModeDraw; 114 114 private final MapMode mapModeZoom; 115 public final MapMode mapModeLassoSelect; 115 116 116 117 /** 117 118 * The panel list of all toggle dialog icons. To add new toggle dialog actions, use addToggleDialog … … 159 160 // toolbar 160 161 toolBarActions.setFloatable(false); 161 162 addMapMode(new IconToggleButton(mapModeSelect = new SelectAction(this))); 162 addMapMode(new IconToggleButton( new LassoModeAction(), true));163 addMapMode(new IconToggleButton(mapModeLassoSelect = new LassoModeAction(), true)); 163 164 addMapMode(new IconToggleButton(mapModeDraw = new DrawAction(this))); 164 165 addMapMode(new IconToggleButton(mapModeZoom = new ZoomAction(this))); 165 166 addMapMode(new IconToggleButton(new DeleteAction(this), true)); … … 361 362 return false; 362 363 363 364 MapMode oldMapMode = this.mapMode; 364 if (newMapMode == oldMapMode) 365 if (newMapMode == oldMapMode) { 366 newMapMode.reenterMode(); 365 367 return true; 368 } 366 369 if (oldMapMode != null) { 367 370 oldMapMode.exitMode(); 368 371 } -
src/org/openstreetmap/josm/actions/LassoModeAction.java
31 31 Main.map.mapModeSelect.exitMode(); 32 32 super.exitMode(); 33 33 } 34 35 @Override 36 public void reenterMode() { 37 if (Main.map!=null) Main.map.selectMapMode(Main.map.mapModeSelect); 38 } 34 39 } -
src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
195 195 removeHighlighting(); 196 196 } 197 197 198 @Override 199 public void reenterMode() { 200 if (Main.map!=null) Main.map.selectMapMode(Main.map.mapModeLassoSelect); 201 } 202 198 203 /** 199 204 * This is called whenever the keyboard modifier status changes 200 205 */ -
src/org/openstreetmap/josm/actions/mapmode/MapMode.java
58 58 Main.map.mapView.resetCursor(this); 59 59 } 60 60 61 /** 62 * For optionlal overloading - called when action is repeated while mapmode is already active 63 */ 64 public void reenterMode() { 65 } 66 61 67 protected void updateStatusLine() { 62 68 Main.map.statusLine.setHelpText(getModeHelpText()); 63 69 Main.map.statusLine.repaint();