Package jexer
Class TCheckBox
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TCheckBox
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch()Act as though the checkbox was pressed.voiddraw()Draw a checkbox with label.MnemonicStringgetMnemonic()Get the mnemonic string for this checkbox.booleanisChecked()Get checked value.voidonKeypress(TKeypressEvent keypress)Handle keystrokes.voidonMouseDown(TMouseEvent mouse)Handle mouse checkbox presses.voidsetChecked(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, 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, getCustomMousePointer, getHeight, getLayoutManager, getLocale, getMouseStyle, getParent, getScreen, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, 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, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setLocale, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY, 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:
onMouseDownin classTWidget- Parameters:
mouse- mouse button down event
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypressin 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.
-
-