Package jme3utilities.ui
Class Locators
java.lang.Object
jme3utilities.ui.Locators
Manage the registered locators in the AssetManager of an ActionApplication.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
dumpAll
(PrintStream printStream) Dump the entire stack of locators to the specified PrintStream.static com.jme3.asset.AssetManager
Access the asset manager.static String
Determine the root path of the sole locator in the current configuration.static void
Register (add) the specified locators to the current configuration, in the specified order.static void
Register (add) the specified locator to the current configuration.static void
Register (add) a locator of the specified type to the current configuration.static void
Register (add) the default locator(s) to the current configuration, namely: the sandbox (if one exists) followed by the classpath.static void
registerFilesystem
(String rootPath) Register (add) a file locator or zip locator to the current configuration.static void
restore()
Restore an old configuration.static void
save()
Save a copy of the current configuration for later restoration.static void
Unregister all locators from the current configuration.static void
Set the current configuration to use only the default locator(s).static void
useFilesystem
(String rootPath) Set the current configuration to use only the specified file locator or zip locator for assets.
-
Constructor Details
-
Locators
public Locators()A no-arg constructor to avoid javadoc warnings from JDK 18.
-
-
Method Details
-
dumpAll
Dump the entire stack of locators to the specified PrintStream.- Parameters:
printStream
- the output stream (not null)
-
getAssetManager
public static com.jme3.asset.AssetManager getAssetManager()Access the asset manager.- Returns:
- the pre-existing instance (not null)
-
getRootPath
Determine the root path of the sole locator in the current configuration.- Returns:
- root path, or "" if there isn't exactly one locator or if the locator isn't a FileLocator/ZipLocator
-
register
Register (add) the specified locator to the current configuration.- Parameters:
spec
- URL specification (null specifies the default locators)
-
register
public static void register(String rootPath, Class<? extends com.jme3.asset.AssetLocator> locatorType) Register (add) a locator of the specified type to the current configuration.- Parameters:
rootPath
- (not null, not empty)locatorType
- type of locator
-
register
Register (add) the specified locators to the current configuration, in the specified order.- Parameters:
specList
- a list of URL specifications (not null, unaffected)
-
registerDefault
public static void registerDefault()Register (add) the default locator(s) to the current configuration, namely: the sandbox (if one exists) followed by the classpath. -
registerFilesystem
Register (add) a file locator or zip locator to the current configuration.- Parameters:
rootPath
- absolute filesystem path to the directory/folder/JAR/ZIP (not null, not empty)
-
restore
public static void restore()Restore an old configuration. -
save
public static void save()Save a copy of the current configuration for later restoration. -
unregisterAll
public static void unregisterAll()Unregister all locators from the current configuration. -
useDefault
public static void useDefault()Set the current configuration to use only the default locator(s). Any other locators get unregistered. -
useFilesystem
Set the current configuration to use only the specified file locator or zip locator for assets. Any other locators get unregistered.- Parameters:
rootPath
- absolute filesystem path to the directory/folder/JAR/ZIP (not null, not empty)
-