public abstract class TWidget extends java.lang.Object implements java.lang.Comparable<TWidget>
| Modifier | Constructor and Description |
|---|---|
protected |
TWidget()
Default constructor for subclasses.
|
protected |
TWidget(TWidget parent)
Protected constructor.
|
protected |
TWidget(TWidget parent,
boolean enabled)
Protected constructor used by subclasses that are disabled by default.
|
protected |
TWidget(TWidget parent,
boolean enabled,
int x,
int y,
int width,
int height)
Protected constructor used by subclasses that are disabled by default.
|
protected |
TWidget(TWidget parent,
int x,
int y,
int width,
int height)
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Make this widget the active child of its parent.
|
void |
activate(int tabOrder)
Switch the active child.
|
void |
activate(TWidget child)
Switch the active child.
|
void |
activateAll()
Make this widget, all of its parents, the active child.
|
TButton |
addButton(java.lang.String text,
int x,
int y,
TAction action)
Convenience function to add a button to this container/window.
|
TCalendar |
addCalendar(int x,
int y,
TAction updateAction)
Convenience function to add a calendar to this container/window.
|
TCheckBox |
addCheckBox(int x,
int y,
java.lang.String label,
boolean checked)
Convenience function to add a checkbox to this container/window.
|
TComboBox |
addComboBox(int x,
int y,
int width,
java.util.List<java.lang.String> values,
int valuesIndex,
int maxValuesHeight,
TAction updateAction)
Convenience function to add a combobox to this container/window.
|
TDirectoryList |
addDirectoryList(java.lang.String path,
int x,
int y,
int width,
int height)
Convenience function to add a directory list to this container/window.
|
TDirectoryList |
addDirectoryList(java.lang.String path,
int x,
int y,
int width,
int height,
TAction action)
Convenience function to add a directory list to this container/window.
|
TDirectoryList |
addDirectoryList(java.lang.String path,
int x,
int y,
int width,
int height,
TAction action,
TAction singleClickAction)
Convenience function to add a directory list to this container/window.
|
TDirectoryList |
addDirectoryList(java.lang.String path,
int x,
int y,
int width,
int height,
TAction action,
TAction singleClickAction,
java.util.List<java.lang.String> filters)
Convenience function to add a directory list to this container/window.
|
TEditorWidget |
addEditor(java.lang.String text,
int x,
int y,
int width,
int height)
Convenience function to add an editable text area box to this
container/window.
|
TField |
addField(int x,
int y,
int width,
boolean fixed)
Convenience function to add a text field to this container/window.
|
TField |
addField(int x,
int y,
int width,
boolean fixed,
java.lang.String text)
Convenience function to add a text field to this container/window.
|
TField |
addField(int x,
int y,
int width,
boolean fixed,
java.lang.String text,
TAction enterAction,
TAction updateAction)
Convenience function to add a text field to this container/window.
|
TImage |
addImage(int x,
int y,
int width,
int height,
java.awt.image.BufferedImage image,
int left,
int top)
Convenience function to add an image to this container/window.
|
TImage |
addImage(int x,
int y,
int width,
int height,
java.awt.image.BufferedImage image,
int left,
int top,
TAction clickAction)
Convenience function to add an image to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y)
Convenience function to add a label to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y,
java.lang.String colorKey)
Convenience function to add a label to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y,
java.lang.String colorKey,
boolean useWindowBackground)
Convenience function to add a label to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y,
java.lang.String colorKey,
boolean useWindowBackground,
TAction action)
Convenience function to add a label to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y,
java.lang.String colorKey,
TAction action)
Convenience function to add a label to this container/window.
|
TLabel |
addLabel(java.lang.String text,
int x,
int y,
TAction action)
Convenience function to add a label to this container/window.
|
TList |
addList(java.util.List<java.lang.String> strings,
int x,
int y,
int width,
int height)
Convenience function to add a list to this container/window.
|
TList |
addList(java.util.List<java.lang.String> strings,
int x,
int y,
int width,
int height,
TAction enterAction)
Convenience function to add a list to this container/window.
|
TList |
addList(java.util.List<java.lang.String> strings,
int x,
int y,
int width,
int height,
TAction enterAction,
TAction moveAction)
Convenience function to add a list to this container/window.
|
TList |
addList(java.util.List<java.lang.String> strings,
int x,
int y,
int width,
int height,
TAction enterAction,
TAction moveAction,
TAction singleClickAction)
Convenience function to add a list to this container/window.
|
TPanel |
addPanel(int x,
int y,
int width,
int height)
Convenience function to add a panel to this container/window.
|
TPasswordField |
addPasswordField(int x,
int y,
int width,
boolean fixed)
Convenience function to add a password text field to this
container/window.
|
TPasswordField |
addPasswordField(int x,
int y,
int width,
boolean fixed,
java.lang.String text)
Convenience function to add a password text field to this
container/window.
|
TPasswordField |
addPasswordField(int x,
int y,
int width,
boolean fixed,
java.lang.String text,
TAction enterAction,
TAction updateAction)
Convenience function to add a password text field to this
container/window.
|
TProgressBar |
addProgressBar(int x,
int y,
int width,
int value)
Convenience function to add a progress bar to this container/window.
|
TRadioGroup |
addRadioGroup(int x,
int y,
java.lang.String label)
Convenience function to add a radio button group to this
container/window.
|
TSpinner |
addSpinner(int x,
int y,
TAction upAction,
TAction downAction)
Convenience function to add a spinner to this container/window.
|
TSplitPane |
addSplitPane(int x,
int y,
int width,
int height,
boolean vertical)
Convenience function to add a split pane to this container/window.
|
TTableWidget |
addTable(int x,
int y,
int width,
int height)
Convenience function to add an editable 2D data table to this
container/window.
|
TTableWidget |
addTable(int x,
int y,
int width,
int height,
int gridColumns,
int gridRows)
Convenience function to add an editable 2D data table to this
container/window.
|
TText |
addText(java.lang.String text,
int x,
int y,
int width,
int height)
Convenience function to add a scrollable text box to this
container/window.
|
TText |
addText(java.lang.String text,
int x,
int y,
int width,
int height,
java.lang.String colorKey)
Convenience function to add a scrollable text box to this
container/window.
|
TTreeViewWidget |
addTreeViewWidget(int x,
int y,
int width,
int height)
Convenience function to add a scrollable tree view to this
container/window.
|
TTreeViewWidget |
addTreeViewWidget(int x,
int y,
int width,
int height,
TAction action)
Convenience function to add a scrollable tree view to this
container/window.
|
protected void |
close()
Subclasses should override this method to cleanup resources.
|
int |
compareTo(TWidget that)
Comparison operator.
|
protected void |
doRepaint()
Repaint the screen on the next update.
|
void |
draw()
Draw my specific widget.
|
protected void |
drawBox(int left,
int top,
int right,
int bottom,
CellAttributes border,
CellAttributes background)
Draw a box with a border and empty background.
|
protected void |
drawBox(int left,
int top,
int right,
int bottom,
CellAttributes border,
CellAttributes background,
int borderType,
boolean shadow)
Draw a box with a border and empty background.
|
protected void |
drawBoxShadow(int left,
int top,
int right,
int bottom)
Draw a box shadow.
|
java.lang.String |
fileOpenBox(java.lang.String path)
Convenience function to spawn a file open box.
|
java.lang.String |
fileOpenBox(java.lang.String path,
TFileOpenBox.Type type)
Convenience function to spawn a file open box.
|
java.lang.String |
fileOpenBox(java.lang.String path,
TFileOpenBox.Type type,
java.util.List<java.lang.String> filters)
Convenience function to spawn a file open box.
|
java.lang.String |
fileOpenBox(java.lang.String path,
TFileOpenBox.Type type,
java.lang.String filter)
Convenience function to spawn a file open box.
|
java.lang.String |
fileSaveBox(java.lang.String path)
Convenience function to spawn a file save box.
|
int |
getAbsoluteX()
Compute my absolute X position as the sum of my X plus all my parent's
X's.
|
int |
getAbsoluteY()
Compute my absolute Y position as the sum of my Y plus all my parent's
Y's.
|
TWidget |
getActiveChild()
Returns my active widget.
|
TApplication |
getApplication()
Get this TWidget's parent TApplication.
|
protected CellAttributes |
getAttrXY(int x,
int y)
Get the attributes at one location.
|
java.util.List<TWidget> |
getChildren()
Get the list of child widgets that this widget contains.
|
int |
getCursorAbsoluteX()
Returns the cursor X position.
|
int |
getCursorAbsoluteY()
Returns the cursor Y position.
|
int |
getCursorX()
Get cursor X value.
|
int |
getCursorY()
Get cursor Y value.
|
int |
getHeight()
Get the height.
|
LayoutManager |
getLayoutManager()
Get the layout manager.
|
TWidget |
getParent()
Get parent widget.
|
Screen |
getScreen()
Get the Screen.
|
protected ColorTheme |
getTheme()
Get the global color theme.
|
int |
getWidth()
Get the width.
|
TWindow |
getWindow()
Get the window this widget is on.
|
int |
getX()
Get X position.
|
int |
getY()
Get Y position.
|
void |
handleEvent(TInputEvent event)
Consume event.
|
protected void |
hLineXY(int x,
int y,
int n,
int ch,
CellAttributes attr)
Draw a horizontal line from (x, y) to (x + n, y).
|
TInputBox |
inputBox(java.lang.String title,
java.lang.String caption)
Convenience function to spawn an input box.
|
TInputBox |
inputBox(java.lang.String title,
java.lang.String caption,
java.lang.String text)
Convenience function to spawn an input box.
|
TInputBox |
inputBox(java.lang.String title,
java.lang.String caption,
java.lang.String text,
TMessageBox.Type type)
Convenience function to spawn an input box.
|
boolean |
isAbsoluteActive()
See if this widget should render with the active color.
|
boolean |
isActive()
Get active flag.
|
boolean |
isCursorVisible()
See if this widget has a visible cursor.
|
boolean |
isDrawable()
See if this widget can be drawn onto a screen.
|
boolean |
isEnabled()
Get enabled flag.
|
boolean |
isVisible()
See if this widget is visible.
|
TMessageBox |
messageBox(java.lang.String title,
java.lang.String caption)
Convenience function to spawn a message box.
|
TMessageBox |
messageBox(java.lang.String title,
java.lang.String caption,
TMessageBox.Type type)
Convenience function to spawn a message box.
|
boolean |
mouseWouldHit(TMouseEvent mouse)
Check if a mouse press/release event coordinate is contained in this
widget.
|
void |
onCommand(TCommandEvent command)
Method that subclasses can override to handle posted command events.
|
void |
onIdle()
Method that subclasses can override to do processing when the UI is
idle.
|
void |
onKeypress(TKeypressEvent keypress)
Method that subclasses can override to handle keystrokes.
|
void |
onMenu(TMenuEvent menu)
Method that subclasses can override to handle menu or posted menu
events.
|
void |
onMouseDoubleClick(TMouseEvent mouse)
Method that subclasses can override to handle mouse button
double-clicks.
|
void |
onMouseDown(TMouseEvent mouse)
Method that subclasses can override to handle mouse button presses.
|
void |
onMouseMotion(TMouseEvent mouse)
Method that subclasses can override to handle mouse movements.
|
void |
onMouseUp(TMouseEvent mouse)
Method that subclasses can override to handle mouse button releases.
|
void |
onResize(TResizeEvent resize)
Method that subclasses can override to handle window/screen resize
events.
|
protected void |
putAll(int ch,
CellAttributes attr)
Fill the entire screen with one character with attributes.
|
protected void |
putAttrXY(int x,
int y,
CellAttributes attr)
Set the attributes at one location.
|
protected void |
putAttrXY(int x,
int y,
CellAttributes attr,
boolean clip)
Set the attributes at one location.
|
protected void |
putCharXY(int x,
int y,
Cell ch)
Render one character with attributes.
|
protected void |
putCharXY(int x,
int y,
int ch)
Render one character without changing the underlying attributes.
|
protected void |
putCharXY(int x,
int y,
int ch,
CellAttributes attr)
Render one character with attributes.
|
protected void |
putStringXY(int x,
int y,
java.lang.String str)
Render a string without changing the underlying attribute.
|
protected void |
putStringXY(int x,
int y,
java.lang.String str,
CellAttributes attr)
Render a string.
|
void |
remove()
Remove this widget from its parent container.
|
void |
remove(boolean doClose)
Remove this widget from its parent container.
|
void |
remove(TWidget child)
Remove a child widget from this container.
|
void |
remove(TWidget child,
boolean doClose)
Remove a child widget from this container.
|
void |
removeAll(TWidget child,
boolean doClose)
Remove a child widget from this container, and all of its children
recursively from their parent containers.
|
protected void |
resetTabOrder()
Reset the tab order of children to match their position in the list.
|
void |
setActive(boolean active)
Set active flag.
|
void |
setCursorVisible(boolean cursorVisible)
Set visible cursor flag.
|
void |
setCursorX(int cursorX)
Set cursor X value.
|
void |
setCursorY(int cursorY)
Set cursor Y value.
|
void |
setDimensions(int x,
int y,
int width,
int height)
Change the dimensions.
|
void |
setEnabled(boolean enabled)
Set enabled flag.
|
void |
setHeight(int height)
Change the height.
|
void |
setLayoutManager(LayoutManager layout)
Set the layout manager.
|
void |
setParent(TWidget newParent,
boolean doClose)
Set this widget's parent to a different widget.
|
protected void |
setupForTWindow(TWindow window,
int x,
int y,
int width,
int height)
Backdoor access for TWindow's constructor.
|
void |
setVisible(boolean visible)
Set visible flag.
|
void |
setWidth(int width)
Change the width.
|
void |
setWindow(TWindow window)
Set this widget's window to a specific window.
|
void |
setX(int x)
Set X position.
|
void |
setY(int y)
Set Y position.
|
TSplitPane |
splitHorizontal(boolean newWidgetOnTop,
TWidget newWidget)
Insert a horizontal split between this widget and parent, and
optionally put another widget in the other side of the split.
|
TSplitPane |
splitVertical(boolean newWidgetOnLeft,
TWidget newWidget)
Insert a vertical split between this widget and parent, and optionally
put another widget in the other side of the split.
|
void |
switchWidget(boolean forward)
Switch the active widget with the next in the tab order.
|
java.lang.String |
toPrettyString()
Generate a string for this widget's hierarchy.
|
protected java.lang.String |
toPrettyString(java.lang.String prefix)
Generate a string for this widget's hierarchy.
|
java.lang.String |
toString()
Generate a human-readable string for this widget.
|
protected void |
vLineXY(int x,
int y,
int n,
int ch,
CellAttributes attr)
Draw a vertical line from (x, y) to (x, y + n).
|
protected TWidget()
protected TWidget(TWidget parent)
parent - parent widgetprotected TWidget(TWidget parent, int x, int y, int width, int height)
parent - parent widgetx - column relative to parenty - row relative to parentwidth - width of widgetheight - height of widgetprotected TWidget(TWidget parent, boolean enabled)
parent - parent widgetenabled - if true assume enabledprotected TWidget(TWidget parent, boolean enabled, int x, int y, int width, int height)
parent - parent widgetenabled - if true assume enabledx - column relative to parenty - row relative to parentwidth - width of widgetheight - height of widgetprotected final void setupForTWindow(TWindow window, int x, int y, int width, int height)
window - the top-level windowx - column relative to parenty - row relative to parentwidth - width of windowheight - height of windowprotected void close()
public final boolean mouseWouldHit(TMouseEvent mouse)
mouse - a mouse-based eventpublic void onKeypress(TKeypressEvent keypress)
keypress - keystroke eventpublic void onMouseDown(TMouseEvent mouse)
mouse - mouse button eventpublic void onMouseUp(TMouseEvent mouse)
mouse - mouse button eventpublic void onMouseMotion(TMouseEvent mouse)
mouse - mouse motion eventpublic void onMouseDoubleClick(TMouseEvent mouse)
mouse - mouse button eventpublic void onResize(TResizeEvent resize)
resize - resize eventpublic void onCommand(TCommandEvent command)
command - command eventpublic void onMenu(TMenuEvent menu)
menu - menu eventpublic void onIdle()
public void handleEvent(TInputEvent event)
event - keyboard, mouse, resize, command, or menu eventpublic final TWidget getParent()
public java.util.List<TWidget> getChildren()
public final void remove()
public final void remove(boolean doClose)
doClose - if true, call the close() method before removing the
childpublic final void remove(TWidget child)
child - the child widget to removepublic final void remove(TWidget child, boolean doClose)
child - the child widget to removedoClose - if true, call the close() method before removing the
childpublic final void setParent(TWidget newParent, boolean doClose)
newParent - new parent widgetdoClose - if true, call the close() method before removing the
child from its existing parent widgetpublic final void setWindow(TWindow window)
window - the window to usepublic final void removeAll(TWidget child, boolean doClose)
child - the child widget to removedoClose - if true, call the close() method before removing each
childpublic final boolean isActive()
public final void setActive(boolean active)
active - if true, this widget will receive eventspublic final TWindow getWindow()
public final int getX()
public final void setX(int x)
x - absolute X position of the top-left cornerpublic final int getY()
public final void setY(int y)
y - absolute Y position of the top-left cornerpublic int getWidth()
public void setWidth(int width)
width - new widget widthpublic int getHeight()
public void setHeight(int height)
height - new widget heightpublic final void setDimensions(int x,
int y,
int width,
int height)
x - absolute X position of the top-left cornery - absolute Y position of the top-left cornerwidth - new widget widthheight - new widget heightpublic LayoutManager getLayoutManager()
public void setLayoutManager(LayoutManager layout)
layout - the new layout managerpublic final boolean isEnabled()
public final void setEnabled(boolean enabled)
enabled - if true, this widget can be tabbed to or receive eventspublic final void setVisible(boolean visible)
visible - if true, this widget will be drawnpublic final boolean isVisible()
public final void setCursorVisible(boolean cursorVisible)
cursorVisible - if true, this widget has a cursorpublic final boolean isCursorVisible()
public final int getCursorX()
public final void setCursorX(int cursorX)
cursorX - column position in relative coordinatespublic final int getCursorY()
public final void setCursorY(int cursorY)
cursorY - row position in relative coordinatespublic TApplication getApplication()
public Screen getScreen()
public final int compareTo(TWidget that)
compareTo in interface java.lang.Comparable<TWidget>that - another TWidget, TWindow, or TTreeItem instancepublic final boolean isAbsoluteActive()
public final int getCursorAbsoluteX()
public final int getCursorAbsoluteY()
public final int getAbsoluteX()
public final int getAbsoluteY()
protected final ColorTheme getTheme()
public final boolean isDrawable()
public void draw()
protected final void doRepaint()
protected void resetTabOrder()
public final void activate(TWidget child)
child - TWidget to activatepublic final void activate(int tabOrder)
tabOrder - tabOrder of the child to activate. If that child
isn't enabled, then the next enabled child will be activated.public void activate()
public final void activateAll()
public final void switchWidget(boolean forward)
forward - if true, then switch to the next enabled widget in the
list, otherwise switch to the previous enabled widget in the listpublic TWidget getActiveChild()
public TSplitPane splitVertical(boolean newWidgetOnLeft, TWidget newWidget)
newWidgetOnLeft - if true, the new widget (if specified) will be
on the left pane, and this widget will be placed on the right panenewWidget - the new widget to add to the other pane, or nullpublic TSplitPane splitHorizontal(boolean newWidgetOnTop, TWidget newWidget)
newWidgetOnTop - if true, the new widget (if specified) will be
on the top pane, and this widget's children will be placed on the
bottom panenewWidget - the new widget to add to the other pane, or nullpublic java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String toPrettyString(java.lang.String prefix)
prefix - a prefix to use for this widget's place in the hierarchypublic java.lang.String toPrettyString()
protected final CellAttributes getAttrXY(int x, int y)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.protected final void putAttrXY(int x,
int y,
CellAttributes attr)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.attr - attributes to use (bold, foreColor, backColor)protected final void putAttrXY(int x,
int y,
CellAttributes attr,
boolean clip)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.attr - attributes to use (bold, foreColor, backColor)clip - if true, honor clipping/offsetprotected final void putAll(int ch,
CellAttributes attr)
ch - character to drawattr - attributes to use (bold, foreColor, backColor)protected final void putCharXY(int x,
int y,
Cell ch)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.ch - character + attributes to drawprotected final void putCharXY(int x,
int y,
int ch,
CellAttributes attr)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.ch - character to drawattr - attributes to use (bold, foreColor, backColor)protected final void putCharXY(int x,
int y,
int ch)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.ch - character to drawprotected final void putStringXY(int x,
int y,
java.lang.String str,
CellAttributes attr)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.str - string to drawattr - attributes to use (bold, foreColor, backColor)protected final void putStringXY(int x,
int y,
java.lang.String str)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.str - string to drawprotected final void vLineXY(int x,
int y,
int n,
int ch,
CellAttributes attr)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.n - number of characters to drawch - character to drawattr - attributes to use (bold, foreColor, backColor)protected final void hLineXY(int x,
int y,
int n,
int ch,
CellAttributes attr)
x - column coordinate. 0 is the left-most column.y - row coordinate. 0 is the top-most row.n - number of characters to drawch - character to drawattr - attributes to use (bold, foreColor, backColor)protected final void drawBox(int left,
int top,
int right,
int bottom,
CellAttributes border,
CellAttributes background)
left - left column of box. 0 is the left-most row.top - top row of the box. 0 is the top-most row.right - right column of boxbottom - bottom row of the boxborder - attributes to use for the borderbackground - attributes to use for the backgroundprotected final void drawBox(int left,
int top,
int right,
int bottom,
CellAttributes border,
CellAttributes background,
int borderType,
boolean shadow)
left - left column of box. 0 is the left-most row.top - top row of the box. 0 is the top-most row.right - right column of boxbottom - bottom row of the boxborder - attributes to use for the borderbackground - attributes to use for the backgroundborderType - if 1, draw a single-line border; if 2, draw a
double-line border; if 3, draw double-line top/bottom edges and
single-line left/right edges (like Qmodem)shadow - if true, draw a "shadow" on the boxprotected final void drawBoxShadow(int left,
int top,
int right,
int bottom)
left - left column of box. 0 is the left-most row.top - top row of the box. 0 is the top-most row.right - right column of boxbottom - bottom row of the boxpublic final TLabel addLabel(java.lang.String text, int x, int y)
text - labelx - column relative to parenty - row relative to parentpublic final TLabel addLabel(java.lang.String text, int x, int y, TAction action)
text - labelx - column relative to parenty - row relative to parentaction - to call when shortcut is pressedpublic final TLabel addLabel(java.lang.String text, int x, int y, java.lang.String colorKey)
text - labelx - column relative to parenty - row relative to parentcolorKey - ColorTheme key color to use for foreground text.
Default is "tlabel"public final TLabel addLabel(java.lang.String text, int x, int y, java.lang.String colorKey, TAction action)
text - labelx - column relative to parenty - row relative to parentcolorKey - ColorTheme key color to use for foreground text.
Default is "tlabel"action - to call when shortcut is pressedpublic final TLabel addLabel(java.lang.String text, int x, int y, java.lang.String colorKey, boolean useWindowBackground)
text - labelx - column relative to parenty - row relative to parentcolorKey - ColorTheme key color to use for foreground text.
Default is "tlabel"useWindowBackground - if true, use the window's background colorpublic final TLabel addLabel(java.lang.String text, int x, int y, java.lang.String colorKey, boolean useWindowBackground, TAction action)
text - labelx - column relative to parenty - row relative to parentcolorKey - ColorTheme key color to use for foreground text.
Default is "tlabel"useWindowBackground - if true, use the window's background coloraction - to call when shortcut is pressedpublic final TButton addButton(java.lang.String text, int x, int y, TAction action)
text - label on the buttonx - column relative to parenty - row relative to parentaction - action to call when button is pressedpublic final TCheckBox addCheckBox(int x, int y, java.lang.String label, boolean checked)
x - column relative to parenty - row relative to parentlabel - label to display next to (right of) the checkboxchecked - initial check statepublic final TComboBox addComboBox(int x, int y, int width, java.util.List<java.lang.String> values, int valuesIndex, int maxValuesHeight, TAction updateAction)
x - column relative to parenty - row relative to parentwidth - visible combobox width, including the down-arrowvalues - the possible values for the box, shown in the drop-downvaluesIndex - the initial index in values, or -1 for no default
valuemaxValuesHeight - the maximum height of the values drop-down when
it is visibleupdateAction - action to call when a new value is selected from
the list or enter is pressed in the edit fieldpublic final TSpinner addSpinner(int x, int y, TAction upAction, TAction downAction)
x - column relative to parenty - row relative to parentupAction - action to call when the up arrow is clicked or presseddownAction - action to call when the down arrow is clicked or
pressedpublic final TCalendar addCalendar(int x, int y, TAction updateAction)
x - column relative to parenty - row relative to parentupdateAction - action to call when the user changes the value of
the calendarpublic final TProgressBar addProgressBar(int x, int y, int width, int value)
x - column relative to parenty - row relative to parentwidth - width of progress barvalue - initial value of percent completepublic final TRadioGroup addRadioGroup(int x, int y, java.lang.String label)
x - column relative to parenty - row relative to parentlabel - label to display on the group boxpublic final TField addField(int x, int y, int width, boolean fixed)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthpublic final TField addField(int x, int y, int width, boolean fixed, java.lang.String text)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthtext - initial text, default is empty stringpublic final TField addField(int x, int y, int width, boolean fixed, java.lang.String text, TAction enterAction, TAction updateAction)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthtext - initial text, default is empty stringenterAction - function to call when enter key is pressedupdateAction - function to call when the text is updatedpublic final TText addText(java.lang.String text, int x, int y, int width, int height, java.lang.String colorKey)
text - text on the screenx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areacolorKey - ColorTheme key color to use for foreground textpublic final TText addText(java.lang.String text, int x, int y, int width, int height)
text - text on the screenx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areapublic final TEditorWidget addEditor(java.lang.String text, int x, int y, int width, int height)
text - text on the screenx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areapublic final TMessageBox messageBox(java.lang.String title, java.lang.String caption)
title - window title, will be centered along the top bordercaption - message to display. Use embedded newlines to get a
multi-line box.public final TMessageBox messageBox(java.lang.String title, java.lang.String caption, TMessageBox.Type type)
title - window title, will be centered along the top bordercaption - message to display. Use embedded newlines to get a
multi-line box.type - one of the TMessageBox.Type constants. Default is
Type.OK.public final TInputBox inputBox(java.lang.String title, java.lang.String caption)
title - window title, will be centered along the top bordercaption - message to display. Use embedded newlines to get a
multi-line box.public final TInputBox inputBox(java.lang.String title, java.lang.String caption, java.lang.String text)
title - window title, will be centered along the top bordercaption - message to display. Use embedded newlines to get a
multi-line box.text - initial text to seed the field withpublic final TInputBox inputBox(java.lang.String title, java.lang.String caption, java.lang.String text, TMessageBox.Type type)
title - window title, will be centered along the top bordercaption - message to display. Use embedded newlines to get a
multi-line box.text - initial text to seed the field withtype - one of the Type constants. Default is Type.OK.public final TPasswordField addPasswordField(int x, int y, int width, boolean fixed)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthpublic final TPasswordField addPasswordField(int x, int y, int width, boolean fixed, java.lang.String text)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthtext - initial text, default is empty stringpublic final TPasswordField addPasswordField(int x, int y, int width, boolean fixed, java.lang.String text, TAction enterAction, TAction updateAction)
x - column relative to parenty - row relative to parentwidth - visible text widthfixed - if true, the text cannot exceed the display widthtext - initial text, default is empty stringenterAction - function to call when enter key is pressedupdateAction - function to call when the text is updatedpublic final TTreeViewWidget addTreeViewWidget(int x, int y, int width, int height)
x - column relative to parenty - row relative to parentwidth - width of tree viewheight - height of tree viewpublic final TTreeViewWidget addTreeViewWidget(int x, int y, int width, int height, TAction action)
x - column relative to parenty - row relative to parentwidth - width of tree viewheight - height of tree viewaction - action to perform when an item is selectedpublic final java.lang.String fileOpenBox(java.lang.String path)
throws java.io.IOException
path - path of selected filejava.io.IOException - if a java.io operation throwspublic final java.lang.String fileSaveBox(java.lang.String path)
throws java.io.IOException
path - path of selected filejava.io.IOException - if a java.io operation throwspublic final java.lang.String fileOpenBox(java.lang.String path,
TFileOpenBox.Type type)
throws java.io.IOException
path - path of selected filetype - one of the Type constantsjava.io.IOException - if a java.io operation throwspublic final java.lang.String fileOpenBox(java.lang.String path,
TFileOpenBox.Type type,
java.lang.String filter)
throws java.io.IOException
path - path of selected filetype - one of the Type constantsfilter - a string that files must match to be displayedjava.io.IOException - of a java.io operation throwspublic final java.lang.String fileOpenBox(java.lang.String path,
TFileOpenBox.Type type,
java.util.List<java.lang.String> filters)
throws java.io.IOException
path - path of selected filetype - one of the Type constantsfilters - a list of strings that files must match to be displayedjava.io.IOException - of a java.io operation throwspublic final TDirectoryList addDirectoryList(java.lang.String path, int x, int y, int width, int height)
path - directory path, must be a directoryx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areapublic final TDirectoryList addDirectoryList(java.lang.String path, int x, int y, int width, int height, TAction action)
path - directory path, must be a directoryx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaaction - action to perform when an item is selected (enter or
double-click)public final TDirectoryList addDirectoryList(java.lang.String path, int x, int y, int width, int height, TAction action, TAction singleClickAction)
path - directory path, must be a directoryx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaaction - action to perform when an item is selected (enter or
double-click)singleClickAction - action to perform when an item is selected
(single-click)public final TDirectoryList addDirectoryList(java.lang.String path, int x, int y, int width, int height, TAction action, TAction singleClickAction, java.util.List<java.lang.String> filters)
path - directory path, must be a directoryx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaaction - action to perform when an item is selected (enter or
double-click)singleClickAction - action to perform when an item is selected
(single-click)filters - a list of strings that files must match to be displayedpublic final TList addList(java.util.List<java.lang.String> strings, int x, int y, int width, int height)
strings - list of strings to showx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areapublic final TList addList(java.util.List<java.lang.String> strings, int x, int y, int width, int height, TAction enterAction)
strings - list of strings to showx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaenterAction - action to perform when an item is selectedpublic final TList addList(java.util.List<java.lang.String> strings, int x, int y, int width, int height, TAction enterAction, TAction moveAction)
strings - list of strings to showx - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaenterAction - action to perform when an item is selectedmoveAction - action to perform when the user navigates to a new
item with arrow/page keyspublic TList addList(java.util.List<java.lang.String> strings, int x, int y, int width, int height, TAction enterAction, TAction moveAction, TAction singleClickAction)
strings - list of strings to show. This is allowed to be null
and set later with setList() or by subclasses.x - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areaenterAction - action to perform when an item is selectedmoveAction - action to perform when the user navigates to a new
item with arrow/page keyssingleClickAction - action to perform when the user clicks on an
itempublic final TImage addImage(int x, int y, int width, int height, java.awt.image.BufferedImage image, int left, int top)
x - column relative to parenty - row relative to parentwidth - number of text cells for width of the imageheight - number of text cells for height of the imageimage - the image to displayleft - left column of the image. 0 is the left-most column.top - top row of the image. 0 is the top-most row.public final TImage addImage(int x, int y, int width, int height, java.awt.image.BufferedImage image, int left, int top, TAction clickAction)
x - column relative to parenty - row relative to parentwidth - number of text cells for width of the imageheight - number of text cells for height of the imageimage - the image to displayleft - left column of the image. 0 is the left-most column.top - top row of the image. 0 is the top-most row.clickAction - function to call when mouse is pressedpublic TTableWidget addTable(int x, int y, int width, int height)
x - column relative to parenty - row relative to parentwidth - width of widgetheight - height of widgetpublic TTableWidget addTable(int x, int y, int width, int height, int gridColumns, int gridRows)
x - column relative to parenty - row relative to parentwidth - width of widgetheight - height of widgetgridColumns - number of columns in gridgridRows - number of rows in gridpublic final TPanel addPanel(int x, int y, int width, int height)
x - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areapublic final TSplitPane addSplitPane(int x, int y, int width, int height, boolean vertical)
x - column relative to parenty - row relative to parentwidth - width of text areaheight - height of text areavertical - if true, split verticallyCopyright © 2019 Kevin Lamonte. Licensed MIT.