Class 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
    • 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()  
      • Methods inherited from class java.lang.Object

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

      • initialized

        private static boolean initialized
    • Constructor Detail

      • FlatNativeLibrary

        FlatNativeLibrary()
    • Method Detail

      • getApiVersion

        private static int getApiVersion()
      • isLoaded

        static boolean isLoaded​(int apiVersion)
        Loads native library (if available) and returns whether loaded successfully. Returns false 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()