Ticket #19887: 19887.2.patch
File 19887.2.patch, 2.5 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
163 163 // super.enterMode() updates the status line and cursor so we need our state to be set correctly 164 164 setMode(Mode.NORMAL); 165 165 pWays = null; 166 166 MainApplication.getMap().statusLine.setAutoLength(false); 167 167 super.enterMode(); 168 168 169 169 mv.addMouseListener(this); … … 186 186 mv.removeTemporaryLayer(temporaryLayer); 187 187 MapFrame map = MainApplication.getMap(); 188 188 map.statusLine.setDist(-1); 189 map.statusLine. repaint();189 map.statusLine.setAutoLength(true); 190 190 map.keyDetector.removeModifierExListener(this); 191 191 removeWayHighlighting(sourceWays); 192 192 pWays = null; … … 331 331 } // else -> invalid modifier combination 332 332 } else if (mode == Mode.DRAGGING) { 333 333 clearSourceWays(); 334 MainApplication.getMap().statusLine.setDist(pWays.getWays()); 334 335 } 335 336 336 337 setMode(Mode.NORMAL); -
src/org/openstreetmap/josm/gui/MapStatus.java
762 762 } 763 763 }; 764 764 765 /** see #19887: determine if the {@code distValue} field should be filled with length of selected object */ 766 private boolean autoLength = true; 767 765 768 private void registerListeners() { 766 769 // Listen to keyboard/mouse events for pressing/releasing alt key and inform the collector. 767 770 try { … … 1185 1188 } 1186 1189 1187 1190 private void refreshDistText(Collection<? extends OsmPrimitive> newSelection) { 1191 if (!autoLength) { 1192 return; 1193 } 1194 1188 1195 if (newSelection.size() == 2) { 1189 1196 Iterator<? extends OsmPrimitive> it = newSelection.iterator(); 1190 1197 OsmPrimitive n1 = it.next(); … … 1263 1270 refreshDistText(event.getDataset().getSelected()); 1264 1271 } 1265 1272 } 1273 1274 /** 1275 * Enable or disable the automatic refresh of the length field. 1276 * @param b if {@code true} the automatic refresh is enabled, else disabled 1277 * @since xxx 1278 */ 1279 public void setAutoLength(boolean b) { 1280 autoLength = b; 1281 } 1282 1283 1266 1284 }