Class ImageParser

java.lang.Object
com.realtime.crossfire.jxclient.skin.io.ImageParser

public class ImageParser extends Object
Creates BufferedImage instances from string representations. Each image is loaded only once.
  • Constructor Details

    • ImageParser

      public ImageParser(@NotNull @NotNull JXCSkinSource skinSource)
      Creates a new instance.
      Parameters:
      skinSource - the skin source for loading resources
  • Method Details

    • clear

      public void clear()
      Forgets all defined images.
    • getImage

      @Nullable public @Nullable Image getImage(@Nullable @Nullable Color color, @NotNull @NotNull String name) throws IOException
      Optionally loads an image by base file name.
      Parameters:
      color - if non-null, return null
      name - the base file name
      Returns:
      the image, or null if color!=null
      Throws:
      IOException - if the image cannot be loaded
    • getImage

      @NotNull public @NotNull BufferedImage getImage(@NotNull @NotNull String name) throws IOException
      Loads an image by base file name.
      Parameters:
      name - the base file name
      Returns:
      the image
      Throws:
      IOException - if the image cannot be loaded