V - Type of items in the RadioBoxListpublic static class RadioBoxList.RadioBoxListItemRenderer<V> extends AbstractListBox.ListItemRenderer<V,RadioBoxList<V>>
| Constructor | Description |
|---|---|
RadioBoxListItemRenderer() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
drawItem(TextGUIGraphics graphics,
RadioBoxList<V> listBox,
int index,
V item,
boolean selected,
boolean focused) |
This is the main drawing method for a single list box item, it applies the current theme to setup the colors
and then calls
getLabel(..) and draws the result using the supplied TextGUIGraphics. |
int |
getHotSpotPositionOnLine(int selectedIndex) |
Returns where on the line to place the text terminal cursor for a currently selected item.
|
String |
getLabel(RadioBoxList<V> listBox,
int index,
V item) |
Given a list box, an index of an item within that list box and what the item is, this method should return
what to draw for that item.
|
public int getHotSpotPositionOnLine(int selectedIndex)
AbstractListBox.ListItemRendererListItemRenderer you
can change this by returning a different number. Returning -1 will cause lanterna to hide the cursor.getHotSpotPositionOnLine in class AbstractListBox.ListItemRenderer<V,RadioBoxList<V>>selectedIndex - Which item is currently selectedpublic String getLabel(RadioBoxList<V> listBox, int index, V item)
AbstractListBox.ListItemRenderertoString() returns when
called on the item.getLabel in class AbstractListBox.ListItemRenderer<V,RadioBoxList<V>>listBox - List box the item belongs toindex - Index of the itemitem - The item itselfpublic void drawItem(TextGUIGraphics graphics, RadioBoxList<V> listBox, int index, V item, boolean selected, boolean focused)
AbstractListBox.ListItemRenderergetLabel(..) and draws the result using the supplied TextGUIGraphics. The
graphics object is created just for this item and is restricted so that it can only draw on the area this
item is occupying. The top-left corner (0x0) should be the starting point when drawing the item.drawItem in class AbstractListBox.ListItemRenderer<V,RadioBoxList<V>>graphics - Graphics object to draw withlistBox - List box we are drawing an item fromindex - Index of the item we are drawingitem - The item we are drawingselected - Will be set to true if the item is currently selected, otherwise false, but
please notice what context 'selected' refers to here (see setSelectedIndex)focused - Will be set to true if the list box currently has input focus, otherwise falseCopyright © 2020. All rights reserved.