@NonNls public final class IconUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Icon |
createScaledColourIcon(int colour)
Create a 16x16 pixel icon of a solid colour.
|
static Icon |
createScaledLetterIcon(char letter,
Color colour) |
static String |
getTheme() |
static ImageIcon |
loadScaledIcon(ClassLoader classLoader,
String path)
Load an icon from the classpath using a specific class loader.
|
static ImageIcon |
loadScaledIcon(String path)
Load an icon from the classpath using the system class loader.
|
static BufferedImage |
loadScaledImage(ClassLoader classLoader,
String path)
Load an image from the classpath using a specific class loader.
|
static BufferedImage |
loadScaledImage(String path)
Load an image from the classpath using the system class loader.
|
static ImageIcon |
loadUnscaledIcon(String path)
Load an icon from the classpath using the system class loader.
|
static BufferedImage |
loadUnscaledImage(String path)
Load an image from the classpath using the system class loader.
|
static Icon |
rotateIcon(Icon icon,
int degrees)
Rotate a square icon clockwise by the specified number of degrees.
|
static ImageIcon |
scaleIcon(ImageIcon icon,
int size)
Scale a square icon using bicubic scaling.
|
static BufferedImage |
scaleIcon(Image iconImage,
int size)
Scale a square icon using bicubic scaling.
|
static void |
setTheme(String theme) |
public static String getTheme()
public static void setTheme(String theme)
public static ImageIcon loadUnscaledIcon(String path)
The icon will not be scaled.
path - The path of the image to load.null if the specified path did not contain a resource.public static ImageIcon loadScaledIcon(String path)
The icon will automatically be scaled up for HiDPI displays.
path - The path of the image to load.null if the specified path did not contain a resource.public static ImageIcon loadScaledIcon(ClassLoader classLoader, String path)
The icon will automatically be scaled up for HiDPI displays.
classLoader - The class loader to use to load the image.path - The path of the image to load.null if the specified path did not contain a resource.public static BufferedImage loadUnscaledImage(String path)
theme is set it will first look for a
themed version of the image by appending _<theme> to the filename.
The image will be returned at its original resolution and not be rescaled.
path - The path of the image to load.null if the specified path did not contain a resource.setTheme(String)public static BufferedImage loadScaledImage(String path)
The image will automatically be scaled up for HiDPI displays.
path - The path of the image to load.null if the specified path did not contain a resource.public static BufferedImage loadScaledImage(ClassLoader classLoader, String path)
theme is set it will first look for a
themed version of the image by appending _<theme> to the filename.
The image will automatically be scaled up for HiDPI displays.
classLoader - The class loader to use to load the image.path - The path of the image to load.null if the specified path did not contain a resource.setTheme(String)public static Icon createScaledColourIcon(int colour)
The icon will automatically be scaled up for HiDPI displays.
colour - The colour as a combined rgb value.public static ImageIcon scaleIcon(ImageIcon icon, int size)
The icon will automatically be scaled up for HiDPI displays.
icon - The icon to scale.size - The size (edge to edge) of the scaled icon.public static BufferedImage scaleIcon(Image iconImage, int size)
The icon will automatically be scaled up for HiDPI displays.
iconImage - The icon to scale.size - The size (edge to edge) of the scaled icon.Copyright © 2011–2023 pepsoft.org. All rights reserved.