Index: trunk/scripts/I18nSimilarStrings.java
===================================================================
--- trunk/scripts/I18nSimilarStrings.java	(revision 14137)
+++ trunk/scripts/I18nSimilarStrings.java	(revision 14138)
@@ -3,5 +3,4 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories;
@@ -26,5 +25,4 @@
     public static void main(String[] args) {
         I18n.init();
-        Main.determinePlatformHook();
         Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance());
         Config.setUrlsProvider(JosmUrls.getInstance());
Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 14138)
@@ -41,8 +41,6 @@
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.Platform;
 import org.openstreetmap.josm.tools.PlatformHook;
-import org.openstreetmap.josm.tools.PlatformHookOsx;
-import org.openstreetmap.josm.tools.PlatformHookWindows;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 import org.openstreetmap.josm.tools.bugreport.BugReport;
@@ -88,6 +86,8 @@
      * So if you need to hook into those early ones, split your class and send the one with the early hooks
      * to the JOSM team for inclusion.
-     */
-    public static volatile PlatformHook platform;
+     * @deprecated Use {@link PlatformManager#getPlatform}
+     */
+    @Deprecated
+    public static final PlatformHook platform = PlatformManager.getPlatform();
 
     /**
@@ -291,7 +291,9 @@
      * Identifies the current operating system family and initializes the platform hook accordingly.
      * @since 1849
-     */
+     * @deprecated Not needed anymore
+     */
+    @Deprecated
     public static void determinePlatformHook() {
-        platform = Platform.determinePlatform().accept(PlatformHook.CONSTRUCT_FROM_PLATFORM);
+        // Do nothing
     }
 
@@ -461,7 +463,9 @@
      * @return {@code true} if we are currently running on OSX
      * @since 6957
-     */
+     * @deprecated Use {@link PlatformManager#isPlatformOsx}
+     */
+    @Deprecated
     public static boolean isPlatformOsx() {
-        return Main.platform instanceof PlatformHookOsx;
+        return PlatformManager.isPlatformOsx();
     }
 
@@ -470,7 +474,9 @@
      * @return {@code true} if we are currently running on Windows
      * @since 7335
-     */
+     * @deprecated Use {@link PlatformManager#isPlatformWindows}
+     */
+    @Deprecated
     public static boolean isPlatformWindows() {
-        return Main.platform instanceof PlatformHookWindows;
+        return PlatformManager.isPlatformWindows();
     }
 
Index: trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java	(revision 14138)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -98,5 +99,5 @@
         // screen by default (it's a simulated mode, but should be ok)
         String exclusive = Config.getPref().get("draw.fullscreen.exclusive-mode", "auto");
-        if (("true".equals(exclusive) || ("auto".equals(exclusive) && !Main.isPlatformWindows())) && gd != null) {
+        if (("true".equals(exclusive) || ("auto".equals(exclusive) && !PlatformManager.isPlatformWindows())) && gd != null) {
             gd.setFullScreenWindow(selected ? frame : null);
         }
Index: trunk/src/org/openstreetmap/josm/actions/JosmAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/JosmAction.java	(revision 14138)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.tools.ImageResource;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -287,5 +288,5 @@
     public final void setTooltip(String tooltip) {
         if (tooltip != null) {
-            putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));
+            putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tooltip, sc));
         }
     }
Index: trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 14138)
@@ -45,4 +45,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.MultiMap;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
@@ -135,5 +136,5 @@
             for (final File file : files) {
                 if (file.exists()) {
-                    this.files.add(Main.platform.resolveFileLink(file));
+                    this.files.add(PlatformManager.getPlatform().resolveFileLink(file));
                 } else if (file.getParentFile() != null) {
                     // try to guess an extension using the specified fileFilter
Index: trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java	(revision 14138)
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -96,5 +97,5 @@
                 if (!SaveActionBase.confirmOverwrite(newFile))
                     return;
-                if (Main.platform.rename(file, newFile)) {
+                if (PlatformManager.getPlatform().rename(file, newFile)) {
                     layer.setAssociatedFile(newFile);
                     if (!layer.isRenamed()) {
Index: trunk/src/org/openstreetmap/josm/actions/RestartAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 14138)
@@ -16,5 +16,4 @@
 import java.util.List;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
 import org.openstreetmap.josm.gui.MainApplication;
@@ -24,4 +23,5 @@
 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -92,5 +92,5 @@
         final List<String> cmd;
         // special handling for OSX .app package
-        if (Main.isPlatformOsx() && getSystemProperty("java.library.path").contains("/JOSM.app/Contents/MacOS")) {
+        if (PlatformManager.isPlatformOsx() && getSystemProperty("java.library.path").contains("/JOSM.app/Contents/MacOS")) {
             cmd = getAppleCommands();
         } else {
@@ -177,5 +177,5 @@
     private static String getJavaRuntime() throws IOException {
         final String java = getSystemProperty("java.home") + File.separator + "bin" + File.separator +
-                (Main.isPlatformWindows() ? "java.exe" : "java");
+                (PlatformManager.isPlatformWindows() ? "java.exe" : "java");
         if (!new File(java).isFile()) {
             throw new IOException("Unable to find suitable java runtime at "+java);
Index: trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 14138)
@@ -43,4 +43,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.PlatformHookUnixoid;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
@@ -89,5 +90,5 @@
         text.append(Version.getInstance().getReleaseAttributes())
             .append("\nIdentification: ").append(Version.getInstance().getAgentString());
-        String buildNumber = Main.platform.getOSBuildNumber();
+        String buildNumber = PlatformManager.getPlatform().getOSBuildNumber();
         if (!buildNumber.isEmpty()) {
             text.append("\nOS Build number: ").append(buildNumber);
@@ -119,7 +120,8 @@
             .append((int) maxScreenSize.getHeight()).append('\n');
 
-        if (Main.platform instanceof PlatformHookUnixoid) {
+        if (PlatformManager.isPlatformUnixoid()) {
+            PlatformHookUnixoid platform = (PlatformHookUnixoid) PlatformManager.getPlatform();
             // Add Java package details
-            String packageDetails = ((PlatformHookUnixoid) Main.platform).getJavaPackageDetails();
+            String packageDetails = platform.getJavaPackageDetails();
             if (packageDetails != null) {
                 text.append("Java package: ")
@@ -129,5 +131,5 @@
             // Add WebStart package details if run from JNLP
             if (isRunningJavaWebStart()) {
-                String webStartDetails = ((PlatformHookUnixoid) Main.platform).getWebStartPackageDetails();
+                String webStartDetails = platform.getWebStartPackageDetails();
                 if (webStartDetails != null) {
                     text.append("WebStart package: ")
@@ -137,5 +139,5 @@
             }
             // Add Gnome Atk wrapper details if found
-            String atkWrapperDetails = ((PlatformHookUnixoid) Main.platform).getAtkWrapperPackageDetails();
+            String atkWrapperDetails = platform.getAtkWrapperPackageDetails();
             if (atkWrapperDetails != null) {
                 text.append("Java ATK Wrapper package: ")
@@ -230,5 +232,5 @@
     private static String paramCleanup(String param) {
         final String envJavaHome = getSystemEnv("JAVA_HOME");
-        final String envJavaHomeAlt = Main.isPlatformWindows() ? "%JAVA_HOME%" : "${JAVA_HOME}";
+        final String envJavaHomeAlt = PlatformManager.isPlatformWindows() ? "%JAVA_HOME%" : "${JAVA_HOME}";
         final String propJavaHome = getSystemProperty("java.home");
         final String propJavaHomeAlt = "<java.home>";
@@ -240,5 +242,5 @@
         final String userCacheDirAlt = "<josm.cache>";
         final String userHomeDir = getSystemProperty("user.home");
-        final String userHomeDirAlt = Main.isPlatformWindows() ? "%UserProfile%" : "${HOME}";
+        final String userHomeDirAlt = PlatformManager.isPlatformWindows() ? "%UserProfile%" : "${HOME}";
         final String userName = getSystemProperty("user.name");
         final String userNameAlt = "<user.name>";
Index: trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java	(revision 14138)
@@ -58,4 +58,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
@@ -343,5 +344,5 @@
                 c = "lasso";
             } else {
-                c = "rect" + (shift ? "_add" : (ctrl && !Main.isPlatformOsx() ? "_rm" : ""));
+                c = "rect" + (shift ? "_add" : (ctrl && !PlatformManager.isPlatformOsx() ? "_rm" : ""));
             }
             break;
@@ -446,5 +447,5 @@
         case SELECT:
         default:
-            if (!(ctrl && Main.isPlatformOsx())) {
+            if (!(ctrl && PlatformManager.isPlatformOsx())) {
                 // start working with rectangle or lasso
                 selectionManager.register(mv, lassoMode);
@@ -462,5 +463,5 @@
     public void mouseMoved(MouseEvent e) {
         // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired.
-        if (Main.isPlatformOsx() && (mode == Mode.ROTATE || mode == Mode.SCALE)) {
+        if (PlatformManager.isPlatformOsx() && (mode == Mode.ROTATE || mode == Mode.SCALE)) {
             mouseDragged(e);
             return;
@@ -490,5 +491,5 @@
         if (mode == Mode.SELECT) {
             // Unregisters selectionManager if ctrl has been pressed after mouse click on Mac OS X in order to move the map
-            if (ctrl && Main.isPlatformOsx()) {
+            if (ctrl && PlatformManager.isPlatformOsx()) {
                 selectionManager.unregister(mv);
                 // Make sure correct cursor is displayed
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 14138)
@@ -52,4 +52,5 @@
 import org.openstreetmap.josm.tools.ListenerList;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.SAXException;
@@ -280,5 +281,5 @@
         addPossibleResourceDir(locations, getSystemEnv("JOSM_RESOURCES"));
         addPossibleResourceDir(locations, getSystemProperty("josm.resources"));
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             String appdata = getSystemEnv("APPDATA");
             if (appdata != null && getSystemEnv("ALLUSERSPROFILE") != null
@@ -521,5 +522,5 @@
             } else if (reset) {
                 File backupFile = new File(prefDir, "preferences.xml.bak");
-                Main.platform.rename(preferenceFile, backupFile);
+                PlatformManager.getPlatform().rename(preferenceFile, backupFile);
                 Logging.warn(tr("Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile()));
                 resetToDefault();
@@ -555,5 +556,5 @@
                 );
             }
-            Main.platform.rename(preferenceFile, backupFile);
+            PlatformManager.getPlatform().rename(preferenceFile, backupFile);
             try {
                 resetToDefault();
Index: trunk/src/org/openstreetmap/josm/data/Version.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Version.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/data/Version.java	(revision 14138)
@@ -10,7 +10,7 @@
 import java.util.Properties;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.LanguageInfo;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -187,6 +187,6 @@
         }
         String result = "JOSM/1.5 ("+ s+' '+LanguageInfo.getJOSMLocaleCode()+')';
-        if (includeOsDetails && Main.platform != null) {
-            result += ' ' + Main.platform.getOSDescription();
+        if (includeOsDetails) {
+            result += ' ' + PlatformManager.getPlatform().getOSDescription();
         }
         return result;
Index: trunk/src/org/openstreetmap/josm/data/preferences/JosmBaseDirectories.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/preferences/JosmBaseDirectories.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/data/preferences/JosmBaseDirectories.java	(revision 14138)
@@ -14,4 +14,5 @@
 import org.openstreetmap.josm.spi.preferences.IBaseDirectories;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -63,5 +64,5 @@
                     preferencesDir = new File(path).getAbsoluteFile();
                 } else {
-                    preferencesDir = Main.platform.getDefaultPrefDirectory();
+                    preferencesDir = PlatformManager.getPlatform().getDefaultPrefDirectory();
                 }
             }
@@ -96,5 +97,5 @@
                     userdataDir = new File(path).getAbsoluteFile();
                 } else {
-                    userdataDir = Main.platform.getDefaultUserDataDirectory();
+                    userdataDir = PlatformManager.getPlatform().getDefaultUserDataDirectory();
                 }
             }
@@ -133,5 +134,5 @@
                         cacheDir = new File(path).getAbsoluteFile();
                     } else {
-                        cacheDir = Main.platform.getDefaultCacheDirectory();
+                        cacheDir = PlatformManager.getPlatform().getDefaultCacheDirectory();
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 14138)
@@ -178,4 +178,5 @@
 import org.openstreetmap.josm.tools.PlatformHook.NativeOsCallback;
 import org.openstreetmap.josm.tools.PlatformHookWindows;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.RightAndLefthandTraffic;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -386,5 +387,5 @@
             StringBuilder content = new StringBuilder(tr("You are running version {0} of Java.",
                     "<b>"+getSystemProperty("java.version")+"</b>")).append("<br><br>");
-            if ("Sun Microsystems Inc.".equals(getSystemProperty("java.vendor")) && !platform.isOpenJDK()) {
+            if ("Sun Microsystems Inc.".equals(getSystemProperty("java.vendor")) && !PlatformManager.getPlatform().isOpenJDK()) {
                 content.append("<b>").append(tr("This version is no longer supported by {0} since {1} and is not recommended for use.",
                         "Oracle", eolDate)).append("</b><br><br>");
@@ -400,5 +401,5 @@
             if (ed.showDialog().getValue() == 2) {
                 try {
-                    platform.openUrl(url);
+                    PlatformManager.getPlatform().openUrl(url);
                 } catch (IOException e) {
                     Logging.warn(e);
@@ -412,5 +413,6 @@
         return Arrays.asList(
             new InitializationTask(tr("Starting file watcher"), FileWatcher.getDefaultInstance()::start),
-            new InitializationTask(tr("Executing platform startup hook"), () -> platform.startupHook(MainApplication::askUpdateJava)),
+            new InitializationTask(tr("Executing platform startup hook"),
+                    () -> PlatformManager.getPlatform().startupHook(MainApplication::askUpdateJava)),
             new InitializationTask(tr("Building main menu"), this::initializeMainWindow),
             new InitializationTask(tr("Updating user interface"), () -> {
@@ -831,9 +833,9 @@
                 align("\t-Djosm.dir.name=JOSM") + tr("Change the JOSM directory name") + "\n\n" +
                 align("\t-Djosm.pref=" + tr("/PATH/TO/JOSM/PREF    ")) + tr("Set the preferences directory") + "\n" +
-                align("\t") + tr("Default: {0}", platform.getDefaultPrefDirectory()) + "\n\n" +
+                align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultPrefDirectory()) + "\n\n" +
                 align("\t-Djosm.userdata=" + tr("/PATH/TO/JOSM/USERDATA")) + tr("Set the user data directory") + "\n" +
-                align("\t") + tr("Default: {0}", platform.getDefaultUserDataDirectory()) + "\n\n" +
+                align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultUserDataDirectory()) + "\n\n" +
                 align("\t-Djosm.cache=" + tr("/PATH/TO/JOSM/CACHE   ")) + tr("Set the cache directory") + "\n" +
-                align("\t") + tr("Default: {0}", platform.getDefaultCacheDirectory()) + "\n\n" +
+                align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultCacheDirectory()) + "\n\n" +
                 align("\t-Djosm.home=" + tr("/PATH/TO/JOSM/HOMEDIR ")) +
                 tr("Set the preferences+data+cache directory (cache directory will be josm.home/cache)")+"\n\n"+
@@ -927,8 +929,7 @@
 
         // initialize the platform hook, and
-        Main.determinePlatformHook();
-        Main.platform.setNativeOsCallback(new DefaultNativeOsCallback());
+        PlatformManager.getPlatform().setNativeOsCallback(new DefaultNativeOsCallback());
         // call the really early hook before we do anything else
-        Main.platform.preStartupHook();
+        PlatformManager.getPlatform().preStartupHook();
 
         Config.setPreferencesInstance(Main.pref);
@@ -978,5 +979,5 @@
         processOffline(args);
 
-        Main.platform.afterPrefStartupHook();
+        PlatformManager.getPlatform().afterPrefStartupHook();
 
         applyWorkarounds();
@@ -1111,5 +1112,5 @@
         SwingUtilities.invokeLater(new GuiFinalizationWorker(args, proxySelector));
 
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             try {
                 // Check for insecure certificates to remove.
@@ -1187,5 +1188,5 @@
         // To remove during Java 9 migration
         if (getSystemProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows 10") &&
-                platform.getDefaultStyle().equals(LafPreference.LAF.get())) {
+                PlatformManager.getPlatform().getDefaultStyle().equals(LafPreference.LAF.get())) {
             try {
                 String build = PlatformHookWindows.getCurrentBuild();
@@ -1229,5 +1230,5 @@
 
     static void setupUIManager() {
-        String defaultlaf = platform.getDefaultStyle();
+        String defaultlaf = PlatformManager.getPlatform().getDefaultStyle();
         String laf = LafPreference.LAF.get();
         try {
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 14138)
@@ -25,5 +25,4 @@
 import javax.swing.event.MenuListener;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.AboutAction;
 import org.openstreetmap.josm.actions.AddNodeAction;
@@ -125,4 +124,5 @@
 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchPrimitiveDialog;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -734,5 +734,5 @@
         viewportFollowToggleAction.addButtonModel(vft.getModel());
 
-        if (Main.platform.canFullscreen()) {
+        if (PlatformManager.getPlatform().canFullscreen()) {
             // -- fullscreen toggle action
             fullscreenToggleAction = new FullscreenToggleAction();
Index: trunk/src/org/openstreetmap/josm/gui/MapMover.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapMover.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/MapMover.java	(revision 14138)
@@ -17,5 +17,4 @@
 
 import org.openstreetmap.gui.jmapviewer.JMapViewer;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.SelectAction;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -28,4 +27,5 @@
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -145,5 +145,5 @@
 
         // see #10592 - Disable these alternate shortcuts on OS X because of conflict with system shortcut
-        if (!Main.isPlatformOsx()) {
+        if (!PlatformManager.isPlatformOsx()) {
             registerActionShortcut(new ZoomerAction(",", "MapMover.Zoomer.in"),
                     Shortcut.registerShortcut("view:zoominalternate", tr("Map: {0}", tr("Zoom In")), KeyEvent.VK_COMMA, Shortcut.CTRL));
@@ -175,5 +175,5 @@
         int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK;
         boolean allowMovement = (e.getModifiersEx() & (MouseEvent.BUTTON3_DOWN_MASK | offMask)) == MouseEvent.BUTTON3_DOWN_MASK;
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             MapFrame map = MainApplication.getMap();
             int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
@@ -207,5 +207,5 @@
         int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK;
         if ((e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0) ||
-                (Main.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) {
+                (PlatformManager.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) {
             startMovement(e);
         }
@@ -217,5 +217,5 @@
     @Override
     public void mouseReleased(MouseEvent e) {
-        if (e.getButton() == MouseEvent.BUTTON3 || (Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) {
+        if (e.getButton() == MouseEvent.BUTTON3 || (PlatformManager.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) {
             endMovement();
         }
@@ -267,5 +267,5 @@
         // Mac OSX simulates with  ctrl + mouse 1  the second mouse button hence no dragging events get fired.
         // Is only the selected mouse button pressed?
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             if (e.getModifiersEx() == MouseEvent.CTRL_DOWN_MASK) {
                 doMoveForDrag(e);
Index: trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java	(revision 14138)
@@ -18,5 +18,5 @@
 import javax.swing.KeyStroke;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -122,5 +122,5 @@
     @Override
     public void mousePressed(MouseEvent e) {
-        if (e.getButton() == MouseEvent.BUTTON1 && !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {
+        if (e.getButton() == MouseEvent.BUTTON1 && !(PlatformManager.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {
             iStartSelectionPoint = e.getPoint();
             iEndSelectionPoint = e.getPoint();
@@ -131,5 +131,5 @@
     public void mouseDragged(MouseEvent e) {
         if (iStartSelectionPoint != null && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK
-                && !(Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {
+                && !(PlatformManager.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {
             iEndSelectionPoint = e.getPoint();
             iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint);
Index: trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java	(revision 14138)
@@ -12,5 +12,4 @@
 import javax.swing.SwingUtilities;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;
@@ -21,4 +20,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -100,5 +100,5 @@
     private static void openJosmUpdateSite() {
         try {
-            Main.platform.openUrl(Config.getUrls().getJOSMWebsite());
+            PlatformManager.getPlatform().openUrl(Config.getUrls().getJOSMWebsite());
         } catch (IOException ex) {
             Logging.log(Logging.LEVEL_WARN, "Unable to access JOSM website:", ex);
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java	(revision 14138)
@@ -25,5 +25,4 @@
 import javax.swing.table.TableModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.actions.search.SearchAction;
@@ -50,4 +49,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -103,6 +103,6 @@
 
     private static final String[] COLUMN_TOOLTIPS = {
-            Main.platform.makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),
-            Main.platform.makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),
+            PlatformManager.getPlatform().makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),
+            PlatformManager.getPlatform().makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),
             null,
             tr("Inverse filter"),
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 14138)
@@ -42,5 +42,4 @@
 import javax.swing.table.TableModel;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.MergeLayerAction;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -83,4 +82,5 @@
 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -229,6 +229,6 @@
         // Disable some default JTable shortcuts to use JOSM ones (see #5678, #10458)
         for (KeyStroke ks : new KeyStroke[] {
-                KeyStroke.getKeyStroke(KeyEvent.VK_C, Main.platform.getMenuShortcutKeyMaskEx()),
-                KeyStroke.getKeyStroke(KeyEvent.VK_V, Main.platform.getMenuShortcutKeyMaskEx()),
+                KeyStroke.getKeyStroke(KeyEvent.VK_C, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()),
+                KeyStroke.getKeyStroke(KeyEvent.VK_V, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()),
                 KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_DOWN_MASK),
                 KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_DOWN_MASK),
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 14138)
@@ -33,5 +33,4 @@
 import javax.swing.event.PopupMenuListener;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.actions.IPrimitiveAction;
@@ -88,4 +87,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.InputMapUtils;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.SubclassFilteredCollection;
@@ -202,5 +202,5 @@
         // Do not hide copy action because of default JList override (fix #9815)
         displaylist.getActionMap().put("copy", MainApplication.getMenu().copy);
-        displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, Main.platform.getMenuShortcutKeyMaskEx()), "copy");
+        displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), "copy");
 
         updateActionsRelationLists();
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 14138)
@@ -94,4 +94,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.Utils;
@@ -817,5 +818,5 @@
         @Override
         public void setContentPane(Container contentPane) {
-            final int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx();
+            final int commandDownMask = PlatformManager.getPlatform().getMenuShortcutKeyMaskEx();
             List<String> lines = new ArrayList<>();
             Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask).ifPresent(sc ->
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java	(revision 14138)
@@ -8,8 +8,8 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationMemberTask;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -31,5 +31,5 @@
             KeyEvent.VK_HOME, Shortcut.ALT);
         sc.setAccelerator(this);
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Download all incomplete members"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Download all incomplete members"), sc));
         new ImageProvider("dialogs/relation", "downloadincomplete").getResource().attachImageIcon(this, true);
         putValue(NAME, tr("Download members"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java	(revision 14138)
@@ -7,6 +7,6 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -28,5 +28,5 @@
         Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.ALT);
         sc.setAccelerator(this);
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Move the currently selected members down"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members down"), sc));
         setEnabled(false);
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java	(revision 14138)
@@ -7,6 +7,6 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -28,5 +28,5 @@
         Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.ALT);
         sc.setAccelerator(this);
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Move the currently selected members up"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members up"), sc));
         setEnabled(false);
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java	(revision 14138)
@@ -19,4 +19,5 @@
 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -37,5 +38,5 @@
         Shortcut sc = Shortcut.registerShortcut("relationeditor:refresh", tr("Relation Editor: Refresh"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
         // CHECKSTYLE.ON: LineLength
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Refresh relation from data layer"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Refresh relation from data layer"), sc));
         new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true);
         putValue(NAME, tr("Refresh"));
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java	(revision 14138)
@@ -7,6 +7,6 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -29,5 +29,6 @@
         Shortcut sc = Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, Shortcut.ALT);
         sc.setAccelerator(this);
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Remove the currently selected members from this relation"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(
+                tr("Remove the currently selected members from this relation"), sc));
         setEnabled(false);
     }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java	(revision 14138)
@@ -7,6 +7,6 @@
 import java.awt.event.KeyEvent;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -28,5 +28,5 @@
         Shortcut sc = Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_END, Shortcut.ALT);
         sc.setAccelerator(this);
-        putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Sort the relation members"), sc));
+        putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Sort the relation members"), sc));
         updateEnabledState();
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 14138)
@@ -77,4 +77,5 @@
 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -1260,5 +1261,5 @@
                     tt = tt.substring(6, tt.length()-6);
                 }
-                tt = Main.platform.makeTooltip(tt, sc);
+                tt = PlatformManager.getPlatform().makeTooltip(tt, sc);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java	(revision 14138)
@@ -24,5 +24,4 @@
 import javax.swing.UIManager.LookAndFeelInfo;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.data.preferences.StringProperty;
@@ -42,4 +41,5 @@
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
@@ -53,5 +53,5 @@
      * @since 11713
      */
-    public static final StringProperty LAF = new StringProperty("laf", Main.platform.getDefaultStyle());
+    public static final StringProperty LAF = new StringProperty("laf", PlatformManager.getPlatform().getDefaultStyle());
 
     static final class LafListCellRenderer implements ListCellRenderer<LookAndFeelInfo> {
@@ -97,5 +97,5 @@
 
         // let's try to load additional LookAndFeels and put them into the list
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             try {
                 Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel");
Index: trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java	(revision 14138)
@@ -27,5 +27,4 @@
 import javax.swing.JSeparator;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
@@ -43,4 +42,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.PlatformHookWindows;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -114,5 +114,5 @@
 
         // Certificate installation only available on Windows for now, see #10033
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             installCertificate = new JButton(tr("Install..."));
             uninstallCertificate = new JButton(tr("Uninstall..."));
Index: trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java	(revision 14138)
@@ -16,4 +16,5 @@
 import org.openstreetmap.josm.data.preferences.BooleanProperty;
 import org.openstreetmap.josm.spi.preferences.Config;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -33,5 +34,5 @@
     public static final BooleanProperty PROP_USE_NATIVE_FILE_DIALOG = new BooleanProperty("use.native.file.dialog",
             // Native dialogs do not support file filters, so do not set them as default, except for OS X where they never worked
-            Main.isPlatformOsx());
+            PlatformManager.isPlatformOsx());
 
     private final boolean open;
Index: trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java	(revision 14138)
@@ -14,4 +14,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -138,5 +139,5 @@
     @Override
     public int showOpenDialog(Component parent) {
-        boolean appleProperty = Main.isPlatformOsx() && selectionMode == JFileChooser.DIRECTORIES_ONLY;
+        boolean appleProperty = PlatformManager.isPlatformOsx() && selectionMode == JFileChooser.DIRECTORIES_ONLY;
         if (appleProperty) {
             Utils.updateSystemProperty("apple.awt.fileDialogForDirectories", "true");
@@ -176,5 +177,5 @@
             // http://stackoverflow.com/questions/1224714/how-can-i-make-a-java-filedialog-accept-directories-as-its-filetype-in-os-x/1224744#1224744
             // CHECKSTYLE.ON: LineLength
-            return Main.isPlatformOsx();
+            return PlatformManager.isPlatformOsx();
         case JFileChooser.FILES_ONLY:
         default:
Index: trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java	(revision 14138)
@@ -24,8 +24,8 @@
 import javax.swing.undo.UndoManager;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 /**
@@ -95,7 +95,7 @@
                 if (!GraphicsEnvironment.isHeadless()) {
                     component.getInputMap().put(
-                            KeyStroke.getKeyStroke(KeyEvent.VK_Z, Main.platform.getMenuShortcutKeyMaskEx()), undoAction);
+                            KeyStroke.getKeyStroke(KeyEvent.VK_Z, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), undoAction);
                     component.getInputMap().put(
-                            KeyStroke.getKeyStroke(KeyEvent.VK_Y, Main.platform.getMenuShortcutKeyMaskEx()), redoAction);
+                            KeyStroke.getKeyStroke(KeyEvent.VK_Y, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), redoAction);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/io/CachedFile.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/io/CachedFile.java	(revision 14138)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -521,5 +522,5 @@
             activeConnection = null;
             localFile = new File(destDir, localPath);
-            if (Main.platform.rename(destDirFile, localFile)) {
+            if (PlatformManager.getPlatform().rename(destDirFile, localFile)) {
                 Config.getPref().putList(prefKey,
                         Arrays.asList(Long.toString(System.currentTimeMillis()), localFile.toString()));
@@ -549,5 +550,5 @@
             // Windows doesn't support paths longer than 260, leave 5 chars as safe buffer, 4 will be used by ".tmp"
             // TODO: what about filename size on other systems? 255?
-            if (directory.length() > 191 && Main.isPlatformWindows()) {
+            if (directory.length() > 191 && PlatformManager.isPlatformWindows()) {
                 // digest length + name prefix == 64
                 // 255 - 64 = 191
Index: trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java	(revision 14138)
@@ -27,7 +27,7 @@
 import javax.net.ssl.TrustManagerFactory;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -227,5 +227,5 @@
             // Try to add platform certificates. Do not exit in case of error (embedded certificates may be OK)
             for (NativeCertAmend certAmend : PLATFORM_CERT_AMEND) {
-                X509Certificate cert = Main.platform.getX509Certificate(certAmend);
+                X509Certificate cert = PlatformManager.getPlatform().getX509Certificate(certAmend);
                 if (checkAndAddCertificate(md, cert, certAmend, keyStore)) {
                     certificateAdded = true;
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java	(revision 14138)
@@ -39,8 +39,8 @@
 import javax.net.ssl.TrustManagerFactory;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.preferences.StringProperty;
 import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 
 import sun.security.util.ObjectIdentifier;
@@ -301,5 +301,5 @@
         Enumeration<String> aliases = josmKs.aliases();
         if (aliases.hasMoreElements()) {
-            return Main.platform.setupHttpsCertificate(ENTRY_ALIAS,
+            return PlatformManager.getPlatform().setupHttpsCertificate(ENTRY_ALIAS,
                     new KeyStore.TrustedCertificateEntry(josmKs.getCertificate(aliases.nextElement())));
         }
Index: trunk/src/org/openstreetmap/josm/tools/KeyboardUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/KeyboardUtils.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/tools/KeyboardUtils.java	(revision 14138)
@@ -9,6 +9,4 @@
 import java.util.Locale;
 import java.util.Map;
-
-import org.openstreetmap.josm.Main;
 
 /**
@@ -293,5 +291,5 @@
             // UK Apple, https://en.wikipedia.org/wiki/QWERTY#UK_Apple_keyboard
             // International English Apple, https://en.wikipedia.org/wiki/QWERTY#Apple_International_English_Keyboard
-            if (Main.isPlatformOsx()) {
+            if (PlatformManager.isPlatformOsx()) {
                 result.add('§'); // https://en.wikipedia.org/wiki/Section_sign
             }
Index: trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 14138)
@@ -25,7 +25,7 @@
 
     private static void displayUrlFallback(URI uri) throws IOException {
-        if (Main.platform == null)
+        if (PlatformManager.getPlatform() == null)
             throw new IllegalStateException(tr("Failed to open URL. There is currently no platform set. Please set a platform first."));
-        Main.platform.openUrl(uri.toString());
+        PlatformManager.getPlatform().openUrl(uri.toString());
     }
 
@@ -45,10 +45,10 @@
         if (Desktop.isDesktopSupported()) {
             try {
-                if (Main.isPlatformWindows()) {
+                if (PlatformManager.isPlatformWindows()) {
                     // Desktop API works fine under Windows, so we don't try any fallback in case of I/O exceptions because it's not API's fault
                     Desktop.getDesktop().browse(uri);
-                } else if (Main.platform instanceof PlatformHookUnixoid || Main.platform instanceof PlatformHookOsx) {
+                } else if (PlatformManager.isPlatformUnixoid() || PlatformManager.isPlatformOsx()) {
                     // see #5629 #5108 #9568
-                    Main.platform.openUrl(uri.toString());
+                    PlatformManager.getPlatform().openUrl(uri.toString());
                 } else {
                     // This is not the case with some Linux environments (see below),
Index: trunk/src/org/openstreetmap/josm/tools/PlatformManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformManager.java	(revision 14138)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformManager.java	(revision 14138)
@@ -0,0 +1,50 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools;
+
+/**
+ * Holder for current platform hook.
+ * @since 14138
+ */
+public final class PlatformManager {
+
+    /**
+     * Platform specific code goes in here.
+     */
+    private static final PlatformHook PLATFORM = Platform.determinePlatform().accept(PlatformHook.CONSTRUCT_FROM_PLATFORM);
+
+    private PlatformManager() {
+        // Hide constructor
+    }
+
+    /**
+     * Returns the current platform hook.
+     * @return the current platform hook
+     */
+    public static PlatformHook getPlatform() {
+        return PLATFORM;
+    }
+
+    /**
+     * Determines if we are currently running on macOS.
+     * @return {@code true} if we are currently running on macOS
+     */
+    public static boolean isPlatformOsx() {
+        return PLATFORM instanceof PlatformHookOsx;
+    }
+
+    /**
+     * Determines if we are currently running on an Unix system.
+     * @return {@code true} if we are currently running on an Unix system
+     */
+    public static boolean isPlatformUnixoid() {
+        return PLATFORM instanceof PlatformHookUnixoid;
+    }
+
+    /**
+     * Determines if we are currently running on Windows.
+     * @return {@code true} if we are currently running on Windows
+     */
+    public static boolean isPlatformWindows() {
+        return PLATFORM instanceof PlatformHookWindows;
+    }
+}
Index: trunk/src/org/openstreetmap/josm/tools/Shortcut.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 14137)
+++ trunk/src/org/openstreetmap/josm/tools/Shortcut.java	(revision 14138)
@@ -371,5 +371,5 @@
         if (initdone) return;
         initdone = true;
-        int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx();
+        int commandDownMask = PlatformManager.getPlatform().getMenuShortcutKeyMaskEx();
         groups.put(NONE, -1);
         groups.put(MNEMONIC, KeyEvent.ALT_DOWN_MASK);
@@ -384,5 +384,5 @@
 
         // (1) System reserved shortcuts
-        Main.platform.initSystemShortcuts();
+        PlatformManager.getPlatform().initSystemShortcuts();
         // (2) User defined shortcuts
         Main.pref.getAllPrefixCollectionKeys("shortcut.entry.").stream()
@@ -507,5 +507,5 @@
         } else if (existing.isPresent()) {
             final Shortcut conflict = existing.get();
-            if (Main.isPlatformOsx()) {
+            if (PlatformManager.isPlatformOsx()) {
                 // Try to reassign Meta to Ctrl
                 int newmodifier = findNewOsxModifier(requestedGroup);
Index: trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
===================================================================
--- trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java	(revision 14137)
+++ trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java	(revision 14138)
@@ -52,5 +52,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection().mapStyles().timeout(60000);
+    public JOSMTestRules test = new JOSMTestRules().preferences().projection().mapStyles().timeout(60000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java	(revision 14138)
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.tools.JosmRuntimeException;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.date.DateUtils;
 
@@ -108,7 +109,6 @@
         I18n.init();
         // initialize the plaform hook, and
-        Main.determinePlatformHook();
         // call the really early hook before we anything else
-        Main.platform.preStartupHook();
+        PlatformManager.getPlatform().preStartupHook();
 
         Logging.setLogLevel(Logging.LEVEL_INFO);
Index: trunk/test/unit/org/openstreetmap/josm/MainTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/MainTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().fakeAPI();
+    public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java	(revision 14138)
@@ -47,5 +47,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().fakeAPI();
+    public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java	(revision 14138)
@@ -38,5 +38,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java	(revision 14138)
@@ -24,5 +24,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 14138)
@@ -29,5 +29,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java	(revision 14138)
@@ -27,5 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java	(revision 14138)
@@ -17,5 +17,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java	(revision 14138)
@@ -49,5 +49,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     private MergeLayerAction action;
Index: trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java	(revision 14138)
@@ -28,5 +28,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java	(revision 14138)
@@ -32,5 +32,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java	(revision 14138)
@@ -20,5 +20,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java	(revision 14138)
@@ -42,5 +42,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java	(revision 14138)
@@ -27,5 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java	(revision 14138)
@@ -40,5 +40,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().timeout(20000);
+    public JOSMTestRules test = new JOSMTestRules().main().projection().timeout(20000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java	(revision 14138)
@@ -27,5 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java	(revision 14138)
@@ -27,5 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java	(revision 14138)
@@ -28,5 +28,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().platform().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java	(revision 14138)
@@ -60,5 +60,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().fakeAPI().timeout(30000);
+    public JOSMTestRules test = new JOSMTestRules().fakeAPI().timeout(30000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
     private CommandTestData testData;
 
Index: trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java	(revision 14138)
@@ -37,5 +37,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().preferences().fakeAPI();
+    public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java	(revision 14138)
@@ -30,5 +30,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     @Rule
Index: trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java	(revision 14138)
@@ -47,5 +47,5 @@
     @ClassRule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public static JOSMTestRules test = new JOSMTestRules().preferences().platform().projection().timeout((int) TimeUnit.MINUTES.toMillis(5));
+    public static JOSMTestRules test = new JOSMTestRules().preferences().projection().timeout((int) TimeUnit.MINUTES.toMillis(5));
 
     @Rule
Index: trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java	(revision 14138)
@@ -38,5 +38,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java	(revision 14138)
@@ -35,5 +35,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.EastNorth;
@@ -42,4 +41,5 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Pair;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Utils;
 
@@ -90,5 +90,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projectionNadGrids().timeout(90_000);
+    public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().timeout(90_000);
 
     /**
@@ -104,5 +104,4 @@
             }
         }
-        Main.determinePlatformHook();
         Collection<RefEntry> refs = readData();
         refs = updateData(refs);
@@ -286,5 +285,5 @@
         // see http://geodesie.ign.fr/contenu/fichiers/documentation/algorithmes/notice/NT111_V1_HARMEL_TransfoNTF-RGF93_FormatGrilleNTV2.pdf
         def = def.replace("ntf_r93_b.gsb", "ntf_r93.gsb");
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             def = def.replace("'", "\\'").replace("\"", "\\\"");
         }
Index: trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().platform();
+    public JOSMTestRules test = new JOSMTestRules().projectionNadGrids();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java	(revision 14138)
@@ -19,5 +19,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java	(revision 14138)
@@ -52,5 +52,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().platform();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     static MapCSSTagChecker buildTagChecker(String css) throws ParseException {
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 14138)
@@ -35,5 +35,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main().platform();
+    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main();
 
     private static Way createUnclosedWay(String tags) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java	(revision 14138)
@@ -28,5 +28,4 @@
 import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.actions.AboutAction;
@@ -44,4 +43,5 @@
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 import org.openstreetmap.josm.tools.Logging;
+import org.openstreetmap.josm.tools.PlatformManager;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -196,5 +196,6 @@
     public void testSetupUIManager() {
         MainApplication.setupUIManager();
-        assertEquals(Config.getPref().get("laf", Main.platform.getDefaultStyle()), UIManager.getLookAndFeel().getClass().getCanonicalName());
+        assertEquals(Config.getPref().get("laf", PlatformManager.getPlatform().getDefaultStyle()),
+                UIManager.getLookAndFeel().getClass().getCanonicalName());
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java	(revision 14138)
@@ -28,5 +28,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java	(revision 14138)
@@ -56,5 +56,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java	(revision 14138)
@@ -53,5 +53,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java	(revision 14138)
@@ -29,5 +29,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection().main().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
 
     private final OsmTransferHandler transferHandler = new OsmTransferHandler();
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java	(revision 14138)
@@ -28,5 +28,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java	(revision 14138)
@@ -31,5 +31,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection().mapStyles();
+    public JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java	(revision 14138)
@@ -58,5 +58,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules josmTestRules = new JOSMTestRules().main().platform().projection().fakeImagery();
+    public JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeImagery();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().projection().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().preferences().projection().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 14138)
@@ -34,5 +34,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().preferences().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java	(revision 14138)
@@ -38,5 +38,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().preferences().main();
 
     protected OsmDataLayer layer;
Index: trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().https();
+    public JOSMTestRules test = new JOSMTestRules().preferences().https();
 
     static IHelpBrowser newHelpBrowser() {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java	(revision 14138)
@@ -46,5 +46,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     private static final class TMSTileStubSource extends AbstractTMSTileSource {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java	(revision 14138)
@@ -41,5 +41,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().preferences().projection();
 
     private AutosaveTask task;
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java	(revision 14138)
@@ -41,5 +41,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().i18n();
+    public JOSMTestRules test = new JOSMTestRules().main().projection().i18n();
 
     private static String getHtml(GpxLayer layer) {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java	(revision 14138)
@@ -49,5 +49,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     private DataSet ds;
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java	(revision 14138)
@@ -23,5 +23,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java	(revision 14138)
@@ -25,5 +25,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java	(revision 14138)
@@ -23,5 +23,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java	(revision 14138)
@@ -19,5 +19,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 14138)
@@ -32,5 +32,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     private static PleaseWaitRunnable createTask(String file) throws Exception {
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14138)
@@ -30,5 +30,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().fakeImagery().timeout(20000);
+    public JOSMTestRules test = new JOSMTestRules().main().projection().fakeImagery().timeout(20000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().main().platform().preferences().projection();
+    public JOSMTestRules test = new JOSMTestRules().main().preferences().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java	(revision 14138)
@@ -20,5 +20,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().preferences();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main();
+    public JOSMTestRules test = new JOSMTestRules().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14138)
@@ -52,5 +52,5 @@
     public JOSMTestRules test = new JOSMTestRules().assumeRevision(
         "Revision: 10000\n"
-    ).preferences().main().assertionsInEDT().platform();
+    ).preferences().main().assertionsInEDT();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java	(revision 14138)
@@ -34,5 +34,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java	(revision 14138)
@@ -33,5 +33,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java	(revision 14138)
@@ -25,5 +25,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().https().timeout(20000);
+    public JOSMTestRules test = new JOSMTestRules().https().timeout(20000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java	(revision 14138)
@@ -32,5 +32,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     @Rule
Index: trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException {
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java	(revision 14138)
@@ -37,5 +37,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection();
+    public JOSMTestRules test = new JOSMTestRules().projection();
 
     private static String getSessionDataDir() {
Index: trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java	(revision 14138)
@@ -89,5 +89,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().projection().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().main();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 14138)
@@ -34,5 +34,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform();
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 14138)
@@ -42,5 +42,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().main().projection().preferences().timeout(10*60*1000);
+    public JOSMTestRules test = new JOSMTestRules().main().projection().preferences().timeout(10*60*1000);
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().platform().https().devAPI().main().projection();
+    public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection();
 
     private static class InitStatusListenerStub implements InitStatusListener {
Index: trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java	(revision 14138)
@@ -79,5 +79,4 @@
     private Runnable navigableComponentMockingRunnable;
     private Runnable edtAssertionMockingRunnable;
-    private boolean platform;
     private boolean useProjection;
     private boolean useProjectionNadGrids;
@@ -150,7 +149,8 @@
      * Enable {@link Main#platform} global variable.
      * @return this instance, for easy chaining
-     */
+     * @deprecated Not needed anymore
+     */
+    @Deprecated
     public JOSMTestRules platform() {
-        platform = true;
         return this;
     }
@@ -209,5 +209,4 @@
     public JOSMTestRules https() {
         useHttps = true;
-        platform = true;
         return this;
     }
@@ -457,9 +456,4 @@
             // We force the use of a wrong API server, just in case anyone attempts an upload
             Config.getPref().put("osm-server.url", "http://invalid");
-        }
-
-        // Set Platform
-        if (platform) {
-            Main.determinePlatformHook();
         }
 
@@ -550,5 +544,4 @@
         cleanLayerEnvironment();
         Main.pref.resetToInitialState();
-        Main.platform = null;
         System.gc();
     }
@@ -592,5 +585,4 @@
         ProjectionRegistry.clearProjectionChangeListeners();
         Main.pref.resetToInitialState();
-        Main.platform = null;
 
         if (this.assumeRevisionString != null && this.originalVersion != null) {
Index: trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java	(revision 14138)
@@ -26,5 +26,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().platform();
+    public JOSMTestRules rules = new JOSMTestRules();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java	(revision 14138)
@@ -14,5 +14,4 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.spi.preferences.Config;
 
@@ -64,5 +63,5 @@
     @Test
     public void testOpenUrl() throws IOException {
-        if (!Main.isPlatformWindows()) {
+        if (!PlatformManager.isPlatformWindows()) {
             hook.openUrl(Config.getUrls().getJOSMWebsite());
         } else {
@@ -83,5 +82,5 @@
         File cache = hook.getDefaultCacheDirectory();
         assertNotNull(cache);
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             assertTrue(cache.toString().contains("/Library/"));
         }
@@ -95,5 +94,5 @@
         File cache = hook.getDefaultPrefDirectory();
         assertNotNull(cache);
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             assertTrue(cache.toString().contains("/Library/"));
         }
@@ -114,5 +113,5 @@
     public void testGetOSDescription() {
         String os = hook.getOSDescription();
-        if (Main.isPlatformOsx()) {
+        if (PlatformManager.isPlatformOsx()) {
             assertTrue(os.contains("Mac"));
         } else {
Index: trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java	(revision 14138)
@@ -19,5 +19,4 @@
 import org.junit.Test;
 import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpsServer;
 import org.openstreetmap.josm.io.remotecontrol.RemoteControlTest;
@@ -54,5 +53,5 @@
     @Test
     public void testGetRootKeystore() throws Exception {
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             assertNotNull(PlatformHookWindows.getRootKeystore());
         } else {
@@ -72,5 +71,5 @@
     @Test
     public void testRemoveInsecureCertificates() throws Exception {
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             PlatformHookWindows.removeInsecureCertificates();
         } else {
@@ -93,5 +92,5 @@
         KeyStore ks = RemoteControlHttpsServer.loadJosmKeystore();
         TrustedCertificateEntry trustedCert = new KeyStore.TrustedCertificateEntry(ks.getCertificate(ks.aliases().nextElement()));
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             hook.setupHttpsCertificate(RemoteControlHttpsServer.ENTRY_ALIAS, trustedCert);
         } else {
@@ -119,5 +118,5 @@
     @Test
     public void testOpenUrl() throws IOException {
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             hook.openUrl(Config.getUrls().getJOSMWebsite());
         } else {
@@ -146,5 +145,5 @@
         File cache = hook.getDefaultCacheDirectory();
         assertNotNull(cache);
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             assertTrue(cache.toString().contains(":"));
         }
@@ -158,5 +157,5 @@
         File cache = hook.getDefaultPrefDirectory();
         assertNotNull(cache);
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             assertTrue(cache.toString().contains(":"));
         }
@@ -177,5 +176,5 @@
     public void testGetInstalledFonts() {
         Collection<String> fonts = hook.getInstalledFonts();
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             assertFalse(fonts.isEmpty());
         } else {
@@ -190,5 +189,5 @@
     public void testGetOSDescription() {
         String os = hook.getOSDescription();
-        if (Main.isPlatformWindows()) {
+        if (PlatformManager.isPlatformWindows()) {
             assertTrue(os.contains("Windows"));
         } else {
Index: trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().platform().projection().rlTraffic();
+    public JOSMTestRules rules = new JOSMTestRules().projection().rlTraffic();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java	(revision 14138)
@@ -21,5 +21,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules rules = new JOSMTestRules().platform().projection().territories();
+    public JOSMTestRules rules = new JOSMTestRules().projection().territories();
 
     /**
Index: trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 14137)
+++ trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 14138)
@@ -27,5 +27,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().preferences().platform();
+    public JOSMTestRules test = new JOSMTestRules().preferences();
 
     /**
