Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class AbstractListBox.DefaultListBoxRenderer<V,T extends AbstractListBox<V,T>>
- java.lang.Object
-
- com.googlecode.lanterna.gui2.AbstractListBox.DefaultListBoxRenderer<V,T>
-
- Type Parameters:
V
- Type of the items the list box this renderer is forT
- Type of list box
- All Implemented Interfaces:
ComponentRenderer<T>
,InteractableRenderer<T>
- Enclosing class:
- AbstractListBox<V,T extends AbstractListBox<V,T>>
public static class AbstractListBox.DefaultListBoxRenderer<V,T extends AbstractListBox<V,T>> extends java.lang.Object implements InteractableRenderer<T>
The default renderer forAbstractListBox
and all its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private int
scrollTopIndex
private ScrollBar
verticalScrollBar
-
Constructor Summary
Constructors Constructor Description DefaultListBoxRenderer()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawComponent(TextGUIGraphics graphics, T listBox)
Using the supplied graphics object, draws the component passed in.TerminalPosition
getCursorLocation(T listBox)
TerminalSize
getPreferredSize(T listBox)
Given the supplied component, how large does this renderer want the component to be? Notice that this is the responsibility of the renderer and not the component itself, since the component has no idea what its visual representation looks like.
-
-
-
Field Detail
-
verticalScrollBar
private final ScrollBar verticalScrollBar
-
scrollTopIndex
private int scrollTopIndex
-
-
Method Detail
-
getCursorLocation
public TerminalPosition getCursorLocation(T listBox)
- Specified by:
getCursorLocation
in interfaceInteractableRenderer<V>
-
getPreferredSize
public TerminalSize getPreferredSize(T listBox)
Description copied from interface:ComponentRenderer
Given the supplied component, how large does this renderer want the component to be? Notice that this is the responsibility of the renderer and not the component itself, since the component has no idea what its visual representation looks like.- Specified by:
getPreferredSize
in interfaceComponentRenderer<V>
- Parameters:
listBox
- Component to calculate the preferred size of- Returns:
- The size this renderer would like the component to take up
-
drawComponent
public void drawComponent(TextGUIGraphics graphics, T listBox)
Description copied from interface:ComponentRenderer
Using the supplied graphics object, draws the component passed in.- Specified by:
drawComponent
in interfaceComponentRenderer<V>
- Parameters:
graphics
- Graphics object to use for drawinglistBox
- Component to draw
-
-