Ignore:
Timestamp:
2018-08-12T02:21:19+02:00 (6 years ago)
Author:
Don-vip
Message:

see #15229 - deprecate Main.platform and related methods - new class PlatformManager

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/KeyboardUtils.java

    r14022 r14138  
    99import java.util.Locale;
    1010import java.util.Map;
    11 
    12 import org.openstreetmap.josm.Main;
    1311
    1412/**
     
    293291            // UK Apple, https://en.wikipedia.org/wiki/QWERTY#UK_Apple_keyboard
    294292            // International English Apple, https://en.wikipedia.org/wiki/QWERTY#Apple_International_English_Keyboard
    295             if (Main.isPlatformOsx()) {
     293            if (PlatformManager.isPlatformOsx()) {
    296294                result.add('§'); // https://en.wikipedia.org/wiki/Section_sign
    297295            }
  • trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java

    r12620 r14138  
    2525
    2626    private static void displayUrlFallback(URI uri) throws IOException {
    27         if (Main.platform == null)
     27        if (PlatformManager.getPlatform() == null)
    2828            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());
    3030    }
    3131
     
    4545        if (Desktop.isDesktopSupported()) {
    4646            try {
    47                 if (Main.isPlatformWindows()) {
     47                if (PlatformManager.isPlatformWindows()) {
    4848                    // 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
    4949                    Desktop.getDesktop().browse(uri);
    50                 } else if (Main.platform instanceof PlatformHookUnixoid || Main.platform instanceof PlatformHookOsx) {
     50                } else if (PlatformManager.isPlatformUnixoid() || PlatformManager.isPlatformOsx()) {
    5151                    // see #5629 #5108 #9568
    52                     Main.platform.openUrl(uri.toString());
     52                    PlatformManager.getPlatform().openUrl(uri.toString());
    5353                } else {
    5454                    // This is not the case with some Linux environments (see below),
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r14017 r14138  
    371371        if (initdone) return;
    372372        initdone = true;
    373         int commandDownMask = Main.platform.getMenuShortcutKeyMaskEx();
     373        int commandDownMask = PlatformManager.getPlatform().getMenuShortcutKeyMaskEx();
    374374        groups.put(NONE, -1);
    375375        groups.put(MNEMONIC, KeyEvent.ALT_DOWN_MASK);
     
    384384
    385385        // (1) System reserved shortcuts
    386         Main.platform.initSystemShortcuts();
     386        PlatformManager.getPlatform().initSystemShortcuts();
    387387        // (2) User defined shortcuts
    388388        Main.pref.getAllPrefixCollectionKeys("shortcut.entry.").stream()
     
    507507        } else if (existing.isPresent()) {
    508508            final Shortcut conflict = existing.get();
    509             if (Main.isPlatformOsx()) {
     509            if (PlatformManager.isPlatformOsx()) {
    510510                // Try to reassign Meta to Ctrl
    511511                int newmodifier = findNewOsxModifier(requestedGroup);
Note: See TracChangeset for help on using the changeset viewer.