- java.lang.Object
-
- org.icepdf.ri.images.IconPack
-
- Direct Known Subclasses:
DefaultIconPack
public abstract class IconPack extends Object
Abstract class providing logic for fetching icons from the classpath Ultimately, this should only be called by theImagesutility class- Author:
- Alexander Leithner
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIconPack.VariantEnum describing the different available variants of any iconstatic classIconPack.VariantPoolData class advertising the different (optional) variants an icon pack provides
-
Constructor Summary
Constructors Constructor Description IconPack()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract IcongetIcon(String name, IconPack.Variant variant, Images.IconSize size)Gets a single icon with the given name in the given variant and size from the classpath.abstract IconPack.VariantPoolgetProvidedVariants()Gets all variants this icon pack provides for at least one icon.
-
-
-
Method Detail
-
getProvidedVariants
public abstract IconPack.VariantPool getProvidedVariants()
Gets all variants this icon pack provides for at least one icon. This method is called by theImagesutility class when deciding what icons to register to a given component. No guarantee regarding further usage is made.- Returns:
- Information about what variant this icon pack provides.
-
getIcon
public abstract Icon getIcon(String name, IconPack.Variant variant, Images.IconSize size) throws RuntimeException
Gets a single icon with the given name in the given variant and size from the classpath. Note that thesizeparameter is to be regarded as a hint. If the icon pack deems it necessary to return another size for any given icon, the icon will be returned in this size instead. No guarantee is made that any icon return by this method is square- Parameters:
name- The name of the icon to retrievevariant- The variant to retrievesize- The size to retrieve- Returns:
- The icon requested in the given variant, either in the wanted size or a similar size
- Throws:
RuntimeException- If the icon could not be retrieved from the classpath or any other error occurs
-
-