Package swingtree
Enum Class SwingTreeInitConfig.CacheMode
- All Implemented Interfaces:
Serializable,Comparable<SwingTreeInitConfig.CacheMode>,Constable
- Enclosing class:
SwingTreeInitConfig
Defines how aggressively SwingTree trades memory for CPU time across all
of its internal rendering caches (style layer images, rasterised text, noise
tiles, shadow gradients and text layouts). Higher modes keep more rendered
results in memory so that subsequent repaints can blit them instead of
re-rendering, which is a large saving for complex or text-heavy UIs under load
(e.g. while a window is being resized) — at the cost of more heap and video
memory. The chosen mode is combined with the amount of system RAM to derive a
concrete memory budget, so the same mode scales sensibly across machines.
This can also be selected through the system property "swingtree.cacheMode"
(the enum constant name, case-insensitive), and changed at runtime through
SwingTree.setCacheMode(CacheMode).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCaches as much as the memory budget allows, trading the most memory for the least CPU time.The default: a balanced trade-off between memory and CPU that reproduces SwingTree's historical, RAM-scaled caching behaviour.A small, cautious memory footprint.Caching is turned off entirely: every cache is emptied and bypassed, regardless of how much RAM the machine has.Leans towards caching more: keeps noticeably more rendered results in memory to further reduce repaint cost on machines that can spare the RAM. -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static SwingTreeInitConfig.CacheMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISABLED
Caching is turned off entirely: every cache is emptied and bypassed, regardless of how much RAM the machine has. Painting always re-renders from scratch — the lowest memory footprint, the highest CPU cost. -
CONSERVATIVE
A small, cautious memory footprint. Only the cheapest and most reused rendering results are kept. Good for memory-constrained environments. -
BALANCED
The default: a balanced trade-off between memory and CPU that reproduces SwingTree's historical, RAM-scaled caching behaviour. -
GENEROUS
Leans towards caching more: keeps noticeably more rendered results in memory to further reduce repaint cost on machines that can spare the RAM. -
AGGRESSIVE
Caches as much as the memory budget allows, trading the most memory for the least CPU time. Intended for powerful machines running heavy, animated or frequently-repainted UIs.
-
-
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
-