Class DefaultKDEFontPolicy
- java.lang.Object
-
- org.pushingpixels.radiance.common.internal.font.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
-
Constructor Summary
Constructors Constructor Description DefaultKDEFontPolicy()
-
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
-
-
-
Field Detail
-
SANS_SERIF
private static final java.lang.String SANS_SERIF
- See Also:
- Constant Field Values
-
fontSet
private static FontSet fontSet
-
-
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 interfaceFontPolicy
- 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
-
-