Package jexer
Class TCheckBox
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TCheckBox
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispatch()
Act as though the checkbox was pressed.void
draw()
Draw a checkbox with label.MnemonicString
getMnemonic()
Get the mnemonic string for this checkbox.boolean
isChecked()
Get checked value.void
onKeypress(TKeypressEvent keypress)
Handle keystrokes.void
onMouseDown(TMouseEvent mouse)
Handle mouse checkbox presses.void
setChecked(boolean checked)
Set checked value.-
Methods inherited from class jexer.TWidget
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, close, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseDoubleClick, onMouseMotion, onMouseUp, onResize, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
-
-
-
-
Constructor Detail
-
TCheckBox
public TCheckBox(TWidget parent, int x, int y, java.lang.String label, boolean checked)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentlabel
- label to display next to (right of) the checkboxchecked
- initial check state
-
TCheckBox
public TCheckBox(TWidget parent, int x, int y, java.lang.String label, boolean checked, TAction action)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentlabel
- label to display next to (right of) the checkboxchecked
- initial check stateaction
- the action to perform when the checkbox is toggled
-
-
Method Detail
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse checkbox presses.- Overrides:
onMouseDown
in classTWidget
- Parameters:
mouse
- mouse button down event
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypress
in classTWidget
- Parameters:
keypress
- keystroke event
-
isChecked
public boolean isChecked()
Get checked value.- Returns:
- if true, this is checked
-
setChecked
public void setChecked(boolean checked)
Set checked value.- Parameters:
checked
- new checked value.
-
getMnemonic
public MnemonicString getMnemonic()
Get the mnemonic string for this checkbox.- Returns:
- mnemonic string
-
dispatch
public void dispatch()
Act as though the checkbox was pressed. This is useful for other UI elements to get the same action as if the user clicked the checkbox.
-
-