/** * Retrieves round icon for slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @return Round icon for slider in {@link SubstanceSliderUI}. */ public static Icon getSliderRoundIcon(int size) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size); if (SubstanceIconFactory.sliderRoundIcons.get(key) == null) { Icon icon = new SliderRoundIcon(size); SubstanceIconFactory.sliderRoundIcons.put(key, icon); } return SubstanceIconFactory.sliderRoundIcons.get(key); }
/** * Creates an empty map of title pane icons. * * @return Empty map of title pane icons. */ private static Map<IconKind, LazyResettableHashMap<Icon>> createTitlePaneIcons() { Map<IconKind, LazyResettableHashMap<Icon>> result = new HashMap<IconKind, LazyResettableHashMap<Icon>>(); result.put(IconKind.CLOSE, new LazyResettableHashMap<Icon>( "Close title pane icons")); result.put(IconKind.MINIMIZE, new LazyResettableHashMap<Icon>( "Minimize title pane icons")); result.put(IconKind.MAXIMIZE, new LazyResettableHashMap<Icon>( "Maximize title pane icons")); result.put(IconKind.RESTORE, new LazyResettableHashMap<Icon>( "Restore title pane icons")); return result; }
/** * Puts a new key-value pair in the map. * * @param key * Pair key. * @param entry * Pair value. */ public void put(HashMapKey key, T entry) { synchronized (instanceLock) { this.createIfNecessary(); this.cache.put(key, entry); } }
/** * Returns the memory usage string. * * @return The memory usage string. */ public static String getMemoryUsage() { StringBuffer sb = new StringBuffer(); sb.append("SubstanceScrollBarUI: \n"); sb.append("\t" + thumbHorizontalMap.size() + " thumb horizontal, " + thumbVerticalMap.size() + " thumb vertical"); sb.append("\t" + trackHorizontalMap.size() + " track horizontal, " + trackVerticalMap.size() + " track vertical"); return sb.toString(); }
LazyResettableHashMap.reset();
true)); bw.write(sdf.format(new Date()) + "\n"); java.util.List<String> stats = LazyResettableHashMap.getStats(); if (stats != null) { for (String stat : stats) {
/** * Returns the memory usage string. * * @return The memory usage string. */ public static String getMemoryUsage() { StringBuffer sb = new StringBuffer(); sb.append("SubstanceScrollBarUI: \n"); sb.append("\t" + thumbHorizontalMap.size() + " thumb horizontal, " + thumbVerticalMap.size() + " thumb vertical"); sb.append("\t" + trackHorizontalMap.size() + " track horizontal, " + trackVerticalMap.size() + " track vertical"); sb.append("\t" + trackFullHorizontalMap.size() + " track full horizontal, " + trackFullVerticalMap.size() + " track full vertical"); return sb.toString(); }
@Override public void uninitialize() { super.uninitialize(); SubstanceLookAndFeel.currentSkin = null; ShadowPopupFactory.uninstall(); SubstanceCoreUtilities.stopThreads(); // fix for defect 109 - memory leak on watermarks if (this.skin.getWatermark() != null) this.skin.getWatermark().dispose(); // uninitialize component plugins SubstanceLookAndFeel.componentPlugins.uninitializeAll(); // reset widget support LafWidgetRepository.getRepository().unsetLafSupport(); // clear caches LazyResettableHashMap.reset(); this.currentKeyboardFocusManager .removePropertyChangeListener(this.focusOwnerChangeListener); this.focusOwnerChangeListener = null; this.currentKeyboardFocusManager = null; }
true)); bw.write(sdf.format(new Date()) + "\n"); java.util.List<String> stats = LazyResettableHashMap.getStats(); if (stats != null) { for (String stat : stats) {
/** * Retrieves round icon for slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @return Round icon for slider in {@link SubstanceSliderUI}. */ public static Icon getSliderRoundIcon(int size) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size); if (SubstanceIconFactory.sliderRoundIcons.get(key) == null) { Icon icon = new SliderRoundIcon(size); SubstanceIconFactory.sliderRoundIcons.put(key, icon); } return SubstanceIconFactory.sliderRoundIcons.get(key); }
/** * Returns the memory usage string. * * @return Memory usage string. */ static String getMemoryUsage() { StringBuffer sb = new StringBuffer(); sb.append("SubstanceBackgroundDelegate: \n"); sb.append("\t" + regularBackgrounds.size() + " regular"); // + pairwiseBackgrounds.size() + " pairwise"); return sb.toString(); }
@Override public void uninitialize() { super.uninitialize(); SubstanceLookAndFeel.currentSkin = null; ShadowPopupFactory.uninstall(); SubstanceCoreUtilities.stopThreads(); // fix for defect 109 - memory leak on watermarks if (this.skin.getWatermark() != null) this.skin.getWatermark().dispose(); // uninitialize component plugins SubstanceLookAndFeel.componentPlugins.uninitializeAll(); // reset widget support LafWidgetRepository.getRepository().unsetLafSupport(); // clear caches LazyResettableHashMap.reset(); this.currentKeyboardFocusManager .removePropertyChangeListener(this.focusOwnerChangeListener); this.focusOwnerChangeListener = null; this.currentKeyboardFocusManager = null; }
/** * Puts a new key-value pair in the map. * * @param key * Pair key. * @param entry * Pair value. */ public void put(HashMapKey key, T entry) { if (!SwingUtilities.isEventDispatchThread()) throw new IllegalArgumentException( "Called outside Event Dispatch Thread"); this.createIfNecessary(); this.cache.put(key, entry); }
/** * Creates an empty map of title pane icons. * * @return Empty map of title pane icons. */ private static Map<IconKind, LazyResettableHashMap<Icon>> createTitlePaneIcons() { Map<IconKind, LazyResettableHashMap<Icon>> result = new HashMap<IconKind, LazyResettableHashMap<Icon>>(); result.put(IconKind.CLOSE, new LazyResettableHashMap<Icon>( "Close title pane icons")); result.put(IconKind.MINIMIZE, new LazyResettableHashMap<Icon>( "Minimize title pane icons")); result.put(IconKind.MAXIMIZE, new LazyResettableHashMap<Icon>( "Maximize title pane icons")); result.put(IconKind.RESTORE, new LazyResettableHashMap<Icon>( "Restore title pane icons")); return result; }
/** * Retrieves icon for horizontal slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for horizontal slider in {@link SubstanceSliderUI}. */ public static Icon getSliderHorizontalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderHorizontalIcons.get(key) == null) { Icon icon = new SliderHorizontalIcon(size, isMirrorred); SubstanceIconFactory.sliderHorizontalIcons.put(key, icon); } return SubstanceIconFactory.sliderHorizontalIcons.get(key); }
/** * Returns the memory usage string. * * @return Memory usage string. */ public static String getMemoryUsage() { StringBuffer sb = new StringBuffer(); sb.append("SubstanceHighlightUtils: \n"); sb.append("\t" + smallCache.size() + " smalls"); return sb.toString(); } }
LazyResettableHashMap.reset();
/** * Retrieves icon for vertical slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for vertical slider in {@link SubstanceSliderUI}. */ public static Icon getSliderVerticalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderVerticalIcons.get(key) == null) { Icon icon = new SliderVerticalIcon(size, isMirrorred); SubstanceIconFactory.sliderVerticalIcons.put(key, icon); } return SubstanceIconFactory.sliderVerticalIcons.get(key); }
/** * Returns the memory usage string. * * @return Memory usage string. */ static String getMemoryUsage() { StringBuffer sb = new StringBuffer(); sb.append("SubstanceBackgroundDelegate: \n"); sb.append("\t" + regularBackgrounds.size() + " regular"); // + pairwiseBackgrounds.size() + " pairwise"); return sb.toString(); }
/** * Retrieves icon for vertical slider in {@link SubstanceSliderUI}. * * @param size * The size of the icon to retrieve. * @param isMirrorred * Indication whether the icon should be mirrored. * @return Icon for vertical slider in {@link SubstanceSliderUI}. */ public static Icon getSliderVerticalIcon(int size, boolean isMirrorred) { HashMapKey key = SubstanceCoreUtilities.getHashKey(size, isMirrorred); if (SubstanceIconFactory.sliderVerticalIcons.get(key) == null) { Icon icon = new SliderVerticalIcon(size, isMirrorred); SubstanceIconFactory.sliderVerticalIcons.put(key, icon); } return SubstanceIconFactory.sliderVerticalIcons.get(key); }