Changeset 14138 in josm
- Timestamp:
- 2018-08-12T02:21:19+02:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 126 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/scripts/I18nSimilarStrings.java
r14134 r14138 3 3 import java.util.List; 4 4 5 import org.openstreetmap.josm.Main;6 5 import org.openstreetmap.josm.data.Preferences; 7 6 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories; … … 26 25 public static void main(String[] args) { 27 26 I18n.init(); 28 Main.determinePlatformHook();29 27 Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance()); 30 28 Config.setUrlsProvider(JosmUrls.getInstance()); -
trunk/src/org/openstreetmap/josm/Main.java
r14134 r14138 41 41 import org.openstreetmap.josm.tools.JosmRuntimeException; 42 42 import org.openstreetmap.josm.tools.Logging; 43 import org.openstreetmap.josm.tools.Platform;44 43 import org.openstreetmap.josm.tools.PlatformHook; 45 import org.openstreetmap.josm.tools.PlatformHookOsx; 46 import org.openstreetmap.josm.tools.PlatformHookWindows; 44 import org.openstreetmap.josm.tools.PlatformManager; 47 45 import org.openstreetmap.josm.tools.Utils; 48 46 import org.openstreetmap.josm.tools.bugreport.BugReport; … … 88 86 * So if you need to hook into those early ones, split your class and send the one with the early hooks 89 87 * to the JOSM team for inclusion. 90 */ 91 public static volatile PlatformHook platform; 88 * @deprecated Use {@link PlatformManager#getPlatform} 89 */ 90 @Deprecated 91 public static final PlatformHook platform = PlatformManager.getPlatform(); 92 92 93 93 /** … … 291 291 * Identifies the current operating system family and initializes the platform hook accordingly. 292 292 * @since 1849 293 */ 293 * @deprecated Not needed anymore 294 */ 295 @Deprecated 294 296 public static void determinePlatformHook() { 295 platform = Platform.determinePlatform().accept(PlatformHook.CONSTRUCT_FROM_PLATFORM);297 // Do nothing 296 298 } 297 299 … … 461 463 * @return {@code true} if we are currently running on OSX 462 464 * @since 6957 463 */ 465 * @deprecated Use {@link PlatformManager#isPlatformOsx} 466 */ 467 @Deprecated 464 468 public static boolean isPlatformOsx() { 465 return Main.platform instanceofPlatformHookOsx;469 return PlatformManager.isPlatformOsx(); 466 470 } 467 471 … … 470 474 * @return {@code true} if we are currently running on Windows 471 475 * @since 7335 472 */ 476 * @deprecated Use {@link PlatformManager#isPlatformWindows} 477 */ 478 @Deprecated 473 479 public static boolean isPlatformWindows() { 474 return Main.platform instanceofPlatformHookWindows;480 return PlatformManager.isPlatformWindows(); 475 481 } 476 482 -
trunk/src/org/openstreetmap/josm/actions/FullscreenToggleAction.java
r12846 r14138 23 23 import org.openstreetmap.josm.gui.util.GuiHelper; 24 24 import org.openstreetmap.josm.spi.preferences.Config; 25 import org.openstreetmap.josm.tools.PlatformManager; 25 26 import org.openstreetmap.josm.tools.Shortcut; 26 27 … … 98 99 // screen by default (it's a simulated mode, but should be ok) 99 100 String exclusive = Config.getPref().get("draw.fullscreen.exclusive-mode", "auto"); 100 if (("true".equals(exclusive) || ("auto".equals(exclusive) && ! Main.isPlatformWindows())) && gd != null) {101 if (("true".equals(exclusive) || ("auto".equals(exclusive) && !PlatformManager.isPlatformWindows())) && gd != null) { 101 102 gd.setFullScreenWindow(selected ? frame : null); 102 103 } -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r14012 r14138 38 38 import org.openstreetmap.josm.tools.ImageResource; 39 39 import org.openstreetmap.josm.tools.Logging; 40 import org.openstreetmap.josm.tools.PlatformManager; 40 41 import org.openstreetmap.josm.tools.Shortcut; 41 42 … … 287 288 public final void setTooltip(String tooltip) { 288 289 if (tooltip != null) { 289 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tooltip, sc));290 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tooltip, sc)); 290 291 } 291 292 } -
trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
r13727 r14138 45 45 import org.openstreetmap.josm.tools.Logging; 46 46 import org.openstreetmap.josm.tools.MultiMap; 47 import org.openstreetmap.josm.tools.PlatformManager; 47 48 import org.openstreetmap.josm.tools.Shortcut; 48 49 import org.openstreetmap.josm.tools.Utils; … … 135 136 for (final File file : files) { 136 137 if (file.exists()) { 137 this.files.add( Main.platform.resolveFileLink(file));138 this.files.add(PlatformManager.getPlatform().resolveFileLink(file)); 138 139 } else if (file.getParentFile() != null) { 139 140 // try to guess an extension using the specified fileFilter -
trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java
r13130 r14138 20 20 import org.openstreetmap.josm.spi.preferences.Config; 21 21 import org.openstreetmap.josm.tools.ImageProvider; 22 import org.openstreetmap.josm.tools.PlatformManager; 22 23 23 24 /** … … 96 97 if (!SaveActionBase.confirmOverwrite(newFile)) 97 98 return; 98 if ( Main.platform.rename(file, newFile)) {99 if (PlatformManager.getPlatform().rename(file, newFile)) { 99 100 layer.setAssociatedFile(newFile); 100 101 if (!layer.isRenamed()) { -
trunk/src/org/openstreetmap/josm/actions/RestartAction.java
r13843 r14138 16 16 import java.util.List; 17 17 18 import org.openstreetmap.josm.Main;19 18 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 20 19 import org.openstreetmap.josm.gui.MainApplication; … … 24 23 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 25 24 import org.openstreetmap.josm.tools.Logging; 25 import org.openstreetmap.josm.tools.PlatformManager; 26 26 import org.openstreetmap.josm.tools.Shortcut; 27 27 … … 92 92 final List<String> cmd; 93 93 // special handling for OSX .app package 94 if ( Main.isPlatformOsx() && getSystemProperty("java.library.path").contains("/JOSM.app/Contents/MacOS")) {94 if (PlatformManager.isPlatformOsx() && getSystemProperty("java.library.path").contains("/JOSM.app/Contents/MacOS")) { 95 95 cmd = getAppleCommands(); 96 96 } else { … … 177 177 private static String getJavaRuntime() throws IOException { 178 178 final String java = getSystemProperty("java.home") + File.separator + "bin" + File.separator + 179 ( Main.isPlatformWindows() ? "java.exe" : "java");179 (PlatformManager.isPlatformWindows() ? "java.exe" : "java"); 180 180 if (!new File(java).isFile()) { 181 181 throw new IOException("Unable to find suitable java runtime at "+java); -
trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
r14119 r14138 43 43 import org.openstreetmap.josm.tools.Logging; 44 44 import org.openstreetmap.josm.tools.PlatformHookUnixoid; 45 import org.openstreetmap.josm.tools.PlatformManager; 45 46 import org.openstreetmap.josm.tools.Shortcut; 46 47 import org.openstreetmap.josm.tools.Utils; … … 89 90 text.append(Version.getInstance().getReleaseAttributes()) 90 91 .append("\nIdentification: ").append(Version.getInstance().getAgentString()); 91 String buildNumber = Main.platform.getOSBuildNumber();92 String buildNumber = PlatformManager.getPlatform().getOSBuildNumber(); 92 93 if (!buildNumber.isEmpty()) { 93 94 text.append("\nOS Build number: ").append(buildNumber); … … 119 120 .append((int) maxScreenSize.getHeight()).append('\n'); 120 121 121 if (Main.platform instanceof PlatformHookUnixoid) { 122 if (PlatformManager.isPlatformUnixoid()) { 123 PlatformHookUnixoid platform = (PlatformHookUnixoid) PlatformManager.getPlatform(); 122 124 // Add Java package details 123 String packageDetails = ((PlatformHookUnixoid) Main.platform).getJavaPackageDetails();125 String packageDetails = platform.getJavaPackageDetails(); 124 126 if (packageDetails != null) { 125 127 text.append("Java package: ") … … 129 131 // Add WebStart package details if run from JNLP 130 132 if (isRunningJavaWebStart()) { 131 String webStartDetails = ((PlatformHookUnixoid) Main.platform).getWebStartPackageDetails();133 String webStartDetails = platform.getWebStartPackageDetails(); 132 134 if (webStartDetails != null) { 133 135 text.append("WebStart package: ") … … 137 139 } 138 140 // Add Gnome Atk wrapper details if found 139 String atkWrapperDetails = ((PlatformHookUnixoid) Main.platform).getAtkWrapperPackageDetails();141 String atkWrapperDetails = platform.getAtkWrapperPackageDetails(); 140 142 if (atkWrapperDetails != null) { 141 143 text.append("Java ATK Wrapper package: ") … … 230 232 private static String paramCleanup(String param) { 231 233 final String envJavaHome = getSystemEnv("JAVA_HOME"); 232 final String envJavaHomeAlt = Main.isPlatformWindows() ? "%JAVA_HOME%" : "${JAVA_HOME}";234 final String envJavaHomeAlt = PlatformManager.isPlatformWindows() ? "%JAVA_HOME%" : "${JAVA_HOME}"; 233 235 final String propJavaHome = getSystemProperty("java.home"); 234 236 final String propJavaHomeAlt = "<java.home>"; … … 240 242 final String userCacheDirAlt = "<josm.cache>"; 241 243 final String userHomeDir = getSystemProperty("user.home"); 242 final String userHomeDirAlt = Main.isPlatformWindows() ? "%UserProfile%" : "${HOME}";244 final String userHomeDirAlt = PlatformManager.isPlatformWindows() ? "%UserProfile%" : "${HOME}"; 243 245 final String userName = getSystemProperty("user.name"); 244 246 final String userNameAlt = "<user.name>"; -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r14134 r14138 58 58 import org.openstreetmap.josm.tools.Logging; 59 59 import org.openstreetmap.josm.tools.Pair; 60 import org.openstreetmap.josm.tools.PlatformManager; 60 61 import org.openstreetmap.josm.tools.Shortcut; 61 62 import org.openstreetmap.josm.tools.Utils; … … 343 344 c = "lasso"; 344 345 } else { 345 c = "rect" + (shift ? "_add" : (ctrl && ! Main.isPlatformOsx() ? "_rm" : ""));346 c = "rect" + (shift ? "_add" : (ctrl && !PlatformManager.isPlatformOsx() ? "_rm" : "")); 346 347 } 347 348 break; … … 446 447 case SELECT: 447 448 default: 448 if (!(ctrl && Main.isPlatformOsx())) {449 if (!(ctrl && PlatformManager.isPlatformOsx())) { 449 450 // start working with rectangle or lasso 450 451 selectionManager.register(mv, lassoMode); … … 462 463 public void mouseMoved(MouseEvent e) { 463 464 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 464 if ( Main.isPlatformOsx() && (mode == Mode.ROTATE || mode == Mode.SCALE)) {465 if (PlatformManager.isPlatformOsx() && (mode == Mode.ROTATE || mode == Mode.SCALE)) { 465 466 mouseDragged(e); 466 467 return; … … 490 491 if (mode == Mode.SELECT) { 491 492 // Unregisters selectionManager if ctrl has been pressed after mouse click on Mac OS X in order to move the map 492 if (ctrl && Main.isPlatformOsx()) {493 if (ctrl && PlatformManager.isPlatformOsx()) { 493 494 selectionManager.unregister(mv); 494 495 // Make sure correct cursor is displayed -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r14122 r14138 52 52 import org.openstreetmap.josm.tools.ListenerList; 53 53 import org.openstreetmap.josm.tools.Logging; 54 import org.openstreetmap.josm.tools.PlatformManager; 54 55 import org.openstreetmap.josm.tools.Utils; 55 56 import org.xml.sax.SAXException; … … 280 281 addPossibleResourceDir(locations, getSystemEnv("JOSM_RESOURCES")); 281 282 addPossibleResourceDir(locations, getSystemProperty("josm.resources")); 282 if ( Main.isPlatformWindows()) {283 if (PlatformManager.isPlatformWindows()) { 283 284 String appdata = getSystemEnv("APPDATA"); 284 285 if (appdata != null && getSystemEnv("ALLUSERSPROFILE") != null … … 521 522 } else if (reset) { 522 523 File backupFile = new File(prefDir, "preferences.xml.bak"); 523 Main.platform.rename(preferenceFile, backupFile);524 PlatformManager.getPlatform().rename(preferenceFile, backupFile); 524 525 Logging.warn(tr("Replacing existing preference file ''{0}'' with default preference file.", preferenceFile.getAbsoluteFile())); 525 526 resetToDefault(); … … 555 556 ); 556 557 } 557 Main.platform.rename(preferenceFile, backupFile);558 PlatformManager.getPlatform().rename(preferenceFile, backupFile); 558 559 try { 559 560 resetToDefault(); -
trunk/src/org/openstreetmap/josm/data/Version.java
r13647 r14138 10 10 import java.util.Properties; 11 11 12 import org.openstreetmap.josm.Main;13 12 import org.openstreetmap.josm.tools.LanguageInfo; 14 13 import org.openstreetmap.josm.tools.Logging; 14 import org.openstreetmap.josm.tools.PlatformManager; 15 15 import org.openstreetmap.josm.tools.Utils; 16 16 … … 187 187 } 188 188 String result = "JOSM/1.5 ("+ s+' '+LanguageInfo.getJOSMLocaleCode()+')'; 189 if (includeOsDetails && Main.platform != null) {190 result += ' ' + Main.platform.getOSDescription();189 if (includeOsDetails) { 190 result += ' ' + PlatformManager.getPlatform().getOSDescription(); 191 191 } 192 192 return result; -
trunk/src/org/openstreetmap/josm/data/preferences/JosmBaseDirectories.java
r14052 r14138 14 14 import org.openstreetmap.josm.spi.preferences.IBaseDirectories; 15 15 import org.openstreetmap.josm.tools.Logging; 16 import org.openstreetmap.josm.tools.PlatformManager; 16 17 17 18 /** … … 63 64 preferencesDir = new File(path).getAbsoluteFile(); 64 65 } else { 65 preferencesDir = Main.platform.getDefaultPrefDirectory();66 preferencesDir = PlatformManager.getPlatform().getDefaultPrefDirectory(); 66 67 } 67 68 } … … 96 97 userdataDir = new File(path).getAbsoluteFile(); 97 98 } else { 98 userdataDir = Main.platform.getDefaultUserDataDirectory();99 userdataDir = PlatformManager.getPlatform().getDefaultUserDataDirectory(); 99 100 } 100 101 } … … 133 134 cacheDir = new File(path).getAbsoluteFile(); 134 135 } else { 135 cacheDir = Main.platform.getDefaultCacheDirectory();136 cacheDir = PlatformManager.getPlatform().getDefaultCacheDirectory(); 136 137 } 137 138 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r14135 r14138 178 178 import org.openstreetmap.josm.tools.PlatformHook.NativeOsCallback; 179 179 import org.openstreetmap.josm.tools.PlatformHookWindows; 180 import org.openstreetmap.josm.tools.PlatformManager; 180 181 import org.openstreetmap.josm.tools.RightAndLefthandTraffic; 181 182 import org.openstreetmap.josm.tools.Shortcut; … … 386 387 StringBuilder content = new StringBuilder(tr("You are running version {0} of Java.", 387 388 "<b>"+getSystemProperty("java.version")+"</b>")).append("<br><br>"); 388 if ("Sun Microsystems Inc.".equals(getSystemProperty("java.vendor")) && ! platform.isOpenJDK()) {389 if ("Sun Microsystems Inc.".equals(getSystemProperty("java.vendor")) && !PlatformManager.getPlatform().isOpenJDK()) { 389 390 content.append("<b>").append(tr("This version is no longer supported by {0} since {1} and is not recommended for use.", 390 391 "Oracle", eolDate)).append("</b><br><br>"); … … 400 401 if (ed.showDialog().getValue() == 2) { 401 402 try { 402 platform.openUrl(url);403 PlatformManager.getPlatform().openUrl(url); 403 404 } catch (IOException e) { 404 405 Logging.warn(e); … … 412 413 return Arrays.asList( 413 414 new InitializationTask(tr("Starting file watcher"), FileWatcher.getDefaultInstance()::start), 414 new InitializationTask(tr("Executing platform startup hook"), () -> platform.startupHook(MainApplication::askUpdateJava)), 415 new InitializationTask(tr("Executing platform startup hook"), 416 () -> PlatformManager.getPlatform().startupHook(MainApplication::askUpdateJava)), 415 417 new InitializationTask(tr("Building main menu"), this::initializeMainWindow), 416 418 new InitializationTask(tr("Updating user interface"), () -> { … … 831 833 align("\t-Djosm.dir.name=JOSM") + tr("Change the JOSM directory name") + "\n\n" + 832 834 align("\t-Djosm.pref=" + tr("/PATH/TO/JOSM/PREF ")) + tr("Set the preferences directory") + "\n" + 833 align("\t") + tr("Default: {0}", platform.getDefaultPrefDirectory()) + "\n\n" +835 align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultPrefDirectory()) + "\n\n" + 834 836 align("\t-Djosm.userdata=" + tr("/PATH/TO/JOSM/USERDATA")) + tr("Set the user data directory") + "\n" + 835 align("\t") + tr("Default: {0}", platform.getDefaultUserDataDirectory()) + "\n\n" +837 align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultUserDataDirectory()) + "\n\n" + 836 838 align("\t-Djosm.cache=" + tr("/PATH/TO/JOSM/CACHE ")) + tr("Set the cache directory") + "\n" + 837 align("\t") + tr("Default: {0}", platform.getDefaultCacheDirectory()) + "\n\n" +839 align("\t") + tr("Default: {0}", PlatformManager.getPlatform().getDefaultCacheDirectory()) + "\n\n" + 838 840 align("\t-Djosm.home=" + tr("/PATH/TO/JOSM/HOMEDIR ")) + 839 841 tr("Set the preferences+data+cache directory (cache directory will be josm.home/cache)")+"\n\n"+ … … 927 929 928 930 // initialize the platform hook, and 929 Main.determinePlatformHook(); 930 Main.platform.setNativeOsCallback(new DefaultNativeOsCallback()); 931 PlatformManager.getPlatform().setNativeOsCallback(new DefaultNativeOsCallback()); 931 932 // call the really early hook before we do anything else 932 Main.platform.preStartupHook();933 PlatformManager.getPlatform().preStartupHook(); 933 934 934 935 Config.setPreferencesInstance(Main.pref); … … 978 979 processOffline(args); 979 980 980 Main.platform.afterPrefStartupHook();981 PlatformManager.getPlatform().afterPrefStartupHook(); 981 982 982 983 applyWorkarounds(); … … 1111 1112 SwingUtilities.invokeLater(new GuiFinalizationWorker(args, proxySelector)); 1112 1113 1113 if ( Main.isPlatformWindows()) {1114 if (PlatformManager.isPlatformWindows()) { 1114 1115 try { 1115 1116 // Check for insecure certificates to remove. … … 1187 1188 // To remove during Java 9 migration 1188 1189 if (getSystemProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows 10") && 1189 platform.getDefaultStyle().equals(LafPreference.LAF.get())) {1190 PlatformManager.getPlatform().getDefaultStyle().equals(LafPreference.LAF.get())) { 1190 1191 try { 1191 1192 String build = PlatformHookWindows.getCurrentBuild(); … … 1229 1230 1230 1231 static void setupUIManager() { 1231 String defaultlaf = platform.getDefaultStyle();1232 String defaultlaf = PlatformManager.getPlatform().getDefaultStyle(); 1232 1233 String laf = LafPreference.LAF.get(); 1233 1234 try { -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r14134 r14138 25 25 import javax.swing.event.MenuListener; 26 26 27 import org.openstreetmap.josm.Main;28 27 import org.openstreetmap.josm.actions.AboutAction; 29 28 import org.openstreetmap.josm.actions.AddNodeAction; … … 125 124 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetSearchPrimitiveDialog; 126 125 import org.openstreetmap.josm.spi.preferences.Config; 126 import org.openstreetmap.josm.tools.PlatformManager; 127 127 import org.openstreetmap.josm.tools.Shortcut; 128 128 … … 734 734 viewportFollowToggleAction.addButtonModel(vft.getModel()); 735 735 736 if ( Main.platform.canFullscreen()) {736 if (PlatformManager.getPlatform().canFullscreen()) { 737 737 // -- fullscreen toggle action 738 738 fullscreenToggleAction = new FullscreenToggleAction(); -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r13987 r14138 17 17 18 18 import org.openstreetmap.gui.jmapviewer.JMapViewer; 19 import org.openstreetmap.josm.Main;20 19 import org.openstreetmap.josm.actions.mapmode.SelectAction; 21 20 import org.openstreetmap.josm.data.coor.EastNorth; … … 28 27 import org.openstreetmap.josm.tools.Destroyable; 29 28 import org.openstreetmap.josm.tools.Pair; 29 import org.openstreetmap.josm.tools.PlatformManager; 30 30 import org.openstreetmap.josm.tools.Shortcut; 31 31 … … 145 145 146 146 // see #10592 - Disable these alternate shortcuts on OS X because of conflict with system shortcut 147 if (! Main.isPlatformOsx()) {147 if (!PlatformManager.isPlatformOsx()) { 148 148 registerActionShortcut(new ZoomerAction(",", "MapMover.Zoomer.in"), 149 149 Shortcut.registerShortcut("view:zoominalternate", tr("Map: {0}", tr("Zoom In")), KeyEvent.VK_COMMA, Shortcut.CTRL)); … … 175 175 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK; 176 176 boolean allowMovement = (e.getModifiersEx() & (MouseEvent.BUTTON3_DOWN_MASK | offMask)) == MouseEvent.BUTTON3_DOWN_MASK; 177 if ( Main.isPlatformOsx()) {177 if (PlatformManager.isPlatformOsx()) { 178 178 MapFrame map = MainApplication.getMap(); 179 179 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; … … 207 207 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; 208 208 if ((e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0) || 209 ( Main.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) {209 (PlatformManager.isPlatformOsx() && e.getModifiersEx() == macMouseMask)) { 210 210 startMovement(e); 211 211 } … … 217 217 @Override 218 218 public void mouseReleased(MouseEvent e) { 219 if (e.getButton() == MouseEvent.BUTTON3 || ( Main.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) {219 if (e.getButton() == MouseEvent.BUTTON3 || (PlatformManager.isPlatformOsx() && e.getButton() == MouseEvent.BUTTON1)) { 220 220 endMovement(); 221 221 } … … 267 267 // Mac OSX simulates with ctrl + mouse 1 the second mouse button hence no dragging events get fired. 268 268 // Is only the selected mouse button pressed? 269 if ( Main.isPlatformOsx()) {269 if (PlatformManager.isPlatformOsx()) { 270 270 if (e.getModifiersEx() == MouseEvent.CTRL_DOWN_MASK) { 271 271 doMoveForDrag(e); -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r12537 r14138 18 18 import javax.swing.KeyStroke; 19 19 20 import org.openstreetmap.josm. Main;20 import org.openstreetmap.josm.tools.PlatformManager; 21 21 22 22 /** … … 122 122 @Override 123 123 public void mousePressed(MouseEvent e) { 124 if (e.getButton() == MouseEvent.BUTTON1 && !( Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {124 if (e.getButton() == MouseEvent.BUTTON1 && !(PlatformManager.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 125 125 iStartSelectionPoint = e.getPoint(); 126 126 iEndSelectionPoint = e.getPoint(); … … 131 131 public void mouseDragged(MouseEvent e) { 132 132 if (iStartSelectionPoint != null && (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK 133 && !( Main.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) {133 && !(PlatformManager.isPlatformOsx() && e.getModifiersEx() == MAC_MOUSE_BUTTON3_MASK)) { 134 134 iEndSelectionPoint = e.getPoint(); 135 135 iSlippyMapChooser.setSelection(iStartSelectionPoint, iEndSelectionPoint); -
trunk/src/org/openstreetmap/josm/gui/bugreport/JosmUpdatePanel.java
r14119 r14138 12 12 import javax.swing.SwingUtilities; 13 13 14 import org.openstreetmap.josm.Main;15 14 import org.openstreetmap.josm.data.Version; 16 15 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; … … 21 20 import org.openstreetmap.josm.tools.ImageProvider; 22 21 import org.openstreetmap.josm.tools.Logging; 22 import org.openstreetmap.josm.tools.PlatformManager; 23 23 24 24 /** … … 100 100 private static void openJosmUpdateSite() { 101 101 try { 102 Main.platform.openUrl(Config.getUrls().getJOSMWebsite());102 PlatformManager.getPlatform().openUrl(Config.getUrls().getJOSMWebsite()); 103 103 } catch (IOException ex) { 104 104 Logging.log(Logging.LEVEL_WARN, "Unable to access JOSM website:", ex); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r14102 r14138 25 25 import javax.swing.table.TableModel; 26 26 27 import org.openstreetmap.josm.Main;28 27 import org.openstreetmap.josm.actions.mapmode.MapMode; 29 28 import org.openstreetmap.josm.actions.search.SearchAction; … … 50 49 import org.openstreetmap.josm.tools.ImageProvider; 51 50 import org.openstreetmap.josm.tools.InputMapUtils; 51 import org.openstreetmap.josm.tools.PlatformManager; 52 52 import org.openstreetmap.josm.tools.Shortcut; 53 53 … … 103 103 104 104 private static final String[] COLUMN_TOOLTIPS = { 105 Main.platform.makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT),106 Main.platform.makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT),105 PlatformManager.getPlatform().makeTooltip(tr("Enable filter"), ENABLE_FILTER_SHORTCUT), 106 PlatformManager.getPlatform().makeTooltip(tr("Hiding filter"), HIDING_FILTER_SHORTCUT), 107 107 null, 108 108 tr("Inverse filter"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r14009 r14138 42 42 import javax.swing.table.TableModel; 43 43 44 import org.openstreetmap.josm.Main;45 44 import org.openstreetmap.josm.actions.MergeLayerAction; 46 45 import org.openstreetmap.josm.data.coor.EastNorth; … … 83 82 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 84 83 import org.openstreetmap.josm.tools.InputMapUtils; 84 import org.openstreetmap.josm.tools.PlatformManager; 85 85 import org.openstreetmap.josm.tools.Shortcut; 86 86 … … 229 229 // Disable some default JTable shortcuts to use JOSM ones (see #5678, #10458) 230 230 for (KeyStroke ks : new KeyStroke[] { 231 KeyStroke.getKeyStroke(KeyEvent.VK_C, Main.platform.getMenuShortcutKeyMaskEx()),232 KeyStroke.getKeyStroke(KeyEvent.VK_V, Main.platform.getMenuShortcutKeyMaskEx()),231 KeyStroke.getKeyStroke(KeyEvent.VK_C, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), 232 KeyStroke.getKeyStroke(KeyEvent.VK_V, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), 233 233 KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_DOWN_MASK), 234 234 KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_DOWN_MASK), -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r13957 r14138 33 33 import javax.swing.event.PopupMenuListener; 34 34 35 import org.openstreetmap.josm.Main;36 35 import org.openstreetmap.josm.actions.ExpertToggleAction; 37 36 import org.openstreetmap.josm.actions.IPrimitiveAction; … … 88 87 import org.openstreetmap.josm.tools.ImageProvider; 89 88 import org.openstreetmap.josm.tools.InputMapUtils; 89 import org.openstreetmap.josm.tools.PlatformManager; 90 90 import org.openstreetmap.josm.tools.Shortcut; 91 91 import org.openstreetmap.josm.tools.SubclassFilteredCollection; … … 202 202 // Do not hide copy action because of default JList override (fix #9815) 203 203 displaylist.getActionMap().put("copy", MainApplication.getMenu().copy); 204 displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, Main.platform.getMenuShortcutKeyMaskEx()), "copy");204 displaylist.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_C, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), "copy"); 205 205 206 206 updateActionsRelationLists(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r14134 r14138 94 94 import org.openstreetmap.josm.tools.GBC; 95 95 import org.openstreetmap.josm.tools.Logging; 96 import org.openstreetmap.josm.tools.PlatformManager; 96 97 import org.openstreetmap.josm.tools.Shortcut; 97 98 import org.openstreetmap.josm.tools.Utils; … … 817 818 @Override 818 819 public void setContentPane(Container contentPane) { 819 final int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx();820 final int commandDownMask = PlatformManager.getPlatform().getMenuShortcutKeyMaskEx(); 820 821 List<String> lines = new ArrayList<>(); 821 822 Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask).ifPresent(sc -> -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/DownloadIncompleteMembersAction.java
r14030 r14138 8 8 import java.awt.event.KeyEvent; 9 9 10 import org.openstreetmap.josm.Main;11 10 import org.openstreetmap.josm.gui.MainApplication; 12 11 import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationMemberTask; 13 12 import org.openstreetmap.josm.tools.ImageProvider; 13 import org.openstreetmap.josm.tools.PlatformManager; 14 14 import org.openstreetmap.josm.tools.Shortcut; 15 15 … … 31 31 KeyEvent.VK_HOME, Shortcut.ALT); 32 32 sc.setAccelerator(this); 33 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Download all incomplete members"), sc));33 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Download all incomplete members"), sc)); 34 34 new ImageProvider("dialogs/relation", "downloadincomplete").getResource().attachImageIcon(this, true); 35 35 putValue(NAME, tr("Download members")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveDownAction.java
r14030 r14138 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.tools.ImageProvider; 10 import org.openstreetmap.josm.tools.PlatformManager; 11 11 import org.openstreetmap.josm.tools.Shortcut; 12 12 … … 28 28 Shortcut sc = Shortcut.registerShortcut("relationeditor:movedown", tr("Relation Editor: Move Down"), KeyEvent.VK_DOWN, Shortcut.ALT); 29 29 sc.setAccelerator(this); 30 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Move the currently selected members down"), sc));30 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members down"), sc)); 31 31 setEnabled(false); 32 32 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/MoveUpAction.java
r14030 r14138 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.tools.ImageProvider; 10 import org.openstreetmap.josm.tools.PlatformManager; 11 11 import org.openstreetmap.josm.tools.Shortcut; 12 12 … … 28 28 Shortcut sc = Shortcut.registerShortcut("relationeditor:moveup", tr("Relation Editor: Move Up"), KeyEvent.VK_UP, Shortcut.ALT); 29 29 sc.setAccelerator(this); 30 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Move the currently selected members up"), sc));30 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Move the currently selected members up"), sc)); 31 31 setEnabled(false); 32 32 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RefreshAction.java
r14134 r14138 19 19 import org.openstreetmap.josm.gui.dialogs.relation.IRelationEditor; 20 20 import org.openstreetmap.josm.tools.ImageProvider; 21 import org.openstreetmap.josm.tools.PlatformManager; 21 22 import org.openstreetmap.josm.tools.Shortcut; 22 23 … … 37 38 Shortcut sc = Shortcut.registerShortcut("relationeditor:refresh", tr("Relation Editor: Refresh"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE); 38 39 // CHECKSTYLE.ON: LineLength 39 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Refresh relation from data layer"), sc));40 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Refresh relation from data layer"), sc)); 40 41 new ImageProvider("dialogs/refresh").getResource().attachImageIcon(this, true); 41 42 putValue(NAME, tr("Refresh")); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/RemoveAction.java
r14030 r14138 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.tools.ImageProvider; 10 import org.openstreetmap.josm.tools.PlatformManager; 11 11 import org.openstreetmap.josm.tools.Shortcut; 12 12 … … 29 29 Shortcut sc = Shortcut.registerShortcut("relationeditor:remove", tr("Relation Editor: Remove"), KeyEvent.VK_DELETE, Shortcut.ALT); 30 30 sc.setAccelerator(this); 31 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Remove the currently selected members from this relation"), sc)); 31 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip( 32 tr("Remove the currently selected members from this relation"), sc)); 32 33 setEnabled(false); 33 34 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/actions/SortAction.java
r14030 r14138 7 7 import java.awt.event.KeyEvent; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.tools.ImageProvider; 10 import org.openstreetmap.josm.tools.PlatformManager; 11 11 import org.openstreetmap.josm.tools.Shortcut; 12 12 … … 28 28 Shortcut sc = Shortcut.registerShortcut("relationeditor:sort", tr("Relation Editor: Sort"), KeyEvent.VK_END, Shortcut.ALT); 29 29 sc.setAccelerator(this); 30 putValue(SHORT_DESCRIPTION, Main.platform.makeTooltip(tr("Sort the relation members"), sc));30 putValue(SHORT_DESCRIPTION, PlatformManager.getPlatform().makeTooltip(tr("Sort the relation members"), sc)); 31 31 updateEnabledState(); 32 32 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r13843 r14138 77 77 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 78 78 import org.openstreetmap.josm.tools.Logging; 79 import org.openstreetmap.josm.tools.PlatformManager; 79 80 import org.openstreetmap.josm.tools.Shortcut; 80 81 … … 1260 1261 tt = tt.substring(6, tt.length()-6); 1261 1262 } 1262 tt = Main.platform.makeTooltip(tt, sc);1263 tt = PlatformManager.getPlatform().makeTooltip(tt, sc); 1263 1264 } 1264 1265 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r13142 r14138 24 24 import javax.swing.UIManager.LookAndFeelInfo; 25 25 26 import org.openstreetmap.josm.Main;27 26 import org.openstreetmap.josm.actions.ExpertToggleAction; 28 27 import org.openstreetmap.josm.data.preferences.StringProperty; … … 42 41 import org.openstreetmap.josm.tools.GBC; 43 42 import org.openstreetmap.josm.tools.Logging; 43 import org.openstreetmap.josm.tools.PlatformManager; 44 44 import org.openstreetmap.josm.tools.date.DateUtils; 45 45 … … 53 53 * @since 11713 54 54 */ 55 public static final StringProperty LAF = new StringProperty("laf", Main.platform.getDefaultStyle());55 public static final StringProperty LAF = new StringProperty("laf", PlatformManager.getPlatform().getDefaultStyle()); 56 56 57 57 static final class LafListCellRenderer implements ListCellRenderer<LookAndFeelInfo> { … … 97 97 98 98 // let's try to load additional LookAndFeels and put them into the list 99 if ( Main.isPlatformOsx()) {99 if (PlatformManager.isPlatformOsx()) { 100 100 try { 101 101 Class<?> cquaqua = Class.forName("ch.randelshofer.quaqua.QuaquaLookAndFeel"); -
trunk/src/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreference.java
r13431 r14138 27 27 import javax.swing.JSeparator; 28 28 29 import org.openstreetmap.josm.Main;30 29 import org.openstreetmap.josm.gui.help.HelpUtil; 31 30 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting; … … 43 42 import org.openstreetmap.josm.tools.Logging; 44 43 import org.openstreetmap.josm.tools.PlatformHookWindows; 44 import org.openstreetmap.josm.tools.PlatformManager; 45 45 46 46 /** … … 114 114 115 115 // Certificate installation only available on Windows for now, see #10033 116 if ( Main.isPlatformWindows()) {116 if (PlatformManager.isPlatformWindows()) { 117 117 installCertificate = new JButton(tr("Install...")); 118 118 uninstallCertificate = new JButton(tr("Uninstall...")); -
trunk/src/org/openstreetmap/josm/gui/widgets/FileChooserManager.java
r12846 r14138 16 16 import org.openstreetmap.josm.data.preferences.BooleanProperty; 17 17 import org.openstreetmap.josm.spi.preferences.Config; 18 import org.openstreetmap.josm.tools.PlatformManager; 18 19 19 20 /** … … 33 34 public static final BooleanProperty PROP_USE_NATIVE_FILE_DIALOG = new BooleanProperty("use.native.file.dialog", 34 35 // Native dialogs do not support file filters, so do not set them as default, except for OS X where they never worked 35 Main.isPlatformOsx());36 PlatformManager.isPlatformOsx()); 36 37 37 38 private final boolean open; -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r13206 r14138 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.tools.PlatformManager; 16 17 import org.openstreetmap.josm.tools.Utils; 17 18 … … 138 139 @Override 139 140 public int showOpenDialog(Component parent) { 140 boolean appleProperty = Main.isPlatformOsx() && selectionMode == JFileChooser.DIRECTORIES_ONLY;141 boolean appleProperty = PlatformManager.isPlatformOsx() && selectionMode == JFileChooser.DIRECTORIES_ONLY; 141 142 if (appleProperty) { 142 143 Utils.updateSystemProperty("apple.awt.fileDialogForDirectories", "true"); … … 176 177 // http://stackoverflow.com/questions/1224714/how-can-i-make-a-java-filedialog-accept-directories-as-its-filetype-in-os-x/1224744#1224744 177 178 // CHECKSTYLE.ON: LineLength 178 return Main.isPlatformOsx();179 return PlatformManager.isPlatformOsx(); 179 180 case JFileChooser.FILES_ONLY: 180 181 default: -
trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
r13974 r14138 24 24 import javax.swing.undo.UndoManager; 25 25 26 import org.openstreetmap.josm.Main;27 26 import org.openstreetmap.josm.spi.preferences.Config; 28 27 import org.openstreetmap.josm.tools.ImageProvider; 29 28 import org.openstreetmap.josm.tools.Logging; 29 import org.openstreetmap.josm.tools.PlatformManager; 30 30 31 31 /** … … 95 95 if (!GraphicsEnvironment.isHeadless()) { 96 96 component.getInputMap().put( 97 KeyStroke.getKeyStroke(KeyEvent.VK_Z, Main.platform.getMenuShortcutKeyMaskEx()), undoAction);97 KeyStroke.getKeyStroke(KeyEvent.VK_Z, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), undoAction); 98 98 component.getInputMap().put( 99 KeyStroke.getKeyStroke(KeyEvent.VK_Y, Main.platform.getMenuShortcutKeyMaskEx()), redoAction);99 KeyStroke.getKeyStroke(KeyEvent.VK_Y, PlatformManager.getPlatform().getMenuShortcutKeyMaskEx()), redoAction); 100 100 } 101 101 } -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r14119 r14138 34 34 import org.openstreetmap.josm.tools.Logging; 35 35 import org.openstreetmap.josm.tools.Pair; 36 import org.openstreetmap.josm.tools.PlatformManager; 36 37 import org.openstreetmap.josm.tools.Utils; 37 38 … … 521 522 activeConnection = null; 522 523 localFile = new File(destDir, localPath); 523 if ( Main.platform.rename(destDirFile, localFile)) {524 if (PlatformManager.getPlatform().rename(destDirFile, localFile)) { 524 525 Config.getPref().putList(prefKey, 525 526 Arrays.asList(Long.toString(System.currentTimeMillis()), localFile.toString())); … … 549 550 // Windows doesn't support paths longer than 260, leave 5 chars as safe buffer, 4 will be used by ".tmp" 550 551 // TODO: what about filename size on other systems? 255? 551 if (directory.length() > 191 && Main.isPlatformWindows()) {552 if (directory.length() > 191 && PlatformManager.isPlatformWindows()) { 552 553 // digest length + name prefix == 64 553 554 // 255 - 64 = 191 -
trunk/src/org/openstreetmap/josm/io/CertificateAmendment.java
r13822 r14138 27 27 import javax.net.ssl.TrustManagerFactory; 28 28 29 import org.openstreetmap.josm.Main;30 29 import org.openstreetmap.josm.spi.preferences.Config; 31 30 import org.openstreetmap.josm.tools.Logging; 31 import org.openstreetmap.josm.tools.PlatformManager; 32 32 import org.openstreetmap.josm.tools.Utils; 33 33 … … 227 227 // Try to add platform certificates. Do not exit in case of error (embedded certificates may be OK) 228 228 for (NativeCertAmend certAmend : PLATFORM_CERT_AMEND) { 229 X509Certificate cert = Main.platform.getX509Certificate(certAmend);229 X509Certificate cert = PlatformManager.getPlatform().getX509Certificate(certAmend); 230 230 if (checkAndAddCertificate(md, cert, certAmend, keyStore)) { 231 231 certificateAdded = true; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpsServer.java
r13679 r14138 39 39 import javax.net.ssl.TrustManagerFactory; 40 40 41 import org.openstreetmap.josm.Main;42 41 import org.openstreetmap.josm.data.preferences.StringProperty; 43 42 import org.openstreetmap.josm.spi.preferences.Config; 44 43 import org.openstreetmap.josm.tools.Logging; 44 import org.openstreetmap.josm.tools.PlatformManager; 45 45 46 46 import sun.security.util.ObjectIdentifier; … … 301 301 Enumeration<String> aliases = josmKs.aliases(); 302 302 if (aliases.hasMoreElements()) { 303 return Main.platform.setupHttpsCertificate(ENTRY_ALIAS,303 return PlatformManager.getPlatform().setupHttpsCertificate(ENTRY_ALIAS, 304 304 new KeyStore.TrustedCertificateEntry(josmKs.getCertificate(aliases.nextElement()))); 305 305 } -
trunk/src/org/openstreetmap/josm/tools/KeyboardUtils.java
r14022 r14138 9 9 import java.util.Locale; 10 10 import java.util.Map; 11 12 import org.openstreetmap.josm.Main;13 11 14 12 /** … … 293 291 // UK Apple, https://en.wikipedia.org/wiki/QWERTY#UK_Apple_keyboard 294 292 // International English Apple, https://en.wikipedia.org/wiki/QWERTY#Apple_International_English_Keyboard 295 if ( Main.isPlatformOsx()) {293 if (PlatformManager.isPlatformOsx()) { 296 294 result.add('§'); // https://en.wikipedia.org/wiki/Section_sign 297 295 } -
trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
r12620 r14138 25 25 26 26 private static void displayUrlFallback(URI uri) throws IOException { 27 if ( Main.platform == null)27 if (PlatformManager.getPlatform() == null) 28 28 throw new IllegalStateException(tr("Failed to open URL. There is currently no platform set. Please set a platform first.")); 29 Main.platform.openUrl(uri.toString());29 PlatformManager.getPlatform().openUrl(uri.toString()); 30 30 } 31 31 … … 45 45 if (Desktop.isDesktopSupported()) { 46 46 try { 47 if ( Main.isPlatformWindows()) {47 if (PlatformManager.isPlatformWindows()) { 48 48 // 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 49 49 Desktop.getDesktop().browse(uri); 50 } else if ( Main.platforminstanceofPlatformHookUnixoid || Main.platform instanceofPlatformHookOsx) {50 } else if (PlatformManager.isPlatformUnixoid() || PlatformManager.isPlatformOsx()) { 51 51 // see #5629 #5108 #9568 52 Main.platform.openUrl(uri.toString());52 PlatformManager.getPlatform().openUrl(uri.toString()); 53 53 } else { 54 54 // This is not the case with some Linux environments (see below), -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r14017 r14138 371 371 if (initdone) return; 372 372 initdone = true; 373 int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx();373 int commandDownMask = PlatformManager.getPlatform().getMenuShortcutKeyMaskEx(); 374 374 groups.put(NONE, -1); 375 375 groups.put(MNEMONIC, KeyEvent.ALT_DOWN_MASK); … … 384 384 385 385 // (1) System reserved shortcuts 386 Main.platform.initSystemShortcuts();386 PlatformManager.getPlatform().initSystemShortcuts(); 387 387 // (2) User defined shortcuts 388 388 Main.pref.getAllPrefixCollectionKeys("shortcut.entry.").stream() … … 507 507 } else if (existing.isPresent()) { 508 508 final Shortcut conflict = existing.get(); 509 if ( Main.isPlatformOsx()) {509 if (PlatformManager.isPlatformOsx()) { 510 510 // Try to reassign Meta to Ctrl 511 511 int newmodifier = findNewOsxModifier(requestedGroup); -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/StyleCacheTest.java
r13636 r14138 52 52 @Rule 53 53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 54 public JOSMTestRules test = new JOSMTestRules().preferences().p latform().projection().mapStyles().timeout(60000);54 public JOSMTestRules test = new JOSMTestRules().preferences().projection().mapStyles().timeout(60000); 55 55 56 56 /** -
trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java
r14125 r14138 31 31 import org.openstreetmap.josm.tools.JosmRuntimeException; 32 32 import org.openstreetmap.josm.tools.Logging; 33 import org.openstreetmap.josm.tools.PlatformManager; 33 34 import org.openstreetmap.josm.tools.date.DateUtils; 34 35 … … 108 109 I18n.init(); 109 110 // initialize the plaform hook, and 110 Main.determinePlatformHook();111 111 // call the really early hook before we anything else 112 Main.platform.preStartupHook();112 PlatformManager.getPlatform().preStartupHook(); 113 113 114 114 Logging.setLogLevel(Logging.LEVEL_INFO); -
trunk/test/unit/org/openstreetmap/josm/MainTest.java
r14125 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules(). platform().https().devAPI().main().projection();23 public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/actions/AddImageryLayerActionTest.java
r13733 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().preferences(). platform().fakeAPI();35 public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI(); 36 36 37 37 /** -
trunk/test/unit/org/openstreetmap/josm/actions/CopyActionTest.java
r12636 r14138 47 47 @Rule 48 48 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 49 public JOSMTestRules test = new JOSMTestRules().preferences(). platform().fakeAPI();49 public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI(); 50 50 51 51 /** -
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r12636 r14138 38 38 @Rule 39 39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 40 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();40 public JOSMTestRules test = new JOSMTestRules().projection().main(); 41 41 42 42 /** -
trunk/test/unit/org/openstreetmap/josm/actions/DeleteLayerActionTest.java
r12636 r14138 24 24 @Rule 25 25 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 26 public JOSMTestRules test = new JOSMTestRules() .platform();26 public JOSMTestRules test = new JOSMTestRules(); 27 27 28 28 /** -
trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
r14126 r14138 29 29 @Rule 30 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules test = new JOSMTestRules(). platform().main();31 public JOSMTestRules test = new JOSMTestRules().main(); 32 32 33 33 /** -
trunk/test/unit/org/openstreetmap/josm/actions/ExpertToggleActionTest.java
r11224 r14138 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();29 public JOSMTestRules test = new JOSMTestRules().preferences(); 30 30 31 31 /** -
trunk/test/unit/org/openstreetmap/josm/actions/FullscreenToggleActionTest.java
r12562 r14138 17 17 @Rule 18 18 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 19 public JOSMTestRules test = new JOSMTestRules(). platform().main();19 public JOSMTestRules test = new JOSMTestRules().main(); 20 20 21 21 /** -
trunk/test/unit/org/openstreetmap/josm/actions/JoinAreasActionTest.java
r13950 r14138 49 49 @Rule 50 50 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 51 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection();51 public JOSMTestRules test = new JOSMTestRules().main().projection(); 52 52 53 53 /** -
trunk/test/unit/org/openstreetmap/josm/actions/MergeLayerActionTest.java
r12636 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). platform().main();28 public JOSMTestRules test = new JOSMTestRules().main(); 29 29 30 30 private MergeLayerAction action; -
trunk/test/unit/org/openstreetmap/josm/actions/MergeNodesActionTest.java
r12849 r14138 28 28 @Rule 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().p latform().projection();30 public JOSMTestRules test = new JOSMTestRules().projection(); 31 31 32 32 /** -
trunk/test/unit/org/openstreetmap/josm/actions/PurgeActionTest.java
r12636 r14138 32 32 @Rule 33 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 public JOSMTestRules test = new JOSMTestRules(). platform().main();34 public JOSMTestRules test = new JOSMTestRules().main(); 35 35 36 36 /** -
trunk/test/unit/org/openstreetmap/josm/actions/SessionSaveAsActionTest.java
r11109 r14138 20 20 @Rule 21 21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 22 public JOSMTestRules test = new JOSMTestRules() .platform();22 public JOSMTestRules test = new JOSMTestRules(); 23 23 24 24 /** -
trunk/test/unit/org/openstreetmap/josm/actions/UnJoinNodeWayActionTest.java
r12636 r14138 42 42 @Rule 43 43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 44 public JOSMTestRules test = new JOSMTestRules() .platform();44 public JOSMTestRules test = new JOSMTestRules(); 45 45 46 46 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java
r14101 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection();28 public JOSMTestRules test = new JOSMTestRules().main().projection(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java
r12636 r14138 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection();29 public JOSMTestRules test = new JOSMTestRules().main().projection(); 30 30 31 31 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DrawActionTest.java
r14134 r14138 40 40 @Rule 41 41 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 42 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection().timeout(20000);42 public JOSMTestRules test = new JOSMTestRules().main().projection().timeout(20000); 43 43 44 44 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java
r12636 r14138 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules(). platform().platform().main().projection();29 public JOSMTestRules test = new JOSMTestRules().main().projection(); 30 30 31 31 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java
r12636 r14138 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules(). platform().platform().main().projection();29 public JOSMTestRules test = new JOSMTestRules().main().projection(); 30 30 31 31 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ParallelWayActionTest.java
r12636 r14138 28 28 @Rule 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules(). platform().platform().main().projection();30 public JOSMTestRules test = new JOSMTestRules().main().projection(); 31 31 32 32 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/PlayHeadDragModeTest.java
r12636 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). platform().platform().main().projection();28 public JOSMTestRules test = new JOSMTestRules().main().projection(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/actions/mapmode/SelectActionTest.java
r12849 r14138 60 60 @Rule 61 61 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 62 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();62 public JOSMTestRules test = new JOSMTestRules().projection().main(); 63 63 64 64 /** -
trunk/test/unit/org/openstreetmap/josm/actions/upload/ValidateUploadHookTest.java
r13496 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules(). platform().fakeAPI().timeout(30000);23 public JOSMTestRules test = new JOSMTestRules().fakeAPI().timeout(30000); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r13616 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules() .platform();35 public JOSMTestRules test = new JOSMTestRules(); 36 36 private CommandTestData testData; 37 37 -
trunk/test/unit/org/openstreetmap/josm/command/conflict/CoordinateConflictResolveCommandTest.java
r13079 r14138 37 37 @Rule 38 38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 39 public JOSMTestRules test = new JOSMTestRules() .platform();39 public JOSMTestRules test = new JOSMTestRules(); 40 40 41 41 /** -
trunk/test/unit/org/openstreetmap/josm/data/PreferencesTest.java
r12989 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().p latform().preferences().fakeAPI();23 public JOSMTestRules test = new JOSMTestRules().preferences().fakeAPI(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMSEndpointTileSourceTest.java
r14120 r14138 30 30 @Rule 31 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules test = new JOSMTestRules().p latform().projection();32 public JOSMTestRules test = new JOSMTestRules().projection(); 33 33 34 34 @Rule -
trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java
r14120 r14138 47 47 @ClassRule 48 48 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 49 public static JOSMTestRules test = new JOSMTestRules().preferences().p latform().projection().timeout((int) TimeUnit.MINUTES.toMillis(5));49 public static JOSMTestRules test = new JOSMTestRules().preferences().projection().timeout((int) TimeUnit.MINUTES.toMillis(5)); 50 50 51 51 @Rule -
trunk/test/unit/org/openstreetmap/josm/data/osm/DefaultNameFormatterTest.java
r13766 r14138 38 38 @Rule 39 39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 40 public JOSMTestRules test = new JOSMTestRules() .platform();40 public JOSMTestRules test = new JOSMTestRules(); 41 41 42 42 /** -
trunk/test/unit/org/openstreetmap/josm/data/projection/ProjectionRefTest.java
r13707 r14138 35 35 import org.junit.Rule; 36 36 import org.junit.Test; 37 import org.openstreetmap.josm.Main;38 37 import org.openstreetmap.josm.data.Bounds; 39 38 import org.openstreetmap.josm.data.coor.EastNorth; … … 42 41 import org.openstreetmap.josm.testutils.JOSMTestRules; 43 42 import org.openstreetmap.josm.tools.Pair; 43 import org.openstreetmap.josm.tools.PlatformManager; 44 44 import org.openstreetmap.josm.tools.Utils; 45 45 … … 90 90 @Rule 91 91 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 92 public JOSMTestRules test = new JOSMTestRules().p latform().projectionNadGrids().timeout(90_000);92 public JOSMTestRules test = new JOSMTestRules().projectionNadGrids().timeout(90_000); 93 93 94 94 /** … … 104 104 } 105 105 } 106 Main.determinePlatformHook();107 106 Collection<RefEntry> refs = readData(); 108 107 refs = updateData(refs); … … 286 285 // see http://geodesie.ign.fr/contenu/fichiers/documentation/algorithmes/notice/NT111_V1_HARMEL_TransfoNTF-RGF93_FormatGrilleNTV2.pdf 287 286 def = def.replace("ntf_r93_b.gsb", "ntf_r93.gsb"); 288 if ( Main.isPlatformWindows()) {287 if (PlatformManager.isPlatformWindows()) { 289 288 def = def.replace("'", "\\'").replace("\"", "\\\""); 290 289 } -
trunk/test/unit/org/openstreetmap/josm/data/projection/SwissGridTest.java
r14120 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules().projectionNadGrids() .platform();28 public JOSMTestRules test = new JOSMTestRules().projectionNadGrids(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/OsmValidatorTest.java
r11921 r14138 19 19 @Rule 20 20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules() .platform();21 public JOSMTestRules test = new JOSMTestRules(); 22 22 23 23 /** -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r13616 r14138 52 52 @Rule 53 53 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 54 public JOSMTestRules test = new JOSMTestRules().projection() .platform();54 public JOSMTestRules test = new JOSMTestRules().projection(); 55 55 56 56 static MapCSSTagChecker buildTagChecker(String css) throws ParseException { -
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
r12568 r14138 35 35 @Rule 36 36 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 37 public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main() .platform();37 public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main(); 38 38 39 39 private static Way createUnclosedWay(String tags) { -
trunk/test/unit/org/openstreetmap/josm/gui/MainApplicationTest.java
r13812 r14138 28 28 import org.junit.Rule; 29 29 import org.junit.Test; 30 import org.openstreetmap.josm.Main;31 30 import org.openstreetmap.josm.TestUtils; 32 31 import org.openstreetmap.josm.actions.AboutAction; … … 44 43 import org.openstreetmap.josm.testutils.JOSMTestRules; 45 44 import org.openstreetmap.josm.tools.Logging; 45 import org.openstreetmap.josm.tools.PlatformManager; 46 46 import org.openstreetmap.josm.tools.Shortcut; 47 47 … … 196 196 public void testSetupUIManager() { 197 197 MainApplication.setupUIManager(); 198 assertEquals(Config.getPref().get("laf", Main.platform.getDefaultStyle()), UIManager.getLookAndFeel().getClass().getCanonicalName()); 198 assertEquals(Config.getPref().get("laf", PlatformManager.getPlatform().getDefaultStyle()), 199 UIManager.getLookAndFeel().getClass().getCanonicalName()); 199 200 } 200 201 -
trunk/test/unit/org/openstreetmap/josm/gui/MapScalerTest.java
r12636 r14138 28 28 @Rule 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();30 public JOSMTestRules test = new JOSMTestRules().main().projection(); 31 31 32 32 /** -
trunk/test/unit/org/openstreetmap/josm/gui/NavigatableComponentTest.java
r14120 r14138 56 56 @Rule 57 57 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 58 public JOSMTestRules test = new JOSMTestRules().preferences().p latform().projection();58 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); 59 59 60 60 /** -
trunk/test/unit/org/openstreetmap/josm/gui/TableCellRendererTest.java
r14102 r14138 53 53 @Rule 54 54 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 55 public JOSMTestRules test = new JOSMTestRules(). platform().main();55 public JOSMTestRules test = new JOSMTestRules().main(); 56 56 57 57 /** -
trunk/test/unit/org/openstreetmap/josm/gui/datatransfer/OsmTransferHandlerTest.java
r14120 r14138 29 29 @Rule 30 30 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 public JOSMTestRules test = new JOSMTestRules().preferences().projection().main() .platform();31 public JOSMTestRules test = new JOSMTestRules().preferences().projection().main(); 32 32 33 33 private final OsmTransferHandler transferHandler = new OsmTransferHandler(); -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/CommandStackDialogTest.java
r14134 r14138 28 28 @Rule 29 29 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 30 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();30 public JOSMTestRules test = new JOSMTestRules().main().projection(); 31 31 32 32 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/ConflictDialogTest.java
r12636 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();35 public JOSMTestRules test = new JOSMTestRules().main().projection(); 36 36 37 37 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/InspectPrimitiveDialogTest.java
r13169 r14138 31 31 @Rule 32 32 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 33 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection().mapStyles();33 public JOSMTestRules test = new JOSMTestRules().main().projection().mapStyles(); 34 34 35 35 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MapPaintDialogTest.java
r12636 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();23 public JOSMTestRules test = new JOSMTestRules().main().projection(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/MinimapDialogTest.java
r14122 r14138 58 58 @Rule 59 59 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 60 public JOSMTestRules josmTestRules = new JOSMTestRules().main().p latform().projection().fakeImagery();60 public JOSMTestRules josmTestRules = new JOSMTestRules().main().projection().fakeImagery(); 61 61 62 62 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManagerTest.java
r13846 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();35 public JOSMTestRules test = new JOSMTestRules().preferences(); 36 36 37 37 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/layer/LayerVisibilityActionTest.java
r12636 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules().preferences().projection(). platform().main();28 public JOSMTestRules test = new JOSMTestRules().preferences().projection().main(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
r14031 r14138 34 34 @Rule 35 35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 36 public JOSMTestRules test = new JOSMTestRules().preferences(). platform().main();36 public JOSMTestRules test = new JOSMTestRules().preferences().main(); 37 37 38 38 /** -
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/AbstractRelationEditorActionTest.java
r14028 r14138 38 38 @Rule 39 39 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 40 public JOSMTestRules test = new JOSMTestRules().preferences(). platform().main();40 public JOSMTestRules test = new JOSMTestRules().preferences().main(); 41 41 42 42 protected OsmDataLayer layer; -
trunk/test/unit/org/openstreetmap/josm/gui/help/HelpBrowserTest.java
r12248 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules().preferences(). platform().https();28 public JOSMTestRules test = new JOSMTestRules().preferences().https(); 29 29 30 30 static IHelpBrowser newHelpBrowser() { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayerTest.java
r13884 r14138 46 46 @Rule 47 47 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 48 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();48 public JOSMTestRules test = new JOSMTestRules().projection().main(); 49 49 50 50 private static final class TMSTileStubSource extends AbstractTMSTileSource { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/AutosaveTaskTest.java
r13116 r14138 41 41 @Rule 42 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules().preferences().p latform().projection();43 public JOSMTestRules test = new JOSMTestRules().preferences().projection(); 44 44 45 45 private AutosaveTask task; -
trunk/test/unit/org/openstreetmap/josm/gui/layer/GpxLayerTest.java
r13211 r14138 41 41 @Rule 42 42 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 43 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection().i18n();43 public JOSMTestRules test = new JOSMTestRules().main().projection().i18n(); 44 44 45 45 private static String getHtml(GpxLayer layer) { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/OsmDataLayerTest.java
r14075 r14138 49 49 @Rule 50 50 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 51 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();51 public JOSMTestRules test = new JOSMTestRules().projection().main(); 52 52 53 53 private DataSet ds; -
trunk/test/unit/org/openstreetmap/josm/gui/layer/TMSLayerTest.java
r12636 r14138 23 23 @Rule 24 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();25 public JOSMTestRules test = new JOSMTestRules().main().projection(); 26 26 27 27 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/ValidatorLayerTest.java
r13174 r14138 25 25 @Rule 26 26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 27 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();27 public JOSMTestRules test = new JOSMTestRules().projection().main(); 28 28 29 29 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/WMSLayerTest.java
r12636 r14138 23 23 @Rule 24 24 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 25 public JOSMTestRules test = new JOSMTestRules().main().p latform().projection();25 public JOSMTestRules test = new JOSMTestRules().main().projection(); 26 26 27 27 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/ChooseTrackVisibilityActionTest.java
r12564 r14138 19 19 @Rule 20 20 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 21 public JOSMTestRules test = new JOSMTestRules() .platform();21 public JOSMTestRules test = new JOSMTestRules(); 22 22 23 23 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
r14062 r14138 32 32 @Rule 33 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();34 public JOSMTestRules test = new JOSMTestRules().preferences(); 35 35 36 36 private static PleaseWaitRunnable createTask(String file) throws Exception { -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r14132 r14138 30 30 @Rule 31 31 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 32 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection().fakeImagery().timeout(20000);32 public JOSMTestRules test = new JOSMTestRules().main().projection().fakeImagery().timeout(20000); 33 33 34 34 /** -
trunk/test/unit/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayerTest.java
r12849 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules().main().p latform().preferences().projection();35 public JOSMTestRules test = new JOSMTestRules().main().preferences().projection(); 36 36 37 37 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanelTest.java
r13734 r14138 20 20 @Rule 21 21 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 22 public JOSMTestRules test = new JOSMTestRules().p latform().preferences();22 public JOSMTestRules test = new JOSMTestRules().preferences(); 23 23 24 24 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java
r12849 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). platform().main();28 public JOSMTestRules test = new JOSMTestRules().main(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
r14081 r14138 52 52 public JOSMTestRules test = new JOSMTestRules().assumeRevision( 53 53 "Revision: 10000\n" 54 ).preferences().main().assertionsInEDT() .platform();54 ).preferences().main().assertionsInEDT(); 55 55 56 56 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java
r14052 r14138 34 34 @Rule 35 35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 36 public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT() .platform();36 public JOSMTestRules test = new JOSMTestRules().preferences().assertionsInEDT(); 37 37 38 38 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java
r10979 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();23 public JOSMTestRules test = new JOSMTestRules().preferences(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java
r10979 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();23 public JOSMTestRules test = new JOSMTestRules().preferences(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java
r10979 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();23 public JOSMTestRules test = new JOSMTestRules().preferences(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java
r10979 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();23 public JOSMTestRules test = new JOSMTestRules().preferences(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java
r11921 r14138 33 33 @Rule 34 34 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 35 public JOSMTestRules test = new JOSMTestRules() .platform();35 public JOSMTestRules test = new JOSMTestRules(); 36 36 37 37 /** -
trunk/test/unit/org/openstreetmap/josm/io/CertificateAmendmentTestIT.java
r14099 r14138 25 25 @Rule 26 26 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 27 public JOSMTestRules test = new JOSMTestRules(). platform().https().timeout(20000);27 public JOSMTestRules test = new JOSMTestRules().https().timeout(20000); 28 28 29 29 /** -
trunk/test/unit/org/openstreetmap/josm/io/NetworkManagerTest.java
r14121 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules(). platform().https().devAPI().main().projection();28 public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java
r13878 r14138 32 32 @Rule 33 33 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 34 public JOSMTestRules test = new JOSMTestRules().p latform().projection();34 public JOSMTestRules test = new JOSMTestRules().projection(); 35 35 36 36 @Rule -
trunk/test/unit/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandlerTest.java
r12558 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules test = new JOSMTestRules() .platform();28 public JOSMTestRules test = new JOSMTestRules(); 29 29 30 30 private static ImageryHandler newHandler(String url) throws RequestHandlerBadRequestException { -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionReaderTest.java
r13243 r14138 37 37 @Rule 38 38 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 39 public JOSMTestRules test = new JOSMTestRules().p latform().projection();39 public JOSMTestRules test = new JOSMTestRules().projection(); 40 40 41 41 private static String getSessionDataDir() { -
trunk/test/unit/org/openstreetmap/josm/io/session/SessionWriterTest.java
r14120 r14138 89 89 @Rule 90 90 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 91 public JOSMTestRules test = new JOSMTestRules().p latform().projection().main();91 public JOSMTestRules test = new JOSMTestRules().projection().main(); 92 92 93 93 /** -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
r13079 r14138 34 34 @Rule 35 35 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 36 public JOSMTestRules test = new JOSMTestRules() .platform();36 public JOSMTestRules test = new JOSMTestRules(); 37 37 38 38 /** -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r14113 r14138 42 42 @Rule 43 43 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 44 public JOSMTestRules test = new JOSMTestRules(). platform().main().projection().preferences().timeout(10*60*1000);44 public JOSMTestRules test = new JOSMTestRules().main().projection().preferences().timeout(10*60*1000); 45 45 46 46 /** -
trunk/test/unit/org/openstreetmap/josm/spi/lifecycle/LifecycleTest.java
r14125 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules test = new JOSMTestRules(). platform().https().devAPI().main().projection();23 public JOSMTestRules test = new JOSMTestRules().https().devAPI().main().projection(); 24 24 25 25 private static class InitStatusListenerStub implements InitStatusListener { -
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r14120 r14138 79 79 private Runnable navigableComponentMockingRunnable; 80 80 private Runnable edtAssertionMockingRunnable; 81 private boolean platform;82 81 private boolean useProjection; 83 82 private boolean useProjectionNadGrids; … … 150 149 * Enable {@link Main#platform} global variable. 151 150 * @return this instance, for easy chaining 152 */ 151 * @deprecated Not needed anymore 152 */ 153 @Deprecated 153 154 public JOSMTestRules platform() { 154 platform = true;155 155 return this; 156 156 } … … 209 209 public JOSMTestRules https() { 210 210 useHttps = true; 211 platform = true;212 211 return this; 213 212 } … … 457 456 // We force the use of a wrong API server, just in case anyone attempts an upload 458 457 Config.getPref().put("osm-server.url", "http://invalid"); 459 }460 461 // Set Platform462 if (platform) {463 Main.determinePlatformHook();464 458 } 465 459 … … 550 544 cleanLayerEnvironment(); 551 545 Main.pref.resetToInitialState(); 552 Main.platform = null;553 546 System.gc(); 554 547 } … … 592 585 ProjectionRegistry.clearProjectionChangeListeners(); 593 586 Main.pref.resetToInitialState(); 594 Main.platform = null;595 587 596 588 if (this.assumeRevisionString != null && this.originalVersion != null) { -
trunk/test/unit/org/openstreetmap/josm/tools/KeyboardUtilsTest.java
r14026 r14138 26 26 @Rule 27 27 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 28 public JOSMTestRules rules = new JOSMTestRules() .platform();28 public JOSMTestRules rules = new JOSMTestRules(); 29 29 30 30 /** -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookOsxTest.java
r14119 r14138 14 14 import org.junit.Test; 15 15 import org.openstreetmap.josm.JOSMFixture; 16 import org.openstreetmap.josm.Main;17 16 import org.openstreetmap.josm.spi.preferences.Config; 18 17 … … 64 63 @Test 65 64 public void testOpenUrl() throws IOException { 66 if (! Main.isPlatformWindows()) {65 if (!PlatformManager.isPlatformWindows()) { 67 66 hook.openUrl(Config.getUrls().getJOSMWebsite()); 68 67 } else { … … 83 82 File cache = hook.getDefaultCacheDirectory(); 84 83 assertNotNull(cache); 85 if ( Main.isPlatformOsx()) {84 if (PlatformManager.isPlatformOsx()) { 86 85 assertTrue(cache.toString().contains("/Library/")); 87 86 } … … 95 94 File cache = hook.getDefaultPrefDirectory(); 96 95 assertNotNull(cache); 97 if ( Main.isPlatformOsx()) {96 if (PlatformManager.isPlatformOsx()) { 98 97 assertTrue(cache.toString().contains("/Library/")); 99 98 } … … 114 113 public void testGetOSDescription() { 115 114 String os = hook.getOSDescription(); 116 if ( Main.isPlatformOsx()) {115 if (PlatformManager.isPlatformOsx()) { 117 116 assertTrue(os.contains("Mac")); 118 117 } else { -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java
r14119 r14138 19 19 import org.junit.Test; 20 20 import org.openstreetmap.josm.JOSMFixture; 21 import org.openstreetmap.josm.Main;22 21 import org.openstreetmap.josm.io.remotecontrol.RemoteControlHttpsServer; 23 22 import org.openstreetmap.josm.io.remotecontrol.RemoteControlTest; … … 54 53 @Test 55 54 public void testGetRootKeystore() throws Exception { 56 if ( Main.isPlatformWindows()) {55 if (PlatformManager.isPlatformWindows()) { 57 56 assertNotNull(PlatformHookWindows.getRootKeystore()); 58 57 } else { … … 72 71 @Test 73 72 public void testRemoveInsecureCertificates() throws Exception { 74 if ( Main.isPlatformWindows()) {73 if (PlatformManager.isPlatformWindows()) { 75 74 PlatformHookWindows.removeInsecureCertificates(); 76 75 } else { … … 93 92 KeyStore ks = RemoteControlHttpsServer.loadJosmKeystore(); 94 93 TrustedCertificateEntry trustedCert = new KeyStore.TrustedCertificateEntry(ks.getCertificate(ks.aliases().nextElement())); 95 if ( Main.isPlatformWindows()) {94 if (PlatformManager.isPlatformWindows()) { 96 95 hook.setupHttpsCertificate(RemoteControlHttpsServer.ENTRY_ALIAS, trustedCert); 97 96 } else { … … 119 118 @Test 120 119 public void testOpenUrl() throws IOException { 121 if ( Main.isPlatformWindows()) {120 if (PlatformManager.isPlatformWindows()) { 122 121 hook.openUrl(Config.getUrls().getJOSMWebsite()); 123 122 } else { … … 146 145 File cache = hook.getDefaultCacheDirectory(); 147 146 assertNotNull(cache); 148 if ( Main.isPlatformWindows()) {147 if (PlatformManager.isPlatformWindows()) { 149 148 assertTrue(cache.toString().contains(":")); 150 149 } … … 158 157 File cache = hook.getDefaultPrefDirectory(); 159 158 assertNotNull(cache); 160 if ( Main.isPlatformWindows()) {159 if (PlatformManager.isPlatformWindows()) { 161 160 assertTrue(cache.toString().contains(":")); 162 161 } … … 177 176 public void testGetInstalledFonts() { 178 177 Collection<String> fonts = hook.getInstalledFonts(); 179 if ( Main.isPlatformWindows()) {178 if (PlatformManager.isPlatformWindows()) { 180 179 assertFalse(fonts.isEmpty()); 181 180 } else { … … 190 189 public void testGetOSDescription() { 191 190 String os = hook.getOSDescription(); 192 if ( Main.isPlatformWindows()) {191 if (PlatformManager.isPlatformWindows()) { 193 192 assertTrue(os.contains("Windows")); 194 193 } else { -
trunk/test/unit/org/openstreetmap/josm/tools/RightAndLefthandTrafficTest.java
r12556 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules rules = new JOSMTestRules().p latform().projection().rlTraffic();23 public JOSMTestRules rules = new JOSMTestRules().projection().rlTraffic(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/tools/TerritoriesTest.java
r12802 r14138 21 21 @Rule 22 22 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 23 public JOSMTestRules rules = new JOSMTestRules().p latform().projection().territories();23 public JOSMTestRules rules = new JOSMTestRules().projection().territories(); 24 24 25 25 /** -
trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java
r12779 r14138 27 27 @Rule 28 28 @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 public JOSMTestRules test = new JOSMTestRules().preferences() .platform();29 public JOSMTestRules test = new JOSMTestRules().preferences(); 30 30 31 31 /**
Note:
See TracChangeset
for help on using the changeset viewer.