Class PlatformHookUnixoid

    • Method Detail

      • preStartupHook

        public void preStartupHook()
        Description copied from interface: PlatformHook
        The preStartupHook will be called extremely early. It is guaranteed to be called before the GUI setup has started. Reason: On OSX we need to inform the Swing libraries that we want to be integrated with the OS before we setup our GUI.
        Specified by:
        preStartupHook in interface PlatformHook
      • initSystemShortcuts

        public void initSystemShortcuts()
        Description copied from interface: PlatformHook
        The initSystemShortcuts hook will be called by the Shortcut class after the modifier groups have been read from the config, but before any shortcuts are read from it or registered from within the application. Please note that you are not allowed to register any shortcuts from this hook, but only "systemCuts"! BTW: SystemCuts should be named "system:<whatever>", and it'd be best if you'd recycle the names already used by the Windows and OSX hooks. Especially the later has really many of them. You should also register any and all shortcuts that the operation system handles itself to block JOSM from trying to use them---as that would just not work. Call setAutomatic on them to prevent the keyboard preferences from allowing the user to change them.
        Specified by:
        initSystemShortcuts in interface PlatformHook
      • getDefaultStyle

        public String getDefaultStyle()
        Description copied from interface: PlatformHook
        Returns the default LAF to be used on this platform to look almost as a native application.
        Specified by:
        getDefaultStyle in interface PlatformHook
        Returns:
        The default native LAF for this platform
      • getDesktopEnvironment

        public Optional<StringgetDesktopEnvironment()
        Returns desktop environment based on the environment variable XDG_CURRENT_DESKTOP.
        Returns:
        desktop environment.
      • isDebianOrUbuntu

        public static boolean isDebianOrUbuntu()
        Determines if the distribution is Debian or Ubuntu, or a derivative.
        Returns:
        true if the distribution is Debian, Ubuntu or Mint, false otherwise
      • getPackageDetails

        public static String getPackageDetails​(String... packageNames)
        Get the package name including detailed version.
        Parameters:
        packageNames - The possible package names (when a package can have different names on different distributions)
        Returns:
        The package name and package version if it can be identified, null otherwise
        Since:
        7314
      • getJavaPackageDetails

        public String getJavaPackageDetails()
        Get the Java package name including detailed version. Some Java bugs are specific to a certain security update, so in addition to the Java version, we also need the exact package version.
        Returns:
        The package name and package version if it can be identified, null otherwise
      • getWebStartPackageDetails

        public String getWebStartPackageDetails()
        Get the Web Start package name including detailed version. OpenJDK packages are shipped with icedtea-web package, but its version generally does not match main java package version. Simply return null if there's no separate package for Java WebStart.
        Returns:
        The package name and package version if it can be identified, null otherwise
      • getAtkWrapperPackageDetails

        public String getAtkWrapperPackageDetails()
        Get the Gnome ATK wrapper package name including detailed version. Debian and Ubuntu derivatives come with a pre-enabled accessibility software completely buggy that makes Swing crash in a lot of different ways. Simply return null if it's not found.
        Returns:
        The package name and package version if it can be identified, null otherwise
      • getDotDirectory

        private static File getDotDirectory()
        Get the dot directory ~/.josm.
        Returns:
        the dot directory
      • useDotDirectory

        private static boolean useDotDirectory()
        Returns true if the dot directory should be used for storing preferences, cache and user data. Currently this is the case, if the dot directory already exists.
        Returns:
        true if the dot directory should be used