public abstract class AbstractIconMap extends HashMap<IconId,Icon> implements IIconMap
IIconMap interface that provides
mechanisms to store, retrieve, and load icons.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier | Constructor and Description |
|---|---|
protected |
AbstractIconMap(int iconWidth,
int iconHeight)
Constructs a new icon map.
|
| Modifier and Type | Method and Description |
|---|---|
Icon |
getDisabledIcon(IconId id)
Returns a disabled version of the icon for the given ID.
|
Icon |
getIcon(IconId id)
Returns an icon for the given ID.
|
Dimension |
getIconDimension()
Returns the size of the icons in the map.
|
List<String> |
getLoadedFileNames()
Returns the filenames used for loading the icons.
|
protected Icon |
loadIcon(Class<? extends AbstractIconMap> iconMap,
String fileName)
Loads the image with the given name from the package where the specified
class is located.
|
void |
setIcon(IconId id,
Icon icon)
Specifies a new icon for the given ID.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringprotected AbstractIconMap(int iconWidth,
int iconHeight)
iconWidth - the width of icons in this mapiconHeight - the height of icons in this mappublic Icon getIcon(IconId id)
IIconMappublic Dimension getIconDimension()
IIconMapgetIconDimension in interface IIconMappublic Icon getDisabledIcon(IconId id)
IIconMapgetDisabledIcon in interface IIconMapid - the ID for which to return an iconprotected Icon loadIcon(Class<? extends AbstractIconMap> iconMap, String fileName)
iconMap - the class of the icon map implementationfileName - the name of the icon file (e.g. Folder.gif)Copyright © 2006–2020 Dirk Lemmermann Software & Consulting. All rights reserved.