Module MaterialFX

Enum Class LoaderCacheLevel

java.lang.Object
java.lang.Enum<LoaderCacheLevel>
io.github.palexdev.materialfx.enums.LoaderCacheLevel
All Implemented Interfaces:
Serializable, Comparable<LoaderCacheLevel>, java.lang.constant.Constable

public enum LoaderCacheLevel extends Enum<LoaderCacheLevel>
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).

  • Enum Constant Details

    • NONE

      public static final LoaderCacheLevel NONE
      No caching, may lag a little in some occasions (when the root contains a huge amount of nodes for example).
    • SCENE_CACHE

      public static final LoaderCacheLevel SCENE_CACHE
      The root node is added to a dummy pane and Scene, then Node.applyCss() and Parent.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

      public static final LoaderCacheLevel 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

      public static LoaderCacheLevel[] 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

      public static LoaderCacheLevel valueOf(String name)
      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 name
      NullPointerException - if the argument is null