Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class ComboBox.DefaultComboBoxRenderer<V>
- java.lang.Object
-
- com.googlecode.lanterna.gui2.ComboBox.ComboBoxRenderer<V>
-
- com.googlecode.lanterna.gui2.ComboBox.DefaultComboBoxRenderer<V>
-
- Type Parameters:
V- Type of items in the combo box
- All Implemented Interfaces:
ComponentRenderer<ComboBox<V>>,InteractableRenderer<ComboBox<V>>
public static class ComboBox.DefaultComboBoxRenderer<V> extends ComboBox.ComboBoxRenderer<V>
This class is the default renderer implementation which will be used unless overridden. The combo box is rendered like a text box with an arrow point down to the right of it, which can receive focus and triggers the popup.
-
-
Field Summary
Fields Modifier and Type Field Description private inttextVisibleLeftPosition
-
Constructor Summary
Constructors Constructor Description DefaultComboBoxRenderer()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawComponent(TextGUIGraphics graphics, ComboBox<V> comboBox)Using the supplied graphics object, draws the component passed in.TerminalPositiongetCursorLocation(ComboBox<V> comboBox)TerminalSizegetPreferredSize(ComboBox<V> comboBox)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.
-
-
-
Method Detail
-
getCursorLocation
public TerminalPosition getCursorLocation(ComboBox<V> comboBox)
-
getPreferredSize
public TerminalSize getPreferredSize(ComboBox<V> comboBox)
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.- Parameters:
comboBox- 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, ComboBox<V> comboBox)
Description copied from interface:ComponentRendererUsing the supplied graphics object, draws the component passed in.- Parameters:
graphics- Graphics object to use for drawingcomboBox- Component to draw
-
-