Changeset 2758 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2010-01-07T18:20:47+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r2711 r2758 28 28 public class AutoScaleAction extends JosmAction { 29 29 30 public static final String[] MODES = { marktr("data"), marktr("layer"), marktr("selection"), marktr("conflict"), marktr("download") }; 30 public static final String[] MODES = { 31 marktr("data"), 32 marktr("layer"), 33 marktr("selection"), 34 marktr("conflict"), 35 marktr("download"), 36 marktr("previous"), 37 marktr("next")}; 31 38 32 39 /** … … 81 88 shortcut = KeyEvent.VK_5; 82 89 } 90 if (mode.equals("previous")) { 91 shortcut = KeyEvent.VK_8; 92 } 93 if (mode.equals("next")) { 94 shortcut = KeyEvent.VK_9; 95 } 83 96 84 97 return shortcut; … … 99 112 } else if (mode.equals("conflict")) { 100 113 putValue("help", ht("/Action/ZoomToConflict")); 101 } else if (mode.equals("download")) {114 } else if (mode.equals("download")) { 102 115 putValue("help", ht("/Action/ZoomToDownload")); 116 } else if (mode.equals("previous")) { 117 putValue("help", ht("/Action/ZoomPrevious")); 118 } else if (mode.equals("next")) { 119 putValue("help", ht("/Action/ZoomNext")); 103 120 } 104 121 } … … 106 123 public void autoScale() { 107 124 if (Main.map != null) { 108 BoundingXYVisitor bbox = getBoundingBox(); 109 if (bbox != null && bbox.getBounds() != null) { 110 Main.map.mapView.recalculateCenterScale(bbox); 125 if (mode.equals("previous")) { 126 Main.map.mapView.zoomPrevious(); 127 } else if (mode.equals("next")) { 128 Main.map.mapView.zoomNext(); 129 } else { 130 BoundingXYVisitor bbox = getBoundingBox(); 131 if (bbox != null && bbox.getBounds() != null) { 132 Main.map.mapView.recalculateCenterScale(bbox); 133 } 111 134 } 112 135 }
Note:
See TracChangeset
for help on using the changeset viewer.