Class IconFactory


  • final class IconFactory
    extends java.lang.Object
    The icons for CSS properties and values.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​javax.swing.Icon> iconMap  
      private static IconFactory instance  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IconFactory()
      Private constructor to prevent instantiation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static IconFactory get()
      Returns the singleton instance of this class.
      javax.swing.Icon getIcon​(java.lang.String key)
      Returns the icon requested.
      private javax.swing.Icon loadIcon​(java.lang.String name)
      Loads an icon by file name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • iconMap

        private java.util.Map<java.lang.String,​javax.swing.Icon> iconMap
    • Constructor Detail

      • IconFactory

        private IconFactory()
        Private constructor to prevent instantiation.
    • Method Detail

      • get

        public static IconFactory get()
        Returns the singleton instance of this class.
        Returns:
        The singleton instance.
      • getIcon

        public javax.swing.Icon getIcon​(java.lang.String key)
        Returns the icon requested.
        Parameters:
        key - The key for the icon.
        Returns:
        The icon.
      • loadIcon

        private javax.swing.Icon loadIcon​(java.lang.String name)
        Loads an icon by file name.
        Parameters:
        name - The icon file name.
        Returns:
        The icon.