Ignore:
Timestamp:
2015-10-18T23:16:54+02:00 (4 years ago)
Author:
Don-vip
Message:

fix #11986, fix #11987, fix #11988: Patches by michael2402:

  • MapStatus: Use a BlockingQueue for cleaner waiting
  • Comment in AutoScaleAction#zoomTo is wrong
  • Documentation for AutoScaleAction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r8846 r8900  
    4343public class AutoScaleAction extends JosmAction {
    4444
     45    /**
     46     * A list of things we can zoom to. The zoom target is given depending on the mode.
     47     */
    4548    public static final Collection<String> MODES = Collections.unmodifiableList(Arrays.asList(
    4649        marktr(/* ICON(dialogs/autoscale/) */ "data"),
     
    5356        marktr(/* ICON(dialogs/autoscale/) */ "next")));
    5457
     58    /**
     59     * One of {@link #MODES}. Defines what we are zooming to.
     60     */
    5561    private final String mode;
    5662
     
    8389    }
    8490
     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     */
    8595    public static void zoomTo(Collection<OsmPrimitive> sel) {
    8696        BoundingXYVisitor bboxCalculator = new BoundingXYVisitor();
    8797        bboxCalculator.computeBoundingBox(sel);
    88         // increase bbox by 0.001 degrees on each side. this is required
     98        // increase bbox. This is required
    8999        // especially if the bbox contains one single node, but helpful
    90100        // in most other cases as well.
     
    95105    }
    96106
     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     */
    97111    public static void autoScale(String mode) {
    98112        new AutoScaleAction(mode, false).autoScale();
     
    172186    }
    173187
     188    /**
     189     * Performs this auto scale operation for the mode this action is in.
     190     */
    174191    public void autoScale() {
    175192        if (Main.isDisplayingMapView()) {
Note: See TracChangeset for help on using the changeset viewer.