mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-09 08:15:09 +03:00
FlatLaf: use larger initial capacity for UI defaults table to avoid resizing hash table and to save some memory
This commit is contained in:
@@ -354,7 +354,14 @@ public abstract class FlatLaf
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UIDefaults getDefaults() {
|
public UIDefaults getDefaults() {
|
||||||
UIDefaults defaults = super.getDefaults();
|
// use larger initial capacity to avoid resizing UI defaults hash table
|
||||||
|
// (from 610 to 1221 to 2443 entries) and to save some memory
|
||||||
|
UIDefaults defaults = new UIDefaults( 1500, 0.75f );
|
||||||
|
|
||||||
|
// initialize basic defaults (see super.getDefaults())
|
||||||
|
initClassDefaults( defaults );
|
||||||
|
initSystemColorDefaults( defaults );
|
||||||
|
initComponentDefaults( defaults );
|
||||||
|
|
||||||
// add flag that indicates whether the LaF is light or dark
|
// add flag that indicates whether the LaF is light or dark
|
||||||
// (can be queried without using FlatLaf API)
|
// (can be queried without using FlatLaf API)
|
||||||
|
|||||||
Reference in New Issue
Block a user