public class ImageParser
extends java.lang.Object
BufferedImage
instances from string representations. Each
image is loaded only once.Constructor and Description |
---|
ImageParser(@NotNull JXCSkinSource skinSource)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Forgets all defined images.
|
@Nullable java.awt.Image |
getImage(@Nullable java.awt.Color color,
@NotNull java.lang.String name)
Optionally loads an image by base file name.
|
@NotNull java.awt.image.BufferedImage |
getImage(@NotNull java.lang.String name)
Loads an image by base file name.
|
public ImageParser(@NotNull @NotNull JXCSkinSource skinSource)
skinSource
- the skin source for loading resourcespublic void clear()
@Nullable public @Nullable java.awt.Image getImage(@Nullable @Nullable java.awt.Color color, @NotNull @NotNull java.lang.String name) throws java.io.IOException
color
- if non-null
, return null
name
- the base file namenull
if color!=null
java.io.IOException
- if the image cannot be loaded@NotNull public @NotNull java.awt.image.BufferedImage getImage(@NotNull @NotNull java.lang.String name) throws java.io.IOException
name
- the base file namejava.io.IOException
- if the image cannot be loaded