Changeset 8900 in josm for trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
- Timestamp:
- 2015-10-18T23:16:54+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r8846 r8900 43 43 public class AutoScaleAction extends JosmAction { 44 44 45 /** 46 * A list of things we can zoom to. The zoom target is given depending on the mode. 47 */ 45 48 public static final Collection<String> MODES = Collections.unmodifiableList(Arrays.asList( 46 49 marktr(/* ICON(dialogs/autoscale/) */ "data"), … … 53 56 marktr(/* ICON(dialogs/autoscale/) */ "next"))); 54 57 58 /** 59 * One of {@link #MODES}. Defines what we are zooming to. 60 */ 55 61 private final String mode; 56 62 … … 83 89 } 84 90 91 /** 92 * Zooms the view to display the given set of primitives. 93 * @param sel The primitives to zoom to, e.g. the current selection. 94 */ 85 95 public static void zoomTo(Collection<OsmPrimitive> sel) { 86 96 BoundingXYVisitor bboxCalculator = new BoundingXYVisitor(); 87 97 bboxCalculator.computeBoundingBox(sel); 88 // increase bbox by 0.001 degrees on each side. this is required98 // increase bbox. This is required 89 99 // especially if the bbox contains one single node, but helpful 90 100 // in most other cases as well. … … 95 105 } 96 106 107 /** 108 * Performs the auto scale operation of the given mode without the need to create a new action. 109 * @param mode One of {@link #MODES}. 110 */ 97 111 public static void autoScale(String mode) { 98 112 new AutoScaleAction(mode, false).autoScale(); … … 172 186 } 173 187 188 /** 189 * Performs this auto scale operation for the mode this action is in. 190 */ 174 191 public void autoScale() { 175 192 if (Main.isDisplayingMapView()) {
Note:
See TracChangeset
for help on using the changeset viewer.
