Class ImageParser
- java.lang.Object
-
- com.realtime.crossfire.jxclient.skin.io.ImageParser
-
public class ImageParser extends java.lang.ObjectCreatesBufferedImageinstances from string representations. Each image is loaded only once.
-
-
Constructor Summary
Constructors Constructor Description ImageParser(@NotNull JXCSkinSource skinSource)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Forgets all defined images.@NotNull java.awt.image.BufferedImagegetImage(@NotNull java.lang.String name)Loads an image by base file name.@Nullable java.awt.ImagegetImage(@Nullable java.awt.Color color, @NotNull java.lang.String name)Optionally loads an image by base file name.
-
-
-
Constructor Detail
-
ImageParser
public ImageParser(@NotNull @NotNull JXCSkinSource skinSource)Creates a new instance.- Parameters:
skinSource- the skin source for loading resources
-
-
Method Detail
-
clear
public void clear()
Forgets all defined images.
-
getImage
@Nullable public @Nullable java.awt.Image getImage(@Nullable @Nullable java.awt.Color color, @NotNull @NotNull java.lang.String name) throws java.io.IOExceptionOptionally loads an image by base file name.- Parameters:
color- if non-null, returnnullname- the base file name- Returns:
- the image, or
nullifcolor!=null - Throws:
java.io.IOException- if the image cannot be loaded
-
getImage
@NotNull public @NotNull java.awt.image.BufferedImage getImage(@NotNull @NotNull java.lang.String name) throws java.io.IOExceptionLoads an image by base file name.- Parameters:
name- the base file name- Returns:
- the image
- Throws:
java.io.IOException- if the image cannot be loaded
-
-