Class GUIFactory

  • All Implemented Interfaces:

    
    public final class GUIFactory
    
                        

    Provides a way to register and retrieve GUI classes and icons.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      static ImageIcon getIcon(Class<out Object> elementClass) Get an icon which has previously been registered for this class object.
      static ImageIcon getIcon(Class<out Object> elementClass, boolean enabled) Get icon/disabledicon which has previously been registered for this class object.
      static JComponent getGUI(Class<out Object> elementClass) Get a component instance which has previously been registered for this class object.
      static void registerIcon(String key, ImageIcon icon) Register an icon so that it can later be retrieved via getIcon.
      static void registerDisabledIcon(String key, ImageIcon icon) Register an icon so that it can later be retrieved via getIcon.
      static void registerGUI(String key, Class<out Object> guiClass, Class<out Object> testClass) Register a GUI class so that it can later be retrieved via getGUI.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getIcon

         static ImageIcon getIcon(Class<out Object> elementClass)

        Get an icon which has previously been registered for this class object.

        Parameters:
        elementClass - the class object which we want to get an icon for
        Returns:

        the associated icon, or null if this class or its superclass has not been registered

      • getIcon

         static ImageIcon getIcon(Class<out Object> elementClass, boolean enabled)

        Get icon/disabledicon which has previously been registered for this class object.

        Parameters:
        elementClass - the class object which we want to get an icon for
        enabled - - is icon enabled
        Returns:

        the associated icon, or null if this class or its superclass has not been registered

      • getGUI

         static JComponent getGUI(Class<out Object> elementClass)

        Get a component instance which has previously been registered for this class object.

        Parameters:
        elementClass - the class object which we want to get an instance of
        Returns:

        an instance of the class, or null if this class or its superclass has not been registered

      • registerIcon

         static void registerIcon(String key, ImageIcon icon)

        Register an icon so that it can later be retrieved via getIcon. The key should match the fully-qualified class name for the class used as the parameter when retrieving the icon.

        Parameters:
        key - the name which can be used to retrieve this icon later
        icon - the icon to store
      • registerDisabledIcon

         static void registerDisabledIcon(String key, ImageIcon icon)

        Register an icon so that it can later be retrieved via getIcon. The key should match the fully-qualified class name for the class used as the parameter when retrieving the icon.

        Parameters:
        key - the name which can be used to retrieve this icon later
        icon - the icon to store
      • registerGUI

         static void registerGUI(String key, Class<out Object> guiClass, Class<out Object> testClass)

        Register a GUI class so that it can later be retrieved via getGUI. The key should match the fully-qualified class name for the class used as the parameter when retrieving the GUI.

        Parameters:
        key - the name which can be used to retrieve this GUI later
        guiClass - the class object for the GUI component
        testClass - the class of the objects edited by this GUI