- All Implemented Interfaces:
Serializable,Comparable<LoaderCacheLevel>,java.lang.constant.Constable
Enumerator to define the level of caching used by
MFXLoader.
By enabling cache the switch performance vastly improves but the views cannot be loaded in parallel (quite acceptable loss in some cases).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNo caching, may lag a little in some occasions (when the root contains a huge amount of nodes for example).The root node is added to a dummy pane andScene, thenNode.applyCss()andParent.layout()are called.Does what SCENE_CACHE does, plus sets the JavaFX's properties cache to true and the cache hint to SPEED on the loaded root node. -
Method Summary
Modifier and TypeMethodDescriptionstatic LoaderCacheLevelReturns the enum constant of this class with the specified name.static LoaderCacheLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
No caching, may lag a little in some occasions (when the root contains a huge amount of nodes for example). -
SCENE_CACHE
The root node is added to a dummy pane andScene, thenNode.applyCss()andParent.layout()are called. This causes all nodes in the scene to create their skin and layout thus "caching" the scenegraph. Vastly improves view switching performance. -
SCENE_JAVAFX_CACHE
Does what SCENE_CACHE does, plus sets the JavaFX's properties cache to true and the cache hint to SPEED on the loaded root node. (To be honest I don't know if this truly improves performance since I didn't notice anything notable)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-