Class IconFactory

java.lang.Object
VASSAL.tools.icon.IconFactory

public final class IconFactory
extends Object
Manage and Provide Icons in standard sizes.
  • Constructor Details

    • IconFactory

      public IconFactory()
      Create a new IconFactory.
  • Method Details

    • getIcon

      public static Icon getIcon​(String iconFamilyName, int size)
      Return an Icon of the specified size. Standard sizes are defined in IconFamily
      Parameters:
      IconFamilyName - Name of Icon family
      size - Size (See IconFamily)
      Returns:
      Sized Icon
    • getImage

      public static BufferedImage getImage​(String iconFamilyName, int size)
      Return an Icon of the specified size as an Image. Standard sizes are defined in IconFamily
      Parameters:
      IconFamilyName - Name of Icon family
      size - Size (See IconFamily)
      Returns:
      Sized Image
    • getIconFamilyNames

      public static List<String> getIconFamilyNames()
      Return a sorted list of all Icon Family names.
      Returns:
    • addIconFamily

      public static void addIconFamily​(IconFamily family)
      Add a new IconFamily
      Parameters:
      family - Icon Family Name
    • removeIconFamily

      public static void removeIconFamily​(IconFamily family)
      Remove an IconFamily
      Parameters:
      name - Icon Family Name
    • renameIconFamily

      public static void renameIconFamily​(String oldName, IconFamily family)
      Rename an IconFamily
      Parameters:
      oldName - Old Icon Family Name
      newName - New Icon Family Name
    • getIconFamily

      public static IconFamily getIconFamily​(String name)
      Return an Icon Family
      Parameters:
      name -
      Returns:
    • findLocalSizedIcons

      protected void findLocalSizedIcons​(int size) throws IOException
      Record all icons of the specified size found in the local file system NB. Vassal is not running from a bundled Jar file
      Parameters:
      size -
      Throws:
      IOException