public final class GUIFactory extends Object
Modifier and Type | Method and Description |
---|---|
static JComponent |
getGUI(Class<?> elementClass)
Get a component instance which has previously been registered for this
class object.
|
static ImageIcon |
getIcon(Class<?> elementClass)
Get an icon which has previously been registered for this class object.
|
static ImageIcon |
getIcon(Class<?> elementClass,
boolean enabled)
Get icon/disabledicon which has previously been registered for this class
object.
|
static void |
registerDisabledIcon(String key,
ImageIcon icon)
Register an icon so that it can later be retrieved via
getIcon(Class) . |
static void |
registerGUI(String key,
Class<?> guiClass,
Class<?> testClass)
Register a GUI class so that it can later be retrieved via
getGUI(Class) . |
static void |
registerIcon(String key,
ImageIcon icon)
Register an icon so that it can later be retrieved via
getIcon(Class) . |
public static ImageIcon getIcon(Class<?> elementClass)
elementClass
- the class object which we want to get an icon forpublic static ImageIcon getIcon(Class<?> elementClass, boolean enabled)
elementClass
- the class object which we want to get an icon forenabled
- -
is icon enabledpublic static JComponent getGUI(Class<?> elementClass)
elementClass
- the class object which we want to get an instance ofpublic static void registerIcon(String key, ImageIcon icon)
getIcon(Class)
. The key should match the fully-qualified class
name for the class used as the parameter when retrieving the icon.key
- the name which can be used to retrieve this icon latericon
- the icon to storepublic static void registerDisabledIcon(String key, ImageIcon icon)
getIcon(Class)
. The key should match the fully-qualified class
name for the class used as the parameter when retrieving the icon.key
- the name which can be used to retrieve this icon latericon
- the icon to storepublic static void registerGUI(String key, Class<?> guiClass, Class<?> testClass) throws InstantiationException, IllegalAccessException
getGUI(Class)
. The key should match the fully-qualified class
name for the class used as the parameter when retrieving the GUI.key
- the name which can be used to retrieve this GUI laterguiClass
- the class object for the GUI componenttestClass
- the class of the objects edited by this GUIInstantiationException
- if an instance of the GUI class can not be instantiatedIllegalAccessException
- if access rights do not permit an instance of the GUI class
to be createdCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.