Package jexer
Class TRadioGroup
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TRadioGroup
-
-
Constructor Summary
Constructors Constructor Description TRadioGroup(TWidget parent, int x, int y, int width, java.lang.String label)
Public constructor.TRadioGroup(TWidget parent, int x, int y, java.lang.String label)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TRadioButton
addRadioButton(java.lang.String label)
Convenience function to add a radio button to this group.TRadioButton
addRadioButton(java.lang.String label, boolean selected)
Convenience function to add a radio button to this group.void
draw()
Draw a radio button with label.boolean
getRequiresSelection()
Get the requires selection flag.int
getSelected()
Get the radio button ID that was selected.TRadioButton
getSelectedButton()
Get the radio button that was selected.void
setHeight(int height)
Override TWidget's height: we can only set height at construction time.void
setRequiresSelection(boolean requiresSelection)
Set the requires selection flag.void
setSelected(int id)
Set the new selected radio button.void
setWidth(int width)
Override TWidget's width: we can only set width at construction time.-
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, onKeypress, onMenu, onMouseDoubleClick, onMouseDown, 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, setLayoutManager, setParent, setupForTWindow, setVisible, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
-
-
-
-
Constructor Detail
-
TRadioGroup
public TRadioGroup(TWidget parent, int x, int y, int width, java.lang.String label)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentwidth
- width of grouplabel
- label to display on the group box
-
TRadioGroup
public TRadioGroup(TWidget parent, int x, int y, java.lang.String label)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentlabel
- label to display on the group box
-
-
Method Detail
-
setWidth
public void setWidth(int width)
Override TWidget's width: we can only set width at construction time.
-
setHeight
public void setHeight(int height)
Override TWidget's height: we can only set height at construction time.
-
getSelected
public int getSelected()
Get the radio button ID that was selected.- Returns:
- ID of the selected button, or 0 if no button is selected
-
setSelected
public void setSelected(int id)
Set the new selected radio button. 1-based.- Parameters:
id
- ID of the selected button, or 0 to unselect
-
getSelectedButton
public TRadioButton getSelectedButton()
Get the radio button that was selected.- Returns:
- the selected button, or null if no button is selected
-
addRadioButton
public TRadioButton addRadioButton(java.lang.String label, boolean selected)
Convenience function to add a radio button to this group.- Parameters:
label
- label to display next to (right of) the radiobuttonselected
- if true, this will be the selected radiobutton- Returns:
- the new radio button
-
addRadioButton
public TRadioButton addRadioButton(java.lang.String label)
Convenience function to add a radio button to this group.- Parameters:
label
- label to display next to (right of) the radiobutton- Returns:
- the new radio button
-
getRequiresSelection
public boolean getRequiresSelection()
Get the requires selection flag.- Returns:
- true if this radiogroup requires that one of the buttons be selected
-
setRequiresSelection
public void setRequiresSelection(boolean requiresSelection)
Set the requires selection flag.- Parameters:
requiresSelection
- if true, then this radiogroup requires that one of the buttons be selected
-
-