org.apache.jmeter.gui

## Class GUIFactory

- java.lang.Object
- - org.apache.jmeter.gui.GUIFactory

-     public final class GUIFactory
      extends java.lang.Object

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

- - ### Method Summary

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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getIcon

          public static javax.swing.ImageIcon getIcon(java.lang.Class<?> 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

          public static javax.swing.ImageIcon getIcon(java.lang.Class<?> 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

          public static javax.swing.JComponent getGUI(java.lang.Class<?> 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

          public static void registerIcon(java.lang.String key,
                                          javax.swing.ImageIcon icon)

      Register an icon so that it can later be retrieved via `getIcon(Class)`. 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

          public static void registerDisabledIcon(java.lang.String key,
                                                  javax.swing.ImageIcon icon)

      Register an icon so that it can later be retrieved via `getIcon(Class)`. 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

          public static void registerGUI(java.lang.String key,
                                         java.lang.Class<?> guiClass,
                                         java.lang.Class<?> testClass)
                                  throws java.lang.InstantiationException,
                                         java.lang.IllegalAccessException

      Register a GUI class so that it can later be retrieved via `getGUI(Class)`. 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
      Throws:
        `java.lang.InstantiationException` - if an instance of the GUI class can not be instantiated
        `java.lang.IllegalAccessException` - if access rights do not permit an instance of the GUI class to be created

Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.