Class JmeSystem


public class JmeSystem extends Object
Utility class to access platform-dependant features.
  • Method Details

    • setSystemDelegate

      public static void setSystemDelegate(JmeSystemDelegate systemDelegate)
    • getStorageFolder

      public static File getStorageFolder()
    • getStorageFolder

      public static File getStorageFolder(JmeSystem.StorageFolderType type)
    • getFullName

      public static String getFullName()
    • getResourceAsStream

      public static InputStream getResourceAsStream(String name)
    • getResource

      public static URL getResource(String name)
    • trackDirectMemory

      public static boolean trackDirectMemory()
    • setLowPermissions

      public static void setLowPermissions(boolean lowPerm)
    • isLowPermissions

      public static boolean isLowPermissions()
    • setSoftTextDialogInput

      public static void setSoftTextDialogInput(SoftTextDialogInput input)
    • showSoftKeyboard

      public static void showSoftKeyboard(boolean show)
      Displays or hides the onscreen soft keyboard
      show - If true, the keyboard is displayed, if false, the screen is hidden.
    • getSoftTextDialogInput

      public static SoftTextDialogInput getSoftTextDialogInput()
    • writeImageFile

      public static void writeImageFile(OutputStream outStream, String format, ByteBuffer imageData, int width, int height) throws IOException
      Compresses a raw image into a stream. The encoding is performed via system libraries. On desktop, the encoding is performed via ImageIO, whereas on Android, is done via the Bitmap class.
      outStream - The stream where to write the image data.
      format - The format to use, either "png" or "jpg".
      imageData - The image data in Image.Format.RGBA8 format.
      width - The width of the image.
      height - The height of the image.
      IOException - If outStream throws an exception while writing.
    • newAssetManager

      public static AssetManager newAssetManager(URL configFile)
    • newAssetManager

      public static AssetManager newAssetManager()
    • getPlatform

      public static Platform getPlatform()
      Determine which Platform (operating system and architecture) the application is running on.
      an enum value (not null)
    • newContext

      public static JmeContext newContext(AppSettings settings, JmeContext.Type contextType)
    • newAudioRenderer

      public static AudioRenderer newAudioRenderer(AppSettings settings)
    • getPlatformAssetConfigURL

      public static URL getPlatformAssetConfigURL()
    • showErrorDialog

      @Deprecated public static void showErrorDialog(String message)
      Use JmeSystem.handleErrorMessage(String) instead
      Displays an error message to the user in whichever way the context feels is appropriate. If this is a headless or an offscreen surface context, this method should do nothing.
      message - The error message to display. May contain new line characters.
    • handleErrorMessage

      public static void handleErrorMessage(String message)
    • setErrorMessageHandler

      public static void setErrorMessageHandler(Consumer<String> handler)
    • handleSettings

      public static void handleSettings(AppSettings sourceSettings, boolean loadFromRegistry)
    • setSettingsHandler

      public static void setSettingsHandler(BiFunction<AppSettings,Boolean,Boolean> handler)
    • showSettingsDialog

      @Deprecated public static boolean showSettingsDialog(AppSettings sourceSettings, boolean loadFromRegistry)
    • initialize

      public static void initialize(AppSettings settings)