Package com.nomagic.ui
Class IconUtilities
java.lang.Object
com.nomagic.ui.IconUtilities
Utility class to work wih Icons
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResizableIcon
getGrayIcon
(Icon icon, Component component) Returns gray(disabled) icon for a given one.static boolean
isExistingIconImage
(Icon icon) Used to check if icon really contains a valid imagestatic boolean
isImageFile
(File file) static BufferedImage
Create an image from a given iconstatic byte[]
toPng
(RenderedImage img) Export given image to PNG.static byte[]
Export given icon to PNG.static byte[]
Export given icon to SVG.
-
Field Details
-
IMAGE_SHAPE_IMAGE_TYPES
-
-
Constructor Details
-
IconUtilities
public IconUtilities()
-
-
Method Details
-
toSvg
Export given icon to SVG.- Parameters:
icon
- icon- Returns:
- svg bytes
-
toPng
Export given icon to PNG.- Parameters:
icon
- icon- Returns:
- png bytes
-
toPng
Export given image to PNG.- Parameters:
img
- image- Returns:
- png bytes
-
getGrayIcon
Returns gray(disabled) icon for a given one.- Parameters:
icon
- the given iconcomponent
- component- Returns:
- gray(disabled) icon
-
toImage
Create an image from a given icon- Parameters:
icon
- icon- Returns:
- image
-
isImageFile
-
isExistingIconImage
Used to check if icon really contains a valid image- Parameters:
icon
- icon- Returns:
- if icon image is valid
-