Class DefaultKDEFontPolicy

java.lang.Object
org.pushingpixels.radiance.common.internal.font.DefaultKDEFontPolicy
All Implemented Interfaces:
FontPolicy

public class DefaultKDEFontPolicy extends Object implements FontPolicy
The default font policy for KDE OS.
  • Field Details

  • Constructor Details

    • DefaultKDEFontPolicy

      public DefaultKDEFontPolicy()
  • Method Details

    • isKDERunning

      public static boolean isKDERunning()
      method to check if current user session is KDE
      Returns:
      true if KDE session is currently running.
    • isKDE4Running

      private static boolean isKDE4Running()
      Checks for KDE4 flags in current env. There are few possible flags:
      KDE_SESSION_VERSION=4<br/> DESKTOP_SESSION=kde4<br/> If distro for some readon don't set this flags - KDE3 is possibli running.

      There is one more way to determine current KDE version. We can run "konsole --version" command and parse output, but KDE3 don't have own env flags, so this command will run every time we using KDE3.
      Returns:
      true if KDE4 env flags found, false otherwise.
    • getFontSet

      public FontSet getFontSet()
      Description copied from interface: FontPolicy
      Looks up and returns a set of fonts that will be used by a Look&Feel to set the default fonts for its components.

      This method is invoked during the L&F component initialization.

      Specified by:
      getFontSet in interface FontPolicy
      Returns:
      a set of fonts used as default for the component.
    • getInternalFontSet

      private FontSet getInternalFontSet()
    • getIniParam

      private String getIniParam(String content, String category, String param) throws Exception
      Throws:
      Exception
    • getFileContent

      private String getFileContent(String fileName) throws IOException
      Throws:
      IOException