Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r1169 r1302 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; … … 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 … … 40 41 if (mode.equals("conflict")) { 41 42 shortcut = KeyEvent.VK_4; 43 } 44 if (mode.equals("download")) { 45 shortcut = KeyEvent.VK_5; 42 46 } 43 47 … … 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 }
Note:
See TracChangeset
for help on using the changeset viewer.