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>>
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawComponent
(TextGUIGraphics graphics, ComboBox<V> comboBox) Using the supplied graphics object, draws the component passed in.getCursorLocation
(ComboBox<V> comboBox) getPreferredSize
(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.
-
Field Details
-
textVisibleLeftPosition
private int textVisibleLeftPosition
-
-
Constructor Details
-
DefaultComboBoxRenderer
public DefaultComboBoxRenderer()Default constructor
-
-
Method Details
-
getCursorLocation
-
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.- Parameters:
comboBox
- 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.- Parameters:
graphics
- Graphics object to use for drawingcomboBox
- Component to draw
-