diff -ur --exclude='*.svn*' josm/src/org/openstreetmap/josm/actions/AutoScaleAction.java josm dev/src/org/openstreetmap/josm/actions/AutoScaleAction.java
|
old
|
new
|
|
| 11 | 11 | import javax.swing.JOptionPane; |
| 12 | 12 | |
| 13 | 13 | import org.openstreetmap.josm.Main; |
| | 14 | import org.openstreetmap.josm.data.coor.LatLon; |
| 14 | 15 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
| 15 | 16 | import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; |
| 16 | 17 | import org.openstreetmap.josm.gui.layer.Layer; |
| … |
… |
|
| 22 | 23 | */ |
| 23 | 24 | public class AutoScaleAction extends JosmAction { |
| 24 | 25 | |
| 25 | | public static final String[] modes = { marktr("data"), marktr("layer"), marktr("selection"), marktr("conflict") }; |
| | 26 | public static final String[] modes = { marktr("data"), marktr("layer"), marktr("selection"), marktr("conflict"), marktr("download") }; |
| 26 | 27 | private final String mode; |
| 27 | 28 | |
| 28 | 29 | private static int getModeShortcut(String mode) { |
| … |
… |
|
| 40 | 41 | if (mode.equals("conflict")) { |
| 41 | 42 | shortcut = KeyEvent.VK_4; |
| 42 | 43 | } |
| | 44 | if (mode.equals("download")) { |
| | 45 | shortcut = KeyEvent.VK_5; |
| | 46 | } |
| 43 | 47 | |
| 44 | 48 | return shortcut; |
| 45 | 49 | } |
| … |
… |
|
| 84 | 88 | // in most other cases as well. |
| 85 | 89 | v.enlargeBoundingBox(); |
| 86 | 90 | } |
| | 91 | else if (mode.equals("download")) { |
| | 92 | if (Main.pref.hasKey("osm-download.bounds")) { |
| | 93 | try { |
| | 94 | String bounds[] = Main.pref.get("osm-download.bounds").split(";"); |
| | 95 | double minlat = Double.parseDouble(bounds[0]); |
| | 96 | double minlon = Double.parseDouble(bounds[1]); |
| | 97 | double maxlat = Double.parseDouble(bounds[2]); |
| | 98 | double maxlon = Double.parseDouble(bounds[3]); |
| | 99 | |
| | 100 | v.visit(Main.proj.latlon2eastNorth(new LatLon(minlat, minlon))); |
| | 101 | v.visit(Main.proj.latlon2eastNorth(new LatLon(maxlat, maxlon))); |
| | 102 | } |
| | 103 | catch (Exception e) { |
| | 104 | e.printStackTrace(); |
| | 105 | } |
| | 106 | } |
| | 107 | } |
| 87 | 108 | return v; |
| 88 | 109 | } |
| 89 | 110 | } |