Package com.formdev.flatlaf.ui
Class FlatNativeLibrary
- java.lang.Object
-
- com.formdev.flatlaf.ui.FlatNativeLibrary
-
class FlatNativeLibrary extends java.lang.Object
Helper class to load FlatLaf native library (.dll, .so or .dylib), if available for current operating system and CPU architecture.- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
initialized
private static NativeLibrary
nativeLibrary
-
Constructor Summary
Constructors Constructor Description FlatNativeLibrary()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
buildLibraryName(java.io.File jarFile, java.lang.String classifier, java.lang.String ext)
private static NativeLibrary
createNativeLibrary(java.lang.String classifier, java.lang.String ext)
private static java.io.File
findLibraryBesideJar(java.lang.String classifier, java.lang.String ext)
Search for a native library beside the jar that contains this class (usually the FlatLaf jar).private static int
getApiVersion()
private static java.io.File
getJarFile()
private static void
initialize(int apiVersion)
(package private) static boolean
isLoaded(int apiVersion)
Loads native library (if available) and returns whether loaded successfully.private static void
loadJAWT()
-
-
-
Field Detail
-
initialized
private static boolean initialized
-
nativeLibrary
private static NativeLibrary nativeLibrary
-
-
Method Detail
-
getApiVersion
private static int getApiVersion()
-
isLoaded
static boolean isLoaded(int apiVersion)
Loads native library (if available) and returns whether loaded successfully. Returnsfalse
if no native library is available.
-
initialize
private static void initialize(int apiVersion)
-
createNativeLibrary
private static NativeLibrary createNativeLibrary(java.lang.String classifier, java.lang.String ext)
-
findLibraryBesideJar
private static java.io.File findLibraryBesideJar(java.lang.String classifier, java.lang.String ext)
Search for a native library beside the jar that contains this class (usually the FlatLaf jar). The native library must be in the same directory (or in "../bin" if jar is in "lib") as the jar and have the same basename as the jar. If FlatLaf jar is repackaged into fat/uber application jar, "-flatlaf" is appended to jar basename. The classifier and the extension are appended to the jar basename. E.g. flatlaf-3.1.jar flatlaf-3.1-windows-x86_64.dll flatlaf-3.1-linux-x86_64.so
-
getJarFile
private static java.io.File getJarFile()
-
buildLibraryName
private static java.lang.String buildLibraryName(java.io.File jarFile, java.lang.String classifier, java.lang.String ext)
-
loadJAWT
private static void loadJAWT()
-
-