Changeset 12630 in josm for trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.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/AutoScaleAction.java
r12620 r12630 29 29 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 30 30 import org.openstreetmap.josm.data.validation.TestError; 31 import org.openstreetmap.josm.gui.MainApplication; 31 32 import org.openstreetmap.josm.gui.MapFrame; 32 33 import org.openstreetmap.josm.gui.MapFrameListener; 33 34 import org.openstreetmap.josm.gui.MapView; 35 import org.openstreetmap.josm.gui.dialogs.ConflictDialog; 34 36 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 35 37 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog.ValidatorBoundingXYVisitor; … … 102 104 bboxCalculator.enlargeBoundingBox(); 103 105 if (bboxCalculator.getBounds() != null) { 104 Main .map.mapView.zoomTo(bboxCalculator);106 MainApplication.getMap().mapView.zoomTo(bboxCalculator); 105 107 } 106 108 } … … 191 193 */ 192 194 public void autoScale() { 193 if (Main.isDisplayingMapView()) { 195 if (MainApplication.isDisplayingMapView()) { 196 MapView mapView = MainApplication.getMap().mapView; 194 197 switch (mode) { 195 198 case "previous": 196 Main.map.mapView.zoomPrevious();199 mapView.zoomPrevious(); 197 200 break; 198 201 case "next": 199 Main.map.mapView.zoomNext();202 mapView.zoomNext(); 200 203 break; 201 204 default: 202 205 BoundingXYVisitor bbox = getBoundingBox(); 203 206 if (bbox != null && bbox.getBounds() != null) { 204 Main.map.mapView.zoomTo(bbox);207 mapView.zoomTo(bbox); 205 208 } 206 209 } … … 254 257 255 258 private static BoundingXYVisitor modeProblem(ValidatorBoundingXYVisitor v) { 256 TestError error = Main .map.validatorDialog.getSelectedError();259 TestError error = MainApplication.getMap().validatorDialog.getSelectedError(); 257 260 if (error == null) 258 261 return null; … … 288 291 } 289 292 } else { 290 Conflict<? extends OsmPrimitive> c = Main.map.conflictDialog.getSelectedConflict(); 293 ConflictDialog conflictDialog = MainApplication.getMap().conflictDialog; 294 Conflict<? extends OsmPrimitive> c = conflictDialog.getSelectedConflict(); 291 295 if (c != null) { 292 296 sel.add(c.getMy()); 293 } else if ( Main.map.conflictDialog.getConflicts() != null) {294 sel = Main.map.conflictDialog.getConflicts().getMyConflictParties();297 } else if (conflictDialog.getConflicts() != null) { 298 sel = conflictDialog.getConflicts().getMyConflictParties(); 295 299 } 296 300 } … … 350 354 protected void updateEnabledState() { 351 355 DataSet ds = getLayerManager().getEditDataSet(); 356 MapFrame map = MainApplication.getMap(); 352 357 switch (mode) { 353 358 case "selection": … … 358 363 break; 359 364 case "conflict": 360 setEnabled( Main.map != null && Main.map.conflictDialog.getSelectedConflict() != null);365 setEnabled(map != null && map.conflictDialog.getSelectedConflict() != null); 361 366 break; 362 367 case "download": … … 364 369 break; 365 370 case "problem": 366 setEnabled( Main.map != null && Main.map.validatorDialog.getSelectedError() != null);371 setEnabled(map != null && map.validatorDialog.getSelectedError() != null); 367 372 break; 368 373 case "previous": 369 setEnabled(Main .isDisplayingMapView() && Main.map.mapView.hasZoomUndoEntries());374 setEnabled(MainApplication.isDisplayingMapView() && map.mapView.hasZoomUndoEntries()); 370 375 break; 371 376 case "next": 372 setEnabled(Main .isDisplayingMapView() && Main.map.mapView.hasZoomRedoEntries());377 setEnabled(MainApplication.isDisplayingMapView() && map.mapView.hasZoomRedoEntries()); 373 378 break; 374 379 default:
Note:
See TracChangeset
for help on using the changeset viewer.