|
|
@ -39,8 +39,11 @@ public final class IconLoader { |
|
|
|
private static final Logger LOGGER = Logger.getLogger(IconLoader.class.getName()); |
|
|
|
private static final Logger LOGGER = Logger.getLogger(IconLoader.class.getName()); |
|
|
|
private static final Map<Class<?>, IconLoader> iconLoaderMap = new HashMap<>(); |
|
|
|
private static final Map<Class<?>, IconLoader> iconLoaderMap = new HashMap<>(); |
|
|
|
private static final IconLoader instance = new IconLoader(IconLoader.class); |
|
|
|
private static final IconLoader instance = new IconLoader(IconLoader.class); |
|
|
|
|
|
|
|
|
|
|
|
private static final Map<UIAwareIcon, AwareIconStyle> uiAwareIconStatus = new WeakHashMap<>(); |
|
|
|
private static final Map<UIAwareIcon, AwareIconStyle> uiAwareIconStatus = new WeakHashMap<>(); |
|
|
|
private static final Map<ThemedSVGIcon, Object> themedIconStatus = new WeakHashMap<>(); |
|
|
|
private static final Map<ThemedSVGIcon, Object> themedIconStatus = new WeakHashMap<>(); |
|
|
|
|
|
|
|
private static Object currentThemeKey; |
|
|
|
|
|
|
|
private static AwareIconStyle currentAwareStyle; |
|
|
|
|
|
|
|
|
|
|
|
private static final int DEFAULT_W = 16; |
|
|
|
private static final int DEFAULT_W = 16; |
|
|
|
private static final int DEFAULT_H = 16; |
|
|
|
private static final int DEFAULT_H = 16; |
|
|
@ -69,10 +72,12 @@ public final class IconLoader { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void updateAwareStyle(final AwareIconStyle style) { |
|
|
|
public static void updateAwareStyle(final AwareIconStyle style) { |
|
|
|
|
|
|
|
currentAwareStyle = style; |
|
|
|
uiAwareIconStatus.entrySet().forEach(e -> e.setValue(style)); |
|
|
|
uiAwareIconStatus.entrySet().forEach(e -> e.setValue(style)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void updateThemeStatus(final Object theme) { |
|
|
|
public static void updateThemeStatus(final Object theme) { |
|
|
|
|
|
|
|
currentThemeKey = theme; |
|
|
|
themedIconStatus.entrySet().forEach(e -> e.setValue(theme)); |
|
|
|
themedIconStatus.entrySet().forEach(e -> e.setValue(theme)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -84,12 +89,12 @@ public final class IconLoader { |
|
|
|
return themedIconStatus.get(icon); |
|
|
|
return themedIconStatus.get(icon); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void registerAwareIcon(final UIAwareIcon icon, final AwareIconStyle style) { |
|
|
|
public static void registerAwareIcon(final UIAwareIcon icon) { |
|
|
|
uiAwareIconStatus.put(icon, style); |
|
|
|
uiAwareIconStatus.put(icon, currentAwareStyle); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void registerThemedIcon(final ThemedSVGIcon icon, final Object status) { |
|
|
|
public static void registerThemedIcon(final ThemedSVGIcon icon) { |
|
|
|
themedIconStatus.put(icon, status); |
|
|
|
themedIconStatus.put(icon, currentThemeKey); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public DarkUIAwareIcon getUIAwareIcon(final String path) { |
|
|
|
public DarkUIAwareIcon getUIAwareIcon(final String path) { |
|
|
|