public class ImageLoader extends java.lang.Object
Loads image resources from various locations (filesystem, classpath, extra class loaders) caches them and returns them as Swing Icons. Image Paths can include "___" sections to indicate variants (e.g. /icon___light___primary.svg). The loader will try to resolve the most specific variant first, then backtrack to more generic variants if not found. E.g. if /icon___light___primary.svg is not found, it will try /icon___light.svg, and then /icon.svg. This approach was used because many icons have multiple variants (light/dark, primary/secondary) etc. Dynamically replacing colors in SVGs at runtime was considered cumbersome to support all color overrides. This approach requires more bundled image resources, but is simpler and more reliable.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
BACKTRACK_SEPARATOR |
| Constructor and description |
|---|
ImageLoader(java.util.List<java.lang.ClassLoader> extraClassLoaders)Constructs an ImageLoader with the given extra class loaders. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public java.lang.String |
getAbsolutePath(java.lang.String path) |
|
public java.util.Optional<java.net.URL> |
load(java.lang.String key) |
|
public javax.swing.Icon |
load(java.lang.String path)Loads an image from the given path and returns it as a Swing Icon. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Constructs an ImageLoader with the given extra class loaders.
extraClassLoaders - additional class loaders to search for resourcesLoads an image from the given path and returns it as a Swing Icon.
path - the image path to loadReadyAPI functional (soapui) SDK 4.0.1