Changeset 403 in josm
- Timestamp:
- 2007-10-19T01:10:58+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r298 r403 7 7 import java.awt.event.ActionEvent; 8 8 import java.util.Collection; 9 10 import javax.swing.JOptionPane; 9 11 10 12 import org.openstreetmap.josm.Main; … … 37 39 38 40 public void actionPerformed(ActionEvent e) { 39 if (Main.map != null) 40 Main.map.mapView.recalculateCenterScale(getBoundingBox()); 41 if (Main.map != null) { 42 BoundingXYVisitor bbox = getBoundingBox(); 43 if (bbox != null) { 44 Main.map.mapView.recalculateCenterScale(bbox); 45 } 46 } 41 47 putValue("active", true); 42 48 } … … 51 57 else if (mode.equals("selection") || mode.equals("conflict")) { 52 58 Collection<OsmPrimitive> sel = mode.equals("selection") ? Main.ds.getSelected() : Main.map.conflictDialog.conflicts.keySet(); 59 if (sel.isEmpty()) { 60 JOptionPane.showMessageDialog(Main.parent, 61 mode.equals("selection") ? tr("Nothing selected to zoom to.") : tr("No conflicts to zoom to")); 62 return null; 63 } 53 64 for (OsmPrimitive osm : sel) 54 65 osm.visit(v);
Note:
See TracChangeset
for help on using the changeset viewer.