Interface FlatSystemProperties
-
public interface FlatSystemProperties
Defines/documents own system properties used in FlatLaf.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANIMATION
Specifies whether animations are enabled.static String
MENUBAR_EMBEDDED
Specifies whether the menu bar is embedded into the window title pane if window decorations are enabled.static String
NATIVE_LIBRARY_PATH
Specifies a directory in which the native FlatLaf libraries have been extracted.static String
UI_SCALE
Specifies a custom scale factor used to scale the UI.static String
UI_SCALE_ALLOW_SCALE_DOWN
Specifies whether values smaller than 100% are allowed for the user scale factor (seeUIScale.getUserScaleFactor()
).static String
UI_SCALE_ENABLED
Specifies whether user scaling mode is enabled.static String
UPDATE_UI_ON_SYSTEM_FONT_CHANGE
Specifies whether FlatLaf updates the UI when the system font changes.static String
USE_JETBRAINS_CUSTOM_DECORATIONS
Specifies whether JetBrains Runtime custom window decorations should be used when creatingJFrame
orJDialog
.static String
USE_TEXT_Y_CORRECTION
Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens.static String
USE_UBUNTU_FONT
Specifies whether Ubuntu font should be used on Ubuntu Linux.static String
USE_WINDOW_DECORATIONS
Specifies whether native window decorations should be used when creatingJFrame
orJDialog
.
-
Method Summary
Static Methods Modifier and Type Method Description static boolean
getBoolean(String key, boolean defaultValue)
Checks whether a system property is set and returnstrue
if its value is"true"
(case-insensitive), otherwise it returnsfalse
.static Boolean
getBooleanStrict(String key, Boolean defaultValue)
Checks whether a system property is set and returnsBoolean.TRUE
if its value is"true"
(case-insensitive) or returnsBoolean.FALSE
if its value is"false"
(case-insensitive).
-
-
-
Field Detail
-
UI_SCALE
static final String UI_SCALE
Specifies a custom scale factor used to scale the UI.If Java runtime scales (Java 9 or later), this scale factor is applied on top of the Java system scale factor. Java 8 does not scale and this scale factor replaces the user scale factor that FlatLaf computes based on the font. To replace the Java 9+ system scale factor, use system property "sun.java2d.uiScale", which has the same syntax as this one.
Since FlatLaf 1.1.2: Scale factors less than 100% are allowed.
Allowed Values e.g.
1.5
,1.5x
,150%
or144dpi
(96dpi is 100%)- See Also:
- Constant Field Values
-
UI_SCALE_ENABLED
static final String UI_SCALE_ENABLED
Specifies whether user scaling mode is enabled.Allowed Values
false
andtrue
Defaulttrue
- See Also:
- Constant Field Values
-
UI_SCALE_ALLOW_SCALE_DOWN
static final String UI_SCALE_ALLOW_SCALE_DOWN
Specifies whether values smaller than 100% are allowed for the user scale factor (seeUIScale.getUserScaleFactor()
).Allowed Values
false
andtrue
Defaultfalse
- Since:
- 1.1.2
- See Also:
- Constant Field Values
-
USE_UBUNTU_FONT
static final String USE_UBUNTU_FONT
Specifies whether Ubuntu font should be used on Ubuntu Linux. By default, if not running in a JetBrains Runtime, the Liberation Sans font is used because there are rendering issues (in Java) with Ubuntu fonts.Allowed Values
false
andtrue
Defaultfalse
- See Also:
- Constant Field Values
-
USE_WINDOW_DECORATIONS
static final String USE_WINDOW_DECORATIONS
Specifies whether native window decorations should be used when creatingJFrame
orJDialog
.Setting this to
true
forces using native window decorations even if they are not enabled by the application.
Setting this tofalse
disables using native window decorations.This system property has higher priority than client property
FlatClientProperties.USE_WINDOW_DECORATIONS
and UI defaultTitlePane.useWindowDecorations
.(requires Window 10/11)
Allowed Values
false
andtrue
Default none- See Also:
- Constant Field Values
-
USE_JETBRAINS_CUSTOM_DECORATIONS
static final String USE_JETBRAINS_CUSTOM_DECORATIONS
Specifies whether JetBrains Runtime custom window decorations should be used when creatingJFrame
orJDialog
. Requires that the application runs in a JetBrains Runtime (based on OpenJDK).Setting this to
false
disables using JetBrains Runtime custom window decorations. Then FlatLaf native window decorations are used.(requires Window 10/11)
Allowed Values
false
andtrue
Defaultfalse
(since v2; wastrue
in v1)- See Also:
- Constant Field Values
-
MENUBAR_EMBEDDED
static final String MENUBAR_EMBEDDED
Specifies whether the menu bar is embedded into the window title pane if window decorations are enabled.Setting this to
true
forces embedding.
Setting this tofalse
disables embedding.This system property has higher priority than client property
FlatClientProperties.MENU_BAR_EMBEDDED
and UI defaultTitlePane.menuBarEmbedded
.(requires Window 10/11)
Allowed Values
false
andtrue
Default none- See Also:
- Constant Field Values
-
ANIMATION
static final String ANIMATION
Specifies whether animations are enabled.Allowed Values
false
andtrue
Defaulttrue
- See Also:
- Constant Field Values
-
USE_TEXT_Y_CORRECTION
static final String USE_TEXT_Y_CORRECTION
Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens.Allowed Values
false
andtrue
Defaulttrue
- See Also:
- Constant Field Values
-
UPDATE_UI_ON_SYSTEM_FONT_CHANGE
static final String UPDATE_UI_ON_SYSTEM_FONT_CHANGE
Specifies whether FlatLaf updates the UI when the system font changes. Iftrue
,SwingUtilities.updateComponentTreeUI(java.awt.Component)
gets invoked for all windows if the system font has changed. This is the similar to when switching to another look and feel (theme). Applications that do not work correctly when switching look and feel, should disable this option to avoid corrupted UI.Allowed Values
false
andtrue
Defaulttrue
- Since:
- 2.5
- See Also:
- Constant Field Values
-
NATIVE_LIBRARY_PATH
static final String NATIVE_LIBRARY_PATH
Specifies a directory in which the native FlatLaf libraries have been extracted. The path can be absolute or relative to current application working directory. This can be used to avoid extraction of the native libraries to the temporary directory at runtime.If the value is
"system"
, thenSystem.loadLibrary(String)
is used to load the native library. Searches for the native library in classloader of caller (usingClassLoader.findLibrary(String)
) and in paths specified in system propertiessun.boot.library.path
andjava.library.path
. (supported since FlatLaf 2.6)If the native library can not loaded from the given path (or via
System.loadLibrary(String)
), then the embedded native library is extracted to the temporary directory and loaded from there.- Since:
- 2
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBoolean
static boolean getBoolean(String key, boolean defaultValue)
Checks whether a system property is set and returnstrue
if its value is"true"
(case-insensitive), otherwise it returnsfalse
. If the system property is not set,defaultValue
is returned.
-
-