Module com.googlecode.lanterna
Package com.googlecode.lanterna.gui2
Class CheckBox.DefaultCheckBoxRenderer
- java.lang.Object
-
- com.googlecode.lanterna.gui2.CheckBox.CheckBoxRenderer
-
- com.googlecode.lanterna.gui2.CheckBox.DefaultCheckBoxRenderer
-
- All Implemented Interfaces:
ComponentRenderer<CheckBox>
,InteractableRenderer<CheckBox>
- Enclosing class:
- CheckBox
public static class CheckBox.DefaultCheckBoxRenderer extends CheckBox.CheckBoxRenderer
The default renderer that is used unless overridden. This renderer will draw the checkbox label on the right side of a "[ ]" block which will contain a "X" inside it if the check box has toggle status on
-
-
Field Summary
Fields Modifier and Type Field Description private static TerminalPosition
CURSOR_LOCATION
-
Constructor Summary
Constructors Constructor Description DefaultCheckBoxRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawComponent(TextGUIGraphics graphics, CheckBox component)
Using the supplied graphics object, draws the component passed in.TerminalPosition
getCursorLocation(CheckBox component)
TerminalSize
getPreferredSize(CheckBox component)
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
-
CURSOR_LOCATION
private static final TerminalPosition CURSOR_LOCATION
-
-
Method Detail
-
getCursorLocation
public TerminalPosition getCursorLocation(CheckBox component)
-
getPreferredSize
public TerminalSize getPreferredSize(CheckBox component)
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:
component
- 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, CheckBox component)
Description copied from interface:ComponentRenderer
Using the supplied graphics object, draws the component passed in.- Parameters:
graphics
- Graphics object to use for drawingcomponent
- Component to draw
-
-