Index: /trunk/src/org/openstreetmap/josm/gui/MapScaler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapScaler.java	(revision 9953)
+++ /trunk/src/org/openstreetmap/josm/gui/MapScaler.java	(revision 9954)
@@ -9,4 +9,7 @@
 import java.awt.geom.Rectangle2D;
 
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleValue;
 import javax.swing.JComponent;
 
@@ -14,5 +17,9 @@
 import org.openstreetmap.josm.gui.help.Helpful;
 
-public class MapScaler extends JComponent implements Helpful {
+/**
+ * Map scale bar, displaying the distance in meter that correspond to 100 px on screen.
+ * @since 115
+ */
+public class MapScaler extends JComponent implements Helpful, Accessible {
 
     private final NavigatableComponent mv;
@@ -20,4 +27,8 @@
     private static final int PADDING_RIGHT = 100;
 
+    /**
+     * Constructs a new {@code MapScaler}.
+     * @param mv map view
+     */
     public MapScaler(NavigatableComponent mv) {
         this.mv = mv;
@@ -41,4 +52,8 @@
     }
 
+    /**
+     * Returns the color of map scaler.
+     * @return the color of map scaler
+     */
     public static Color getColor() {
         return Main.pref.getColor(marktr("scale"), Color.white);
@@ -49,3 +64,34 @@
         return ht("/MapView/Scaler");
     }
+
+    @Override
+    public AccessibleContext getAccessibleContext() {
+        if (accessibleContext == null) {
+            accessibleContext = new AccessibleMapScaler();
+        }
+        return accessibleContext;
+    }
+
+    class AccessibleMapScaler extends AccessibleJComponent implements AccessibleValue {
+
+        @Override
+        public Number getCurrentAccessibleValue() {
+            return mv.getDist100Pixel();
+        }
+
+        @Override
+        public boolean setCurrentAccessibleValue(Number n) {
+            return false;
+        }
+
+        @Override
+        public Number getMinimumAccessibleValue() {
+            return null;
+        }
+
+        @Override
+        public Number getMaximumAccessibleValue() {
+            return null;
+        }
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 9953)
+++ /trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java	(revision 9954)
@@ -204,5 +204,5 @@
             ScaleList scaleList = nativeScaleLayer.getNativeScales();
             if (scaleList != null) {
-                if ( PROP_ZOOM_INTERMEDIATE_STEPS.get()) {
+                if (PROP_ZOOM_INTERMEDIATE_STEPS.get()) {
                     scaleList = scaleList.withIntermediateSteps(PROP_ZOOM_RATIO.get());
                 }
@@ -323,4 +323,8 @@
     }
 
+    /**
+     * Returns the text describing the distance in meter that correspond to 100 px on screen.
+     * @return the text describing the distance in meter that correspond to 100 px on screen
+     */
     public String getDist100PixelText() {
         return getDistText(getDist100Pixel());
Index: /trunk/src/org/openstreetmap/josm/gui/bbox/SizeButton.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/bbox/SizeButton.java	(revision 9953)
+++ /trunk/src/org/openstreetmap/josm/gui/bbox/SizeButton.java	(revision 9954)
@@ -6,8 +6,10 @@
 import java.awt.Dimension;
 import java.awt.Graphics;
-import java.awt.Point;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 
+import javax.accessibility.Accessible;
+import javax.accessibility.AccessibleAction;
+import javax.accessibility.AccessibleContext;
 import javax.swing.ImageIcon;
 import javax.swing.JComponent;
@@ -16,10 +18,9 @@
 
 /**
+ * Button allowing to control the dimension of a slippy map between two states (normal/enlarged).
  * @author Tim Haussmann
+ * @since 1390
  */
-public class SizeButton extends JComponent {
-
-    private int x;
-    private int y;
+public class SizeButton extends JComponent implements Accessible {
 
     private final ImageIcon enlargeImage;
@@ -28,4 +29,17 @@
     private final SlippyMapBBoxChooser slippyMapBBoxChooser;
 
+    private final transient MouseAdapter mouseAdapter = new MouseAdapter() {
+        @Override
+        public void mouseReleased(MouseEvent e) {
+            if (e.getButton() == MouseEvent.BUTTON1) {
+                toggle();
+            }
+        }
+    };
+
+    /**
+     * Constructs a new {@code SizeButton}.
+     * @param slippyMapBBoxChooser the associated slippy map
+     */
     public SizeButton(SlippyMapBBoxChooser slippyMapBBoxChooser) {
         this.slippyMapBBoxChooser = slippyMapBBoxChooser;
@@ -33,17 +47,7 @@
         shrinkImage = ImageProvider.get("view-fullscreen-revert");
         setPreferredSize(new Dimension(enlargeImage.getIconWidth(), enlargeImage.getIconHeight()));
-        addMouseListener(mouseListener);
+        addMouseListener(mouseAdapter);
         setToolTipText(tr("Enlarge"));
     }
-
-    private final transient MouseAdapter mouseListener = new MouseAdapter() {
-        @Override
-        public void mouseReleased(MouseEvent e) {
-            if (e.getButton() == MouseEvent.BUTTON1) {
-                toggle();
-                slippyMapBBoxChooser.resizeSlippyMap();
-            }
-        }
-    };
 
     @Override
@@ -51,28 +55,53 @@
         if (isEnlarged) {
             if (shrinkImage != null)
-                g.drawImage(shrinkImage.getImage(), x, y, null);
+                g.drawImage(shrinkImage.getImage(), 0, 0, null);
         } else {
             if (enlargeImage != null)
-                g.drawImage(enlargeImage.getImage(), x, y, null);
+                g.drawImage(enlargeImage.getImage(), 0, 0, null);
         }
     }
 
+    /**
+     * Toggles button state.
+     */
     public void toggle() {
         isEnlarged = !isEnlarged;
         setToolTipText(isEnlarged ? tr("Shrink") : tr("Enlarge"));
+        slippyMapBBoxChooser.resizeSlippyMap();
     }
 
+    /**
+     * Determines if the slippy map is enlarged.
+     * @return {@code true} if the slippy map is enlarged, {@code false} otherwise
+     */
     public boolean isEnlarged() {
         return isEnlarged;
     }
 
-    public boolean hit(Point point) {
-        if (x < point.x && point.x < x + enlargeImage.getIconWidth()) {
-            if (y < point.y && point.y < y + enlargeImage.getIconHeight()) {
-                return true;
-            }
+    @Override
+    public AccessibleContext getAccessibleContext() {
+        if (accessibleContext == null) {
+            accessibleContext = new AccessibleSizeButton();
         }
-        return false;
+        return accessibleContext;
     }
 
+    class AccessibleSizeButton extends AccessibleJComponent implements AccessibleAction {
+
+        @Override
+        public int getAccessibleActionCount() {
+            return 1;
+        }
+
+        @Override
+        public String getAccessibleActionDescription(int i) {
+            return "toggle";
+        }
+
+        @Override
+        public boolean doAccessibleAction(int i) {
+            toggle();
+            return true;
+        }
+    }
 }
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 9953)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 9954)
@@ -92,4 +92,6 @@
     private static final char[] DEFAULT_STRIP = {'\u200B', '\uFEFF'};
 
+    private static final String[] SIZE_UNITS = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
+
     /**
      * Tests whether {@code predicate} applies to at least one element from {@code collection}.
@@ -1042,17 +1044,16 @@
             throw new IllegalArgumentException("bytes must be >= 0");
         }
-        final String[] units = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
         int unitIndex = 0;
         double value = bytes;
-        while (value >= 1024 && unitIndex < units.length) {
+        while (value >= 1024 && unitIndex < SIZE_UNITS.length) {
             value /= 1024;
             unitIndex++;
         }
         if (value > 100 || unitIndex == 0) {
-            return String.format(locale, "%.0f %s", value, units[unitIndex]);
+            return String.format(locale, "%.0f %s", value, SIZE_UNITS[unitIndex]);
         } else if (value > 10) {
-            return String.format(locale, "%.1f %s", value, units[unitIndex]);
+            return String.format(locale, "%.1f %s", value, SIZE_UNITS[unitIndex]);
         } else {
-            return String.format(locale, "%.2f %s", value, units[unitIndex]);
+            return String.format(locale, "%.2f %s", value, SIZE_UNITS[unitIndex]);
         }
     }
Index: /trunk/test/unit/org/openstreetmap/josm/TestUtils.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 9953)
+++ /trunk/test/unit/org/openstreetmap/josm/TestUtils.java	(revision 9954)
@@ -474,5 +474,5 @@
             @Override
             public FontRenderContext getFontRenderContext() {
-                return null;
+                return new FontRenderContext(null, false, false);
             }
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 9954)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 9954)
@@ -0,0 +1,45 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
+import java.awt.Color;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.gui.MapScaler.AccessibleMapScaler;
+
+/**
+ * Unit tests of {@link MapScaler} class.
+ */
+public class MapScalerTest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init(true);
+    }
+
+    /**
+     * Unit test of {@link MapScaler#MapScaler}.
+     */
+    @Test
+    public void testMapScaler() {
+        assertEquals(Color.WHITE, MapScaler.getColor());
+        MapScaler ms = new MapScaler(Main.map.mapView);
+        assertEquals("/MapView/Scaler", ms.helpTopic());
+        ms.paint(TestUtils.newGraphics());
+        AccessibleMapScaler ams = (AccessibleMapScaler) ms.getAccessibleContext();
+        assertEquals(1000.0, ams.getCurrentAccessibleValue().doubleValue(), 1e-3);
+        assertFalse(ams.setCurrentAccessibleValue(500));
+        assertNull(ams.getMinimumAccessibleValue());
+        assertNull(ams.getMaximumAccessibleValue());
+    }
+}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java	(revision 9954)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/bbox/SizeButtonTest.java	(revision 9954)
@@ -0,0 +1,42 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.bbox;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.gui.bbox.SizeButton.AccessibleSizeButton;
+
+/**
+ * Unit tests of {@link SizeButton} class.
+ */
+public class SizeButtonTest {
+
+    /**
+     * Setup tests
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init(true);
+    }
+
+    /**
+     * Unit test of {@link SizeButton#SizeButton}.
+     */
+    @Test
+    public void testSizeButton() {
+        SizeButton sb = new SizeButton(new SlippyMapBBoxChooser());
+        sb.paint(TestUtils.newGraphics());
+        AccessibleSizeButton asb = (AccessibleSizeButton) sb.getAccessibleContext();
+        assertEquals(1, asb.getAccessibleActionCount());
+        assertEquals("toggle", asb.getAccessibleActionDescription(0));
+        assertFalse(sb.isEnlarged());
+        assertTrue(asb.doAccessibleAction(0));
+        sb.paint(TestUtils.newGraphics());
+        assertTrue(sb.isEnlarged());
+    }
+}
