public abstract class WidgetFactoryAdapter<O extends OutputManager<?>> extends java.lang.Object implements WidgetFactory<O>
WidgetFactory
interface. Any API not overridden
by sub-classes will throw a RuntimeException
by default.Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.Class<? extends Widget>,java.lang.Class<? extends Widget>> |
classMap
Mapping between abstract and UI-specific widget classes.
|
private java.util.Map<java.lang.Class<? extends Widget<?>>,java.lang.reflect.Constructor<?>> |
widgetCtorsCache
A cache of widget constructors having as single parameter a
WidgetConfig instance. |
Constructor and Description |
---|
WidgetFactoryAdapter() |
Modifier and Type | Method and Description |
---|---|
<T extends Widget<O>> |
create(java.lang.Class<T> clazz,
WidgetId id,
WidgetConfig cfg)
Instantiate UI-specific version of the specified widget class.
|
Image<O> |
createImage(WidgetId id)
Create UI-specific
Image instance. |
Rect<O> |
createRectangle(WidgetId id,
Container<O> container)
Create new rectangle for given container.
|
ScrollBar<O> |
createScrollBar(WidgetId id,
ScrollBar.Orientation orientation,
Viewport<O> viewport)
Create UI-specific
ScrollBar instance. |
ToggleBox<O> |
createToggleBox(WidgetId id,
Container<O> container,
java.lang.String text)
Create new toggle-box for given container and text.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createAlertBox, createBorderedPanel, createBorderedPanel, createButton, createDropDown, createFileSystemChooserDialog, createLabel, createLabel, createLineBorder, createLineBorderedPanel, createMessageArea, createMnemonic, createRadioButton, createScrollableList, createScrollContainer, createScrollPane, createScrollPane, createStatusLine, createWindow
protected static java.util.Map<java.lang.Class<? extends Widget>,java.lang.Class<? extends Widget>> classMap
private java.util.Map<java.lang.Class<? extends Widget<?>>,java.lang.reflect.Constructor<?>> widgetCtorsCache
WidgetConfig
instance.public <T extends Widget<O>> T create(java.lang.Class<T> clazz, WidgetId id, WidgetConfig cfg)
create
in interface WidgetFactory<O extends OutputManager<?>>
T
- Widget abstract class type.clazz
- Widget abstract class for which UI-specific implementation should
be instantiated.id
- The widget's ID.cfg
- Widget configuration container.public ToggleBox<O> createToggleBox(WidgetId id, Container<O> container, java.lang.String text)
createToggleBox
in interface WidgetFactory<O extends OutputManager<?>>
id
- The widget's ID.container
- Container to which new instance will belong.text
- ToggleBox label text.ToggleBox
instance.public Rect<O> createRectangle(WidgetId id, Container<O> container)
createRectangle
in interface WidgetFactory<O extends OutputManager<?>>
id
- The widget's ID.container
- Container to which new instance will belong.Rect
instance.public Image<O> createImage(WidgetId id)
Image
instance.createImage
in interface WidgetFactory<O extends OutputManager<?>>
id
- The widget's ID.Image
.public ScrollBar<O> createScrollBar(WidgetId id, ScrollBar.Orientation orientation, Viewport<O> viewport)
ScrollBar
instance.id
- The widget's ID.orientation
- Scroll bar orientation horizontal or vertical.ScrollBar
.