Class DefaultKDEFontPolicy

  • All Implemented Interfaces:
    FontPolicy

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

      Fields 
      Modifier and Type Field Description
      private static FontSet fontSet  
      private static java.lang.String SANS_SERIF  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String getFileContent​(java.lang.String fileName)  
      FontSet getFontSet()
      Looks up and returns a set of fonts that will be used by a Look&Feel to set the default fonts for its components.
      private java.lang.String getIniParam​(java.lang.String content, java.lang.String category, java.lang.String param)  
      private FontSet getInternalFontSet()  
      private static boolean isKDE4Running()
      Checks for KDE4 flags in current env.
      static boolean isKDERunning()
      method to check if current user session is KDE
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultKDEFontPolicy

        public DefaultKDEFontPolicy()
    • Method Detail

      • 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 java.lang.String getIniParam​(java.lang.String content,
                                             java.lang.String category,
                                             java.lang.String param)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getFileContent

        private java.lang.String getFileContent​(java.lang.String fileName)
                                         throws java.io.IOException
        Throws:
        java.io.IOException