From c2704616c3409889695d3e12c2fb419257125dec Mon Sep 17 00:00:00 2001
From: Michael Zangl <michael.zangl@student.kit.edu>
Date: Sat, 17 Oct 2015 18:25:25 +0200
Subject: [PATCH 4/4] Added documentation to AutoScaleAction

---
 .../josm/actions/AutoScaleAction.java              |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/org/openstreetmap/josm/actions/AutoScaleAction.java b/src/org/openstreetmap/josm/actions/AutoScaleAction.java
index 7cfdc0d..4876708 100644
--- a/src/org/openstreetmap/josm/actions/AutoScaleAction.java
+++ b/src/org/openstreetmap/josm/actions/AutoScaleAction.java
@@ -42,6 +42,9 @@ import org.openstreetmap.josm.tools.Shortcut;
  */
 public class AutoScaleAction extends JosmAction {
 
+    /**
+     * A list of things we can zoom to. The zoom target is given depending on the mode.
+     */
     public static final Collection<String> MODES = Collections.unmodifiableList(Arrays.asList(
         marktr(/* ICON(dialogs/autoscale/) */ "data"),
         marktr(/* ICON(dialogs/autoscale/) */ "layer"),
@@ -52,6 +55,9 @@ public class AutoScaleAction extends JosmAction {
         marktr(/* ICON(dialogs/autoscale/) */ "previous"),
         marktr(/* ICON(dialogs/autoscale/) */ "next")));
 
+    /**
+     * One of {@link #MODES}. Defines what we are zooming to.
+     */
     private final String mode;
 
     protected transient ZoomChangeAdapter zoomChangeAdapter;
@@ -82,6 +88,10 @@ public class AutoScaleAction extends JosmAction {
         zoomTo(sel);
     }
 
+    /**
+     * Zooms the view to display the given set of primitives.
+     * @param sel The primitives to zoom to, e.g. the current selection.
+     */
     public static void zoomTo(Collection<OsmPrimitive> sel) {
         BoundingXYVisitor bboxCalculator = new BoundingXYVisitor();
         bboxCalculator.computeBoundingBox(sel);
@@ -94,6 +104,10 @@ public class AutoScaleAction extends JosmAction {
         }
     }
 
+    /**
+     * Performs the auto scale operation of the given mode without the need to create a new action.
+     * @param mode One of {@link #MODES}.
+     */
     public static void autoScale(String mode) {
         new AutoScaleAction(mode, false).autoScale();
     }
@@ -171,6 +185,9 @@ public class AutoScaleAction extends JosmAction {
         installAdapters();
     }
 
+    /**
+     * Performs this auto scale operation for the mode this action is in.
+     */
     public void autoScale() {
         if (Main.isDisplayingMapView()) {
             switch (mode) {
-- 
1.7.9.5

