public abstract class AbstractObjectRenderer extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected static Hashtable<Class,List<Class>> |
m_Cache
the cache for object class / renderer relation.
|
protected static Class[] |
m_RendererClasses
the renderers (classes) currently available.
|
protected static Vector<String> |
m_Renderers
the renderers (classnames) currently available.
|
Constructor and Description |
---|
AbstractObjectRenderer() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
doRender(Object obj,
JPanel panel)
Performs the actual rendering.
|
static List<AbstractObjectRenderer> |
getRenderer(Class cls)
Returns a renderer for the specified class.
|
static List<AbstractObjectRenderer> |
getRenderer(Object obj)
Returns a renderer for the specified object.
|
static String[] |
getRenderers()
Returns a list with classnames of renderers.
|
abstract boolean |
handles(Class cls)
Checks whether the renderer can handle the specified class.
|
protected static void |
initRenderers()
Initializes the renderers.
|
protected static List<AbstractObjectRenderer> |
instantiate(List<Class> renderers)
Instantiates the renderers.
|
String |
render(Object obj,
JPanel panel)
Exports the object.
|
protected static Hashtable<Class,List<Class>> m_Cache
protected static Vector<String> m_Renderers
protected static Class[] m_RendererClasses
protected static void initRenderers()
public static List<AbstractObjectRenderer> getRenderer(Object obj)
obj
- the object to get a commandline renderer forprotected static List<AbstractObjectRenderer> instantiate(List<Class> renderers)
renderers
- the renderers to instantiatepublic static List<AbstractObjectRenderer> getRenderer(Class cls)
cls
- the class to get a commandline renderer forpublic abstract boolean handles(Class cls)
cls
- the class to checkprotected abstract String doRender(Object obj, JPanel panel)
obj
- the object to renderpanel
- the panel to render intopublic String render(Object obj, JPanel panel)
obj
- the object to renderpanel
- the panel to render intopublic static String[] getRenderers()
Copyright © 2017. All Rights Reserved.