Index: trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 14120)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
 import org.openstreetmap.josm.data.preferences.JosmUrls;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -126,5 +127,5 @@
 
         // init projection
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
 
         // setup projection grid files
Index: trunk/test/unit/org/openstreetmap/josm/MainTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 14120)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.Main.InitStatusListener;
 import org.openstreetmap.josm.Main.InitializationTask;
+import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
 import org.openstreetmap.josm.io.OnlineResource;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -38,5 +39,5 @@
     public void testPreConstructorInit() {
         Main.preConstructorInit();
-        assertNotNull(Main.getProjection());
+        assertNotNull(CoordinateFormatManager.getDefaultFormat());
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/command/MoveCommandTest.java	(revision 14120)
@@ -15,5 +15,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.command.CommandTest.CommandTestDataWithRelation;
@@ -24,4 +23,5 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.User;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -57,5 +57,5 @@
     public void testConstructors() {
         EastNorth offset = new EastNorth(1, 2);
-        LatLon destLatLon = Main.getProjection().eastNorth2latlon(offset);
+        LatLon destLatLon = ProjectionRegistry.getProjection().eastNorth2latlon(offset);
         EastNorth start = new EastNorth(2, 0);
 
Index: trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/gpx/GpxDataTest.java	(revision 14120)
@@ -20,5 +20,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -28,4 +27,5 @@
 import org.openstreetmap.josm.data.gpx.GpxData.GpxDataChangeEvent;
 import org.openstreetmap.josm.data.gpx.GpxData.GpxDataChangeListener;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.ListenerList;
@@ -327,5 +327,5 @@
         List<WayPoint> points = Stream
                 .of(new EastNorth(10, 10), new EastNorth(10, 0), new EastNorth(-1, 0))
-                .map(Main.getProjection()::eastNorth2latlon)
+                .map(ProjectionRegistry.getProjection()::eastNorth2latlon)
                 .map(WayPoint::new)
                 .collect(Collectors.toList());
@@ -336,10 +336,10 @@
 
         WayPoint close = data.nearestPointOnTrack(new EastNorth(5, 5), 10);
-        assertEquals(10, close.getEastNorth(Main.getProjection()).east(), .01);
-        assertEquals(5, close.getEastNorth(Main.getProjection()).north(), .01);
+        assertEquals(10, close.getEastNorth(ProjectionRegistry.getProjection()).east(), .01);
+        assertEquals(5, close.getEastNorth(ProjectionRegistry.getProjection()).north(), .01);
 
         close = data.nearestPointOnTrack(new EastNorth(15, 5), 10);
-        assertEquals(10, close.getEastNorth(Main.getProjection()).east(), .01);
-        assertEquals(5, close.getEastNorth(Main.getProjection()).north(), .01);
+        assertEquals(10, close.getEastNorth(ProjectionRegistry.getProjection()).east(), .01);
+        assertEquals(5, close.getEastNorth(ProjectionRegistry.getProjection()).north(), .01);
 
         assertNull(data.nearestPointOnTrack(new EastNorth(5, 5), 1));
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSourceTest.java	(revision 14120)
@@ -10,5 +10,4 @@
 import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -16,4 +15,5 @@
 import org.openstreetmap.josm.data.projection.CustomProjection;
 import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -42,5 +42,5 @@
     public void testEPSG3857() {
         Projection projection = Projections.getProjectionByCode("EPSG:3857");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = new TemplatedWMSTileSource(testImageryWMS, projection);
         verifyMercatorTile(source, 0, 0, 1);
@@ -67,5 +67,5 @@
     public void testEPSG4326() {
         Projection projection = Projections.getProjectionByCode("EPSG:4326");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -83,5 +83,5 @@
     public void testEPSG4326widebounds() {
         Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=-180,53,180,54");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -96,5 +96,5 @@
     public void testEPSG4326narrowbounds() {
         Projection projection = new CustomProjection("+proj=lonlat +datum=WGS84 +axis=neu +bounds=18,-90,20,90");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -109,5 +109,5 @@
     public void testEPSG2180() {
         Projection projection = Projections.getProjectionByCode("EPSG:2180");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -128,5 +128,5 @@
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
                         + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006 +bounds=10.5700,55.2000,24.1800,69.1000 ");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -144,5 +144,5 @@
                 new CustomProjection("+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 "
                         + "+units=m +no_defs +axis=neu +wmssrs=EPSG:3006");
-        Main.setProjection(projection);
+        ProjectionRegistry.setProjection(projection);
         TemplatedWMSTileSource source = getSource(projection);
 
@@ -174,7 +174,8 @@
 
     private void verifyLocation(TemplatedWMSTileSource source, LatLon location, int z) {
+        Projection projection = ProjectionRegistry.getProjection();
         assertTrue(
                 "Point outside world bounds",
-                Main.getProjection().getWorldBoundsLatLon().contains(location)
+                projection.getWorldBoundsLatLon().contains(location)
                 );
 
@@ -187,7 +188,7 @@
                 tileIndex.getYIndex() <= source.getTileYMax(z));
 
-        EastNorth locationEN = Main.getProjection().latlon2eastNorth(location);
-        EastNorth x1 = Main.getProjection().latlon2eastNorth(getTileLatLon(source, tileIndex, z));
-        EastNorth x2 = Main.getProjection().latlon2eastNorth(getTileLatLon(source, tileIndex.getXIndex() + 1, tileIndex.getYIndex() + 1, z));
+        EastNorth locationEN = projection.latlon2eastNorth(location);
+        EastNorth x1 = projection.latlon2eastNorth(getTileLatLon(source, tileIndex, z));
+        EastNorth x2 = projection.latlon2eastNorth(getTileLatLon(source, tileIndex.getXIndex() + 1, tileIndex.getYIndex() + 1, z));
         // test that location is within tile bounds
         assertTrue(locationEN.toString() + " not within " + bboxStr(x1, x2) +
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 14120)
@@ -11,7 +11,7 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -78,5 +78,5 @@
         ImageryInfo wmsImageryInfo = ImageryLayerInfo.instance.getDefaultLayers().get(0);
         assertEquals("single_node_in_way", wmsImageryInfo.getDefaultLayers().get(0).getLayerName());
-        WMSEndpointTileSource tileSource = new WMSEndpointTileSource(wmsImageryInfo, Main.getProjection());
+        WMSEndpointTileSource tileSource = new WMSEndpointTileSource(wmsImageryInfo, ProjectionRegistry.getProjection());
         tileSource.initProjection(Projections.getProjectionByCode("EPSG:3857"));
         assertEquals("https://tools.geofabrik.de/osmi/views/geometry/wxs?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&"
@@ -122,5 +122,5 @@
         ImageryInfo wmsImageryInfo = ImageryLayerInfo.instance.getDefaultLayers().get(0);
         wmsImageryInfo.setDefaultLayers(Arrays.asList(new DefaultLayer(ImageryType.WMS_ENDPOINT, "historiske-ortofoto", "", "")));
-        WMSEndpointTileSource tileSource = new WMSEndpointTileSource(wmsImageryInfo, Main.getProjection());
+        WMSEndpointTileSource tileSource = new WMSEndpointTileSource(wmsImageryInfo, ProjectionRegistry.getProjection());
         tileSource.initProjection(Projections.getProjectionByCode("EPSG:3857"));
         assertEquals("b8e36d51-119a-423b-b156-d744d54123d5", wmsImageryInfo.getCustomHttpHeaders().get("X-WAAPI-TOKEN"));
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 14120)
@@ -21,5 +21,4 @@
 import org.openstreetmap.gui.jmapviewer.TileXY;
 import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.Bounds;
@@ -27,4 +26,5 @@
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryType;
 import org.openstreetmap.josm.data.imagery.WMTSTileSource.WMTSGetCapabilitiesException;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.spi.preferences.Config;
@@ -85,7 +85,7 @@
     @Test
     public void testPseudoMercator() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryPSEUDO_MERCATOR);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
 
         verifyMercatorTile(testSource, 0, 0, 1);
@@ -115,7 +115,7 @@
     @Test
     public void testWALLONIE() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:31370"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:31370"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryWALLONIE);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
 
         assertEquals("http://geoservices.wallonie.be/arcgis/rest/services/DONNEES_BASE/FOND_PLAN_ANNOTATIONS_2012_RW_NB/"
@@ -135,7 +135,7 @@
     @Ignore("disable this test, needs further working") // XXX
     public void testWALLONIENoMatrixDimension() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:31370"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:31370"));
         WMTSTileSource testSource = new WMTSTileSource(getImagery("test/data/wmts/WMTSCapabilities-Wallonie-nomatrixdimension.xml"));
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
 
         Bounds wallonieBounds = new Bounds(
@@ -159,7 +159,7 @@
     @Test
     public void testWIEN() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryWIEN);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         int zoomOffset = 10;
 
@@ -201,7 +201,7 @@
     @Test
     public void testGeoportalTOPOPL() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:4326"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:4326"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryTOPO_PL);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         verifyTile(new LatLon(56, 12), testSource, 0, 0, 1);
         verifyTile(new LatLon(56, 12), testSource, 0, 0, 2);
@@ -223,7 +223,7 @@
     @Test
     public void testGeoportalORTOPL4326() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:4326"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:4326"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryORTO_PL);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         verifyTile(new LatLon(53.60205873528009, 19.552206794646956), testSource, 12412, 3941, 13);
         verifyTile(new LatLon(49.79005619189761, 22.778262259134397), testSource, 17714, 10206, 13);
@@ -232,7 +232,7 @@
     @Test
     public void testGeoportalORTOPL2180() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:2180"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:2180"));
         WMTSTileSource testSource = new WMTSTileSource(testImageryORTO_PL);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
 
         verifyTile(new LatLon(53.59940948387726, 19.560544913270064), testSource, 6453, 3140, 13);
@@ -242,7 +242,7 @@
     @Test
     public void testTicket12168() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testImagery12168);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://www.ngi.be/cartoweb/1.0.0/topo/default/3857/7/1/1.png",
@@ -252,5 +252,5 @@
     @Test
     public void testTwoTileSetsForOneProjection() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         ImageryInfo ontario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
         ontario.setDefaultLayers(Arrays.asList(new DefaultLayer[] {
@@ -258,5 +258,5 @@
         }));
         WMTSTileSource testSource = new WMTSTileSource(ontario);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer/WMTS/tile/1.0.0/Basemap_Imagery_2014/default/"
@@ -269,5 +269,5 @@
     @Test
     public void testTwoTileSetsForOneProjectionSecondLayer() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         ImageryInfo ontario = getImagery(TestUtils.getTestDataRoot() + "wmts/WMTSCapabilities-Ontario.xml");
         ontario.setDefaultLayers(Arrays.asList(new DefaultLayer[] {
@@ -275,5 +275,5 @@
         }));
         WMTSTileSource testSource = new WMTSTileSource(ontario);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://maps.ottawa.ca/arcgis/rest/services/Basemap_Imagery_2014/MapServer/WMTS/tile/1.0.0/Basemap_Imagery_2014/default/"
@@ -286,14 +286,14 @@
     @Test
     public void testManyLayersScrollbars() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testLotsOfLayers);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
     }
 
     @Test
     public void testParserForDuplicateTags() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testDuplicateTags);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=grb_bsk&"
@@ -305,12 +305,12 @@
     @Test
     public void testParserForMissingStyleIdentifier() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         WMTSTileSource testSource = new WMTSTileSource(testMissingStyleIdentifer);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
     }
 
     @Test
     public void testForMultipleTileMatricesForOneLayerProjection() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
         ImageryInfo copy = new ImageryInfo(testMultipleTileMatrixForLayer);
         List<DefaultLayer> defaultLayers = new ArrayList<>(1);
@@ -318,5 +318,5 @@
         copy.setDefaultLayers(defaultLayers);
         WMTSTileSource testSource = new WMTSTileSource(copy);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://188.253.0.155:6080/arcgis/rest/services/Mashhad_BaseMap_1/MapServer/WMTS/tile/1.0.0/Mashhad_BaseMap_1"
@@ -333,5 +333,5 @@
     @Test
     public void testDimension() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:21781"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:21781"));
         ImageryInfo info = new ImageryInfo(testImageryGeoAdminCh);
         List<DefaultLayer> defaultLayers = new ArrayList<>(1);
@@ -339,5 +339,5 @@
         info.setDefaultLayers(defaultLayers);
         WMTSTileSource testSource = new WMTSTileSource(info);
-        testSource.initProjection(Main.getProjection());
+        testSource.initProjection(ProjectionRegistry.getProjection());
         assertEquals(
                 "http://wmts.geo.admin.ch/1.0.0/ch.are.agglomerationen_isolierte_staedte/default/20140101/21781/1/3/2.png",
@@ -414,7 +414,7 @@
     @Test
     public void testGisKtnGvAt() throws IOException, WMTSGetCapabilitiesException {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:31258"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:31258"));
         final WMTSTileSource source = new WMTSTileSource(testImageryGisKtnGvAt);
-        source.initProjection(Main.getProjection());
+        source.initProjection(ProjectionRegistry.getProjection());
         final TileXY tile = source.latLonToTileXY(46.6103, 13.8558, 11);
         assertEquals("https://gis.ktn.gv.at/arcgis/rest/services/tilecache/Ortho_2013_2015" +
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DataSetMergerTest.java	(revision 14120)
@@ -19,6 +19,6 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -49,5 +49,5 @@
         their = new DataSet();
         their.setVersion("0.6");
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java	(revision 14120)
@@ -9,6 +9,6 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -40,5 +40,5 @@
     @BeforeClass
     public static void setUp() {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 14120)
@@ -17,6 +17,6 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -83,5 +83,5 @@
     @Test
     public void testRemove() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
         try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) {
             DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
@@ -96,5 +96,5 @@
     @Test
     public void testMove() throws Exception {
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
         try (InputStream fis = new FileInputStream("data_nodist/restriction.osm")) {
             DataSet ds = OsmReader.parseDataSet(fis, NullProgressMonitor.INSTANCE);
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 14120)
@@ -8,5 +8,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -34,5 +33,5 @@
     @BeforeClass
     public static void setUp() {
-        Main.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode(SWISS_EPSG_CODE)); // Swiss grid
     }
 
@@ -97,5 +96,5 @@
     public void testAlatlon2eastNorth() {
         LatLon ll = new LatLon(46.518, 6.567);
-        EastNorth en = Main.getProjection().latlon2eastNorth(ll);
+        EastNorth en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en);
@@ -105,5 +104,5 @@
 
         ll = new LatLon(47.78, 8.58);
-        en = Main.getProjection().latlon2eastNorth(ll);
+        en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en);
@@ -113,5 +112,5 @@
 
         ll = new LatLon(46.58, 10.48);
-        en = Main.getProjection().latlon2eastNorth(ll);
+        en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en);
@@ -121,5 +120,5 @@
 
         ll = new LatLon(46.0 + 57.0 / 60 + 3.89813884505 / 3600, 7.0 + 26.0 / 60 + 19.076595154147 / 3600);
-        en = Main.getProjection().latlon2eastNorth(ll);
+        en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en);
@@ -130,5 +129,5 @@
         // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
         ll = new LatLon(46.04412093223244, 8.730497366167727);
-        en = Main.getProjection().latlon2eastNorth(ll);
+        en = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en);
@@ -144,5 +143,5 @@
     public void testBeastNorth2latlon() {
         EastNorth en = new EastNorth(533112.13, 152227.35);
-        LatLon ll = Main.getProjection().eastNorth2latlon(en);
+        LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
         if (debug) {
             System.out.println(ll);
@@ -152,5 +151,5 @@
 
         en = new EastNorth(685542.97, 292783.21);
-        ll = Main.getProjection().eastNorth2latlon(en);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
         if (debug) {
             System.out.println(ll);
@@ -160,5 +159,5 @@
 
         en = new EastNorth(833066.95, 163265.32);
-        ll = Main.getProjection().eastNorth2latlon(en);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
         if (debug) {
             System.out.println(ll);
@@ -168,5 +167,5 @@
 
         en = new EastNorth(600000.0, 200000.0);
-        ll = Main.getProjection().eastNorth2latlon(en);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
         if (debug) {
             System.out.println(ll);
@@ -177,5 +176,5 @@
         // http://geodesy.geo.admin.ch/reframe/lv03towgs84?easting=700000&northing=100000
         en = new EastNorth(700000.0, 100000.0);
-        ll = Main.getProjection().eastNorth2latlon(en);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
         if (debug) {
             System.out.println(ll);
@@ -191,6 +190,6 @@
     public void testCsendandreturn() {
         EastNorth en = new EastNorth(533111.69, 152227.85);
-        LatLon ll = Main.getProjection().eastNorth2latlon(en);
-        EastNorth en2 = Main.getProjection().latlon2eastNorth(ll);
+        LatLon ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
+        EastNorth en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en.east() - en2.east());
@@ -203,6 +202,6 @@
 
         en = new EastNorth(685544.16, 292782.91);
-        ll = Main.getProjection().eastNorth2latlon(en);
-        en2 = Main.getProjection().latlon2eastNorth(ll);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
+        en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en.east() - en2.east());
@@ -215,6 +214,6 @@
 
         en = new EastNorth(833068.04, 163265.39);
-        ll = Main.getProjection().eastNorth2latlon(en);
-        en2 = Main.getProjection().latlon2eastNorth(ll);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
+        en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en.east() - en2.east());
@@ -227,6 +226,6 @@
 
         en = new EastNorth(600000.0, 200000.0);
-        ll = Main.getProjection().eastNorth2latlon(en);
-        en2 = Main.getProjection().latlon2eastNorth(ll);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
+        en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en.east() - en2.east());
@@ -239,6 +238,6 @@
 
         en = new EastNorth(700000.0, 100000.0);
-        ll = Main.getProjection().eastNorth2latlon(en);
-        en2 = Main.getProjection().latlon2eastNorth(ll);
+        ll = ProjectionRegistry.getProjection().eastNorth2latlon(en);
+        en2 = ProjectionRegistry.getProjection().latlon2eastNorth(ll);
         if (debug) {
             System.out.println(en.east() - en2.east());
Index: trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MapViewStateTest.java	(revision 14120)
@@ -13,7 +13,7 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
 import org.openstreetmap.josm.gui.MapViewState.MapViewRectangle;
@@ -111,6 +111,6 @@
 
         EastNorth eastnorth = p.getEastNorth();
-        LatLon shouldLatLon = Main.getProjection().getWorldBoundsLatLon().getCenter();
-        EastNorth shouldEastNorth = Main.getProjection().latlon2eastNorth(shouldLatLon);
+        LatLon shouldLatLon = ProjectionRegistry.getProjection().getWorldBoundsLatLon().getCenter();
+        EastNorth shouldEastNorth = ProjectionRegistry.getProjection().latlon2eastNorth(shouldLatLon);
         assertEquals("east", shouldEastNorth.east(), eastnorth.east(), 0.01);
         assertEquals("north", shouldEastNorth.north(), eastnorth.north(), 0.01);
Index: trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 14120)
@@ -18,9 +18,9 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.ProjectionBounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
@@ -82,5 +82,5 @@
     @Test
     public void testDefaultScale() {
-        assertEquals(Main.getProjection().getDefaultZoomInPPD(), component.getScale(), 0.00001);
+        assertEquals(ProjectionRegistry.getProjection().getDefaultZoomInPPD(), component.getScale(), 0.00001);
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 14120)
@@ -9,9 +9,9 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.CopyAction;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -55,5 +55,5 @@
 
         LatLon pos = new LatLon(55, -5);
-        transferHandler.pasteOn(target, Main.getProjection().latlon2eastNorth(pos));
+        transferHandler.pasteOn(target, ProjectionRegistry.getProjection().latlon2eastNorth(pos));
         assertTrue(pos.equalsEpsilon(ds2.getNodes().iterator().next().getCoor()));
     }
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14120)
@@ -3,9 +3,9 @@
 
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.awt.Color;
@@ -19,6 +19,6 @@
 import java.util.regex.Matcher;
 
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenuItem;
-import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JPopupMenu;
 
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.data.DataSource;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -36,6 +37,6 @@
 import org.openstreetmap.josm.gui.bbox.SlippyMapBBoxChooser;
 import org.openstreetmap.josm.gui.bbox.SourceButton;
+import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
-import org.openstreetmap.josm.gui.layer.LayerManagerTest.TestLayer;
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.testutils.ImagePatternMatching;
@@ -278,5 +279,5 @@
         Main.pref.put("slippy_map_chooser.mapstyle", "White Tiles");
         // ensure projection matches JMapViewer's
-        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
+        ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857"));
 
         MapView mapView = MainApplication.getMap().mapView;
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java	(revision 14120)
@@ -14,7 +14,7 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.preferences.AbstractProperty;
 import org.openstreetmap.josm.data.preferences.NamedColorProperty;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -181,5 +181,5 @@
     public void testIsProjectionSupported() {
         assertFalse(testLayer.isProjectionSupported(null));
-        assertTrue(testLayer.isProjectionSupported(Main.getProjection()));
+        assertTrue(testLayer.isProjectionSupported(ProjectionRegistry.getProjection()));
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 14120)
@@ -13,5 +13,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -21,4 +20,5 @@
 import org.openstreetmap.josm.data.notes.Note;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
@@ -144,5 +144,5 @@
         TMSLayer layer = new TMSLayer(new ImageryInfo("the name", "http://www.url.com/"));
         layer.getDisplaySettings().setOffsetBookmark(
-                new OffsetBookmark(Main.getProjection().toCode(), layer.getInfo().getId(), layer.getInfo().getName(), "", 12, 34));
+                new OffsetBookmark(ProjectionRegistry.getProjection().toCode(), layer.getInfo().getId(), layer.getInfo().getName(), "", 12, 34));
         return layer;
     }
Index: trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14119)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14120)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
 import org.openstreetmap.josm.data.preferences.JosmUrls;
+import org.openstreetmap.josm.data.projection.ProjectionRegistry;
 import org.openstreetmap.josm.data.projection.Projections;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -472,5 +473,5 @@
 
         if (useProjection) {
-            Main.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
+            ProjectionRegistry.setProjection(Projections.getProjectionByCode("EPSG:3857")); // Mercator
         }
 
@@ -589,5 +590,5 @@
 
         // TODO: Remove global listeners and other global state.
-        Main.clearProjectionChangeListeners();
+        ProjectionRegistry.clearProjectionChangeListeners();
         Main.pref.resetToInitialState();
         Main.platform = null;
