Class FlatNativeLibrary
java.lang.Object
com.formdev.flatlaf.ui.FlatNativeLibrary
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringbuildLibraryName(File jarFile, String classifier, String ext) private static NativeLibrarycreateNativeLibrary(String classifier, String ext, boolean unknownArch) private static FilefindLibraryBesideJar(String classifier, String ext) Search for a native library beside the jar that contains this class (usually the FlatLaf jar).private static intprivate static Fileprivate static voidinitialize(int apiVersion) (package private) static booleanisLoaded(int apiVersion) Loads native library (if available) and returns whether loaded successfully.private static voidloadJAWT()private static StringAllow only 'a'-'z', 'A'-'Z', '0'-'9', '_' and '-' in filenames.
-
Field Details
-
initialized
private static boolean initialized -
nativeLibrary
-
-
Constructor Details
-
FlatNativeLibrary
FlatNativeLibrary()
-
-
Method Details
-
getApiVersion
private static int getApiVersion() -
isLoaded
static boolean isLoaded(int apiVersion) Loads native library (if available) and returns whether loaded successfully. Returnsfalseif no native library is available. -
initialize
private static void initialize(int apiVersion) -
createNativeLibrary
private static NativeLibrary createNativeLibrary(String classifier, String ext, boolean unknownArch) -
findLibraryBesideJar
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
-
buildLibraryName
-
sanitize
-
loadJAWT
private static void loadJAWT()
-