@OpenApiAll
public class IconsFactory
extends java.lang.Object
Class.getResource(String)
, so icon name should follow that notation.Constructor and Description |
---|
IconsFactory() |
Modifier and Type | Method and Description |
---|---|
static ResizableIcon |
getIcon(java.lang.Class clazz,
java.lang.String name)
Load icon from a given resource
|
static ResizableIcon |
getIcon(java.lang.Class clazz,
java.lang.String name,
boolean silent)
Load icon from a given resource.
|
static ResizableIcon |
getIcon(java.lang.String name)
Load icon from a given resource
|
static ResizableIcon |
getIcon(java.lang.String name,
boolean silent)
Load icon from a given resource.
|
static ResizableIcon |
getIcon(java.net.URI uri,
byte[] data)
Load icon from given bytes.
|
static ResizableIcon |
getIcon(java.net.URI uri,
byte[] data,
int size)
Load icon from given bytes.
|
static ResizableIcon |
getIcon(java.net.URL url)
Load icon from a given url.
|
static ResizableIcon |
getIcon(java.net.URL url,
int size)
Load icon from a given url.
|
static byte[] |
getIconData(java.io.File file)
Reads icon data from a given file.
|
static byte[] |
getIconData(java.io.InputStream input)
Reads icon data from a given stream.
|
static byte[] |
getIconData(java.net.URL url)
Reads icon data from a given url.
|
static ResizableIcon |
getNotScaledIcon(java.lang.Class clazz,
java.lang.String name)
Load icon from a given resource.
|
static ResizableIcon |
getNotScaledIcon(java.lang.String name)
Load icon from a given resource.
|
static ResizableIcon |
getNotScaledIcon(java.net.URI uri,
byte[] data)
Load icon from given bytes.
|
static ResizableIcon |
getNotScaledIcon(java.net.URI uri,
byte[] data,
int size)
Load icon from given bytes.
|
static ResizableIcon |
getNotScaledIcon(java.net.URL url)
Load icon from a given url.
|
static ResizableIcon |
getNotScaledIcon(java.net.URL url,
int size)
Load icon from a given url.
|
static java.lang.String |
getQualifiedResourceName(java.lang.String resourceName)
Resolves given resource name to a qualified name in this package.
|
static java.net.URL |
getResource(java.lang.String name)
Provide URL to a resource in this package
|
static java.io.InputStream |
getResourceAsStream(java.lang.String name)
Provide stream to a resource in this package
|
static ResizableIcon |
getSvgIcon(java.net.URL url)
Load SVG icon from a given url.
|
public static ResizableIcon getIcon(java.lang.String name)
name
- icon nameClass.getResource(java.lang.String)
public static ResizableIcon getIcon(java.lang.Class clazz, java.lang.String name)
clazz
- icon resource classname
- icon nameClass.getResource(java.lang.String)
public static ResizableIcon getNotScaledIcon(java.lang.String name)
name
- icon nameClass.getResource(java.lang.String)
public static ResizableIcon getNotScaledIcon(java.lang.Class clazz, java.lang.String name)
clazz
- icon resource classname
- icon nameClass.getResource(java.lang.String)
public static ResizableIcon getIcon(java.lang.String name, boolean silent)
name
- icon namesilent
- true if missing icon should not be reported to a log fileClass.getResource(java.lang.String)
public static ResizableIcon getIcon(java.lang.Class clazz, java.lang.String name, boolean silent)
clazz
- icon resource classname
- icon namesilent
- true if missing icon should not be reported to a log fileClass.getResource(java.lang.String)
public static java.io.InputStream getResourceAsStream(java.lang.String name)
name
- resource nameClass.getResourceAsStream(String)
public static java.net.URL getResource(java.lang.String name)
name
- resource nameClass.getResource(java.lang.String)
public static java.lang.String getQualifiedResourceName(java.lang.String resourceName)
resourceName
- resource namepublic static ResizableIcon getIcon(java.net.URL url)
url
- urlpublic static ResizableIcon getIcon(java.net.URL url, int size)
url
- urlsize
- icon box size. -1 if scaling is not neededpublic static ResizableIcon getNotScaledIcon(java.net.URL url)
url
- urlpublic static ResizableIcon getNotScaledIcon(java.net.URL url, int size)
url
- urlsize
- icon box size. -1 if scaling is not neededpublic static ResizableIcon getIcon(java.net.URI uri, @Nonnull byte[] data)
uri
- uri describing the location (or format) of the icondata
- an array of icon data bytespublic static ResizableIcon getIcon(java.net.URI uri, @Nonnull byte[] data, int size)
uri
- uridata
- an array of icon datasize
- icon box size. Icon will be scaled to this box. -1 if scaling is not neededHiDPIScaleUtilities.scaleIcon(int)
public static ResizableIcon getNotScaledIcon(java.net.URI uri, @Nonnull byte[] data)
uri
- icon uridata
- an array of icon datapublic static ResizableIcon getNotScaledIcon(java.net.URI uri, @Nonnull byte[] data, int size)
uri
- icon uridata
- an array of icon datasize
- icon box size. Icon will be scaled to this box. -1 if scaling is not needed@CheckForNull public static byte[] getIconData(java.io.File file)
file
- an icon file@CheckForNull public static byte[] getIconData(java.net.URL url)
url
- icon url@CheckForNull public static byte[] getIconData(java.io.InputStream input)
input
- input stream@CheckForNull public static ResizableIcon getSvgIcon(java.net.URL url)
ImageIcon
.url
- icon url