Package com.jme3.system
Class JmeSystem
java.lang.Object
com.jme3.system.JmeSystem
Utility class to access platform-dependant features.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic PlatformDetermine which Platform (operating system and architecture) the application is running on.static URLstatic URLgetResource(String name) static InputStreamgetResourceAsStream(String name) static SoftTextDialogInputstatic Filestatic Filestatic voidhandleErrorMessage(String message) static voidhandleSettings(AppSettings sourceSettings, boolean loadFromRegistry) static voidinitialize(AppSettings settings) static booleanstatic AssetManagerstatic AssetManagernewAssetManager(URL configFile) static AudioRenderernewAudioRenderer(AppSettings settings) static JmeContextnewContext(AppSettings settings, JmeContext.Type contextType) static voidsetErrorMessageHandler(Consumer<String> handler) static voidsetLowPermissions(boolean lowPerm) static voidsetSettingsHandler(BiFunction<AppSettings, Boolean, Boolean> handler) static voidstatic voidsetSystemDelegate(JmeSystemDelegate systemDelegate) static voidshowErrorDialog(String message) Deprecated.Use JmeSystem.handleErrorMessage(String) insteadstatic booleanshowSettingsDialog(AppSettings sourceSettings, boolean loadFromRegistry) Deprecated.static voidshowSoftKeyboard(boolean show) Displays or hides the onscreen soft keyboardstatic booleanstatic voidwriteImageFile(OutputStream outStream, String format, ByteBuffer imageData, int width, int height) Compresses a raw image into a stream.
-
Method Details
-
setSystemDelegate
-
getStorageFolder
-
getStorageFolder
-
getFullName
-
getResourceAsStream
-
getResource
-
trackDirectMemory
public static boolean trackDirectMemory() -
setLowPermissions
public static void setLowPermissions(boolean lowPerm) -
isLowPermissions
public static boolean isLowPermissions() -
setSoftTextDialogInput
-
showSoftKeyboard
public static void showSoftKeyboard(boolean show) Displays or hides the onscreen soft keyboard- Parameters:
show- If true, the keyboard is displayed, if false, the screen is hidden.
-
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.- Parameters:
outStream- The stream where to write the image data.format- The format to use, either "png" or "jpg".imageData- The image data inImage.Format.RGBA8format.width- The width of the image.height- The height of the image.- Throws:
IOException- If outStream throws an exception while writing.
-
newAssetManager
-
newAssetManager
-
getPlatform
Determine which Platform (operating system and architecture) the application is running on.- Returns:
- an enum value (not null)
-
newContext
-
newAudioRenderer
-
getPlatformAssetConfigURL
-
showErrorDialog
Deprecated.Use JmeSystem.handleErrorMessage(String) insteadDisplays 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.- Parameters:
message- The error message to display. May contain new line characters.
-
handleErrorMessage
-
setErrorMessageHandler
-
handleSettings
-
setSettingsHandler
-
showSettingsDialog
@Deprecated public static boolean showSettingsDialog(AppSettings sourceSettings, boolean loadFromRegistry) Deprecated. -
initialize
-