Class ResourceIcons


  • public class ResourceIcons
    extends java.lang.Object
    Creates ImageIcon instances from resources. The returned image icons are cached.
    • Field Detail

      • SYSTEM_DIR

        public static final java.lang.String SYSTEM_DIR
        The directory that contains the system icons.
        See Also:
        Constant Field Values
      • SQUARE_SELECTED_SQUARE

        @NotNull
        public static final @NotNull java.lang.String SQUARE_SELECTED_SQUARE
        See Also:
        Constant Field Values
      • SQUARE_SELECTED_SQUARE_NORTH

        @NotNull
        public static final @NotNull java.lang.String SQUARE_SELECTED_SQUARE_NORTH
        See Also:
        Constant Field Values
      • SQUARE_SELECTED_SQUARE_EAST

        @NotNull
        public static final @NotNull java.lang.String SQUARE_SELECTED_SQUARE_EAST
        See Also:
        Constant Field Values
      • SQUARE_SELECTED_SQUARE_SOUTH

        @NotNull
        public static final @NotNull java.lang.String SQUARE_SELECTED_SQUARE_SOUTH
        See Also:
        Constant Field Values
      • SQUARE_SELECTED_SQUARE_WEST

        @NotNull
        public static final @NotNull java.lang.String SQUARE_SELECTED_SQUARE_WEST
        See Also:
        Constant Field Values
      • SQUARE_PRE_SELECTED_SQUARE

        @NotNull
        public static final @NotNull java.lang.String SQUARE_PRE_SELECTED_SQUARE
        See Also:
        Constant Field Values
      • SQUARE_CURSOR

        @NotNull
        public static final @NotNull java.lang.String SQUARE_CURSOR
        See Also:
        Constant Field Values
      • SQUARE_EMPTY

        @NotNull
        public static final @NotNull java.lang.String SQUARE_EMPTY
        See Also:
        Constant Field Values
      • SQUARE_UNKNOWN

        @NotNull
        public static final @NotNull java.lang.String SQUARE_UNKNOWN
        See Also:
        Constant Field Values
      • SQUARE_NO_FACE

        @NotNull
        public static final @NotNull java.lang.String SQUARE_NO_FACE
        See Also:
        Constant Field Values
      • SQUARE_NO_ARCH

        @NotNull
        public static final @NotNull java.lang.String SQUARE_NO_ARCH
        See Also:
        Constant Field Values
      • TREASURE_LIST

        @NotNull
        public static final @NotNull java.lang.String TREASURE_LIST
        See Also:
        Constant Field Values
      • TREASUREONE_LIST

        @NotNull
        public static final @NotNull java.lang.String TREASUREONE_LIST
        See Also:
        Constant Field Values
      • TREASURE_YES

        @NotNull
        public static final @NotNull java.lang.String TREASURE_YES
        See Also:
        Constant Field Values
      • TREASURE_NO

        @NotNull
        public static final @NotNull java.lang.String TREASURE_NO
        See Also:
        Constant Field Values
      • DEFAULT_ICON

        @NotNull
        public static final @NotNull java.lang.String DEFAULT_ICON
        The default map icon to use if no icon can be created.
        See Also:
        Constant Field Values
      • DEFAULT_PREVIEW

        @NotNull
        public static final @NotNull java.lang.String DEFAULT_PREVIEW
        The default map preview to use if no icon can be created.
        See Also:
        Constant Field Values
      • CLOSE_TAB_SMALL_ICON

        @NotNull
        public static final @NotNull java.lang.String CLOSE_TAB_SMALL_ICON
        See Also:
        Constant Field Values
      • AUTO_RUN_SMALL_ICON

        @NotNull
        public static final @NotNull java.lang.String AUTO_RUN_SMALL_ICON
        See Also:
        Constant Field Values
      • FILTER_SMALL_ICON

        @NotNull
        public static final @NotNull java.lang.String FILTER_SMALL_ICON
        See Also:
        Constant Field Values
      • RUN_PLUGIN_SMALL_ICON

        @NotNull
        public static final @NotNull java.lang.String RUN_PLUGIN_SMALL_ICON
        See Also:
        Constant Field Values
      • APP_ICON

        @NotNull
        public static final @NotNull java.lang.String APP_ICON
        Application icon definitions (icon-dir).
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceIcons

        public ResourceIcons()
    • Method Detail

      • getResourceIcon

        @NotNull
        public @NotNull javax.swing.ImageIcon getResourceIcon​(@NotNull
                                                              @NotNull java.lang.String iconName)
                                                       throws java.util.MissingResourceException
        Returns the image icon for the given icon name. Loads every icon only once and uses hash table to return the same instance if same icon name is given. Note: There must not be conflicting icon names from different directories.
        Parameters:
        iconName - the icon name
        Returns:
        the image icon for the given icon name
        Throws:
        java.util.MissingResourceException - if the icon cannot be loaded
      • addToCache

        public void addToCache​(@NotNull
                               @NotNull java.lang.String name,
                               @NotNull
                               @NotNull javax.swing.ImageIcon imageIcon)
        Add an image to the cache.
        Parameters:
        name - the name
        imageIcon - the image icon
      • getWarningSquareIcon

        @NotNull
        public @NotNull javax.swing.ImageIcon getWarningSquareIcon()
      • getLightSquareIcon

        @NotNull
        public @NotNull javax.swing.ImageIcon getLightSquareIcon()
        Returns the ImageIcon for highlighting map squares that are affected by nearby light emitting game objects.
        Returns:
        the image icon