public class GuiWidgetFactory extends WidgetFactoryAdapter<GuiOutputManager>
The return type for the create
APIs is different from the WidgetFactory
versions because:
GuiOutputManager
type, i.e. instead
of using MessageArea<GuiOutputManager>
as return type,
MessageAreaGuiImpl
can be used directly, with the same effect. WidgetFactory
implementation classes: if the WidgetFactory
implementation class is used
explicitly, it prevents accidental mixing of ChUI and GUI widgets (i.e. if used from
incorrect location). classMap
Constructor and Description |
---|
GuiWidgetFactory() |
Modifier and Type | Method and Description |
---|---|
AlertBoxGuiImpl |
createAlertBox(int alertType,
java.lang.Object[] content,
int buttonSet,
logical var,
java.lang.String title,
Color color,
java.lang.String[] stack)
Create UI-specific
AlertBox instance. |
BorderedPanel<GuiOutputManager> |
createBorderedPanel()
Creates new instance of
BorderedPanel with BorderLayout as
the layout manager and no border. |
BorderedPanel<GuiOutputManager> |
createBorderedPanel(LayoutManager<GuiOutputManager> mgr,
Border<GuiOutputManager> border)
Creates new instance of
BorderedPanel with a specific layout
manager and border. |
ButtonGuiImpl |
createButton(WidgetId id,
Container<GuiOutputManager> container,
java.lang.String text)
Create new button for given container and text.
|
DropDownGuiImpl |
createDropDown(ComboBox<GuiOutputManager> parent)
Create UI-specific
DropDown implementation. |
AbstractFileChooserDialog |
createFileSystemChooserDialog(java.lang.String title,
int parentWindow,
boolean dir)
Creates a new instance of a dialog that allows the user to navigate and choose a
file-system entity.
|
ImageGuiImpl |
createImage(WidgetId id)
Create UI-specific
Image instance. |
LabelGuiImpl |
createLabel(WidgetId id,
ClientDrivenLabel<GuiOutputManager> labelInstance,
int frameId)
Create UI-specific
ClientDrivenLabel instance as a copy of given ClientDrivenLabel . |
LabelGuiImpl |
createLabel(WidgetId id,
java.lang.String text,
int frameId)
Create new
ClientDrivenLabel instance for given text. |
LineBorderGuiImpl |
createLineBorder()
Creates new instance representing a default line border.
|
BorderedPanel<GuiOutputManager> |
createLineBorderedPanel()
Creates new instance of
BorderedPanel with BorderLayout
layout manager and simple border of width 1 measured in native units. |
MessageArea<GuiOutputManager> |
createMessageArea(WidgetId id,
int lines)
Create UI-specific
MessageArea instance. |
MnemonicInfo |
createMnemonic()
Create an object accumulating prepared label and mnemonic info.
|
RadioButtonGuiImpl |
createRadioButton(RadioSetConfig config,
java.lang.String label,
BaseDataType value)
Create GUI-specific
RadioButton instance. |
ScrollableSelectionListGuiImpl |
createScrollableList(ComboBox<GuiOutputManager> parent,
ListModel<java.lang.String> model)
Create UI-specific
ScrollableList implementation. |
ScrollBarGuiImpl |
createScrollBar(WidgetId id,
ScrollBar.Orientation orientation,
Viewport<GuiOutputManager> viewport)
Create UI-specific
ScrollBar instance. |
SensitiveScrollContainer<GuiOutputManager> |
createScrollContainer()
Create UI-specific
SensitiveScrollContainer implementation. |
ScrollPaneGuiImpl |
createScrollPane(ScrollableWidget<GuiOutputManager> widget)
Create GUI-specific
ScrollPane instance. |
ScrollPaneGuiImpl |
createScrollPane(ScrollableWidget<GuiOutputManager> widget,
java.util.function.Supplier<TopLevelWindow<GuiOutputManager>> wnd)
Create GUI-specific
ScrollPane instance. |
StatusLineGuiImpl |
createStatusLine(WidgetId id)
Create UI-specific
StatusLine instance. |
WindowGuiImpl |
createWindow(WidgetId id)
Create UI-specific
Window instance. |
addWidgetClass, create, createRectangle, createToggleBox
public MnemonicInfo createMnemonic()
MnemonicInfoGuiImpl
instance.public WindowGuiImpl createWindow(WidgetId id)
Window
instance.id
- The widget's ID.Window
.public StatusLineGuiImpl createStatusLine(WidgetId id)
StatusLine
instance.id
- The widget's ID.StatusLine
.public MessageArea<GuiOutputManager> createMessageArea(WidgetId id, int lines)
MessageArea
instance.id
- The widget's ID.lines
- Number of visible lines in message area.MessageArea
.public ImageGuiImpl createImage(WidgetId id)
Image
instance.createImage
in interface WidgetFactory<GuiOutputManager>
createImage
in class WidgetFactoryAdapter<GuiOutputManager>
id
- The widget's ID.Image
.public ScrollBarGuiImpl createScrollBar(WidgetId id, ScrollBar.Orientation orientation, Viewport<GuiOutputManager> viewport)
ScrollBar
instance.createScrollBar
in class WidgetFactoryAdapter<GuiOutputManager>
id
- The widget's ID.orientation
- Scroll bar orientation horizontal or vertical.viewport
- Viewport.ScrollBarGuiImpl
.public DropDownGuiImpl createDropDown(ComboBox<GuiOutputManager> parent)
DropDown
implementation.public ScrollableSelectionListGuiImpl createScrollableList(ComboBox<GuiOutputManager> parent, ListModel<java.lang.String> model)
ScrollableList
implementation.parent
- Parent ComboBox
widget.model
- Scrollable list model.ScrollableList
.public SensitiveScrollContainer<GuiOutputManager> createScrollContainer()
SensitiveScrollContainer
implementation.SensitiveScrollContainer
.public ScrollPaneGuiImpl createScrollPane(ScrollableWidget<GuiOutputManager> widget)
ScrollPane
instance.widget
- Widget which will be scrolled.ScrollPaneGuiImpl
.public ScrollPaneGuiImpl createScrollPane(ScrollableWidget<GuiOutputManager> widget, java.util.function.Supplier<TopLevelWindow<GuiOutputManager>> wnd)
ScrollPane
instance.widget
- Widget which will be scrolled.wnd
- TopLevelWindow supplierScrollPaneGuiImpl
.public LabelGuiImpl createLabel(WidgetId id, ClientDrivenLabel<GuiOutputManager> labelInstance, int frameId)
ClientDrivenLabel
instance as a copy of given ClientDrivenLabel
.id
- The widget's ID.labelInstance
- Source ClientDrivenLabel
instance.frameId
- The ID of the frame to which the label belongs, or -1 if unknown at the time of the
creation.ClientDrivenLabel
.public LabelGuiImpl createLabel(WidgetId id, java.lang.String text, int frameId)
ClientDrivenLabel
instance for given text.id
- The widget's ID.text
- Label text.frameId
- The ID of the frame to which the label belongs, or -1 if unknown at the time of the
creation.ClientDrivenLabel
instance.public ButtonGuiImpl createButton(WidgetId id, Container<GuiOutputManager> container, java.lang.String text)
id
- The widget's ID.container
- Container to which new instance will belong.text
- Button text.Button
instance.public AlertBoxGuiImpl createAlertBox(int alertType, java.lang.Object[] content, int buttonSet, logical var, java.lang.String title, Color color, java.lang.String[] stack)
AlertBox
instance.alertType
- One of the ALERT_* constants specifying message type.content
- The list of message text components.buttonSet
- One of the BTN_* constants specifying used button set.var
- The variable to update if not null
.title
- The dialog title.color
- Color scheme to use, ignored.stack
- Progress stack traceMessageArea
.public BorderedPanel<GuiOutputManager> createBorderedPanel()
BorderedPanel
with BorderLayout
as
the layout manager and no border.BorderedPanel
.public BorderedPanel<GuiOutputManager> createLineBorderedPanel()
BorderedPanel
with BorderLayout
layout manager and simple border of width 1 measured in native units.BorderedPanel
.public BorderedPanel<GuiOutputManager> createBorderedPanel(LayoutManager<GuiOutputManager> mgr, Border<GuiOutputManager> border)
BorderedPanel
with a specific layout
manager and border.mgr
- Layout manager.border
- Border for this widget.BorderedPanel
.public LineBorderGuiImpl createLineBorder()
Border
.public RadioButtonGuiImpl createRadioButton(RadioSetConfig config, java.lang.String label, BaseDataType value)
RadioButton
instance.config
- Parent config.label
- Radio button label.value
- Radio button data type.RadioButton
.public AbstractFileChooserDialog createFileSystemChooserDialog(java.lang.String title, int parentWindow, boolean dir)
title
- The title of the dialog. Optional. If null
the dialog will use its default
window title.parentWindow
- The id of the window to be parent of the newly created dialog.dir
- If true
the dialog returned will be able to select only directories,
otherwise the dialog will allow selection of files only.