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 forAbstractListBoxand all its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private intscrollTopIndexprivate ScrollBarverticalScrollBar
-
Constructor Summary
Constructors Constructor Description DefaultListBoxRenderer()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawComponent(TextGUIGraphics graphics, T listBox)Using the supplied graphics object, draws the component passed in.TerminalPositiongetCursorLocation(T listBox)TerminalSizegetPreferredSize(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:
getCursorLocationin interfaceInteractableRenderer<V>
-
getPreferredSize
public TerminalSize getPreferredSize(T listBox)
Description copied from interface:ComponentRendererGiven 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:
getPreferredSizein 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:ComponentRendererUsing the supplied graphics object, draws the component passed in.- Specified by:
drawComponentin interfaceComponentRenderer<V>- Parameters:
graphics- Graphics object to use for drawinglistBox- Component to draw
-
-