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 Object
implements InteractableRenderer<T>
The default renderer for
AbstractListBox
and all its subclasses.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawComponent
(TextGUIGraphics graphics, T listBox) Using the supplied graphics object, draws the component passed in.getCursorLocation
(T listBox) 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 Details
-
verticalScrollBar
-
scrollTopIndex
private int scrollTopIndex
-
-
Constructor Details
-
DefaultListBoxRenderer
public DefaultListBoxRenderer()Default constructor
-
-
Method Details
-
getCursorLocation
- Specified by:
getCursorLocation
in interfaceInteractableRenderer<V>
-
getPreferredSize
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
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
-