Changeset 19048 in josm for trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
- Timestamp:
- 2024-04-19T16:21:11+02:00 (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r18211 r19048 8 8 import java.awt.event.ActionEvent; 9 9 import java.awt.event.KeyEvent; 10 import java.awt.geom.Area;11 10 import java.util.ArrayList; 12 11 import java.util.Collection; … … 23 22 import org.openstreetmap.josm.data.DataSource; 24 23 import org.openstreetmap.josm.data.conflict.Conflict; 25 import org.openstreetmap.josm.data.osm.DataSet;26 24 import org.openstreetmap.josm.data.osm.IPrimitive; 27 25 import org.openstreetmap.josm.data.osm.OsmData; … … 34 32 import org.openstreetmap.josm.gui.MapView; 35 33 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 36 import org.openstreetmap.josm.gui.dialogs.ConflictDialog;37 34 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 38 35 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog.ValidatorBoundingXYVisitor; … … 146 143 */ 147 144 public static void zoomTo(Collection<? extends IPrimitive> sel) { 148 BoundingXYVisitor bboxCalculator = new BoundingXYVisitor();145 final var bboxCalculator = new BoundingXYVisitor(); 149 146 bboxCalculator.computeBoundingBox(sel); 150 147 if (bboxCalculator.getBounds() != null) { … … 244 241 public void autoScale() { 245 242 if (MainApplication.isDisplayingMapView()) { 246 MapViewmapView = MainApplication.getMap().mapView;243 final var mapView = MainApplication.getMap().mapView; 247 244 switch (mode) { 248 245 case PREVIOUS: … … 312 309 private void modeLayer(BoundingXYVisitor v) { 313 310 // try to zoom to the first selected layer 314 Layer l = getFirstSelectedLayer();311 final var l = getFirstSelectedLayer(); 315 312 if (l == null) 316 313 return; … … 327 324 } 328 325 } else { 329 ConflictDialogconflictDialog = MainApplication.getMap().conflictDialog;326 final var conflictDialog = MainApplication.getMap().conflictDialog; 330 327 Conflict<? extends IPrimitive> c = conflictDialog.getSelectedConflict(); 331 328 if (c != null) { … … 359 356 } 360 357 Bounds bbox = null; 361 final DataSetdataset = getLayerManager().getActiveDataSet();358 final var dataset = getLayerManager().getActiveDataSet(); 362 359 if (dataset != null) { 363 360 List<DataSource> dataSources = new ArrayList<>(dataset.getDataSources()); … … 372 369 } else { 373 370 lastZoomArea = -1; 374 AreasourceArea = getLayerManager().getActiveDataSet().getDataSourceArea();371 final var sourceArea = getLayerManager().getActiveDataSet().getDataSourceArea(); 375 372 if (sourceArea != null) { 376 373 bbox = new Bounds(sourceArea.getBounds2D()); … … 439 436 * Adapter for zoom change events 440 437 */ 441 private class ZoomChangeAdapter implements ZoomChangeListener {438 private final class ZoomChangeAdapter implements ZoomChangeListener { 442 439 @Override 443 440 public void zoomChanged() {
Note:
See TracChangeset
for help on using the changeset viewer.