Module com.googlecode.lanterna
Class MenuItem.DefaultMenuItemRenderer
- java.lang.Object
-
- com.googlecode.lanterna.gui2.menu.MenuItem.MenuItemRenderer
-
- com.googlecode.lanterna.gui2.menu.MenuItem.DefaultMenuItemRenderer
-
- All Implemented Interfaces:
ComponentRenderer<MenuItem>
,InteractableRenderer<MenuItem>
- Enclosing class:
- MenuItem
public static class MenuItem.DefaultMenuItemRenderer extends MenuItem.MenuItemRenderer
Default renderer for menu items (both sub-menus and regular items)
-
-
Constructor Summary
Constructors Constructor Description DefaultMenuItemRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawComponent(TextGUIGraphics graphics, MenuItem menuItem)
Using the supplied graphics object, draws the component passed in.TerminalPosition
getCursorLocation(MenuItem component)
TerminalSize
getPreferredSize(MenuItem 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.
-
-
-
Method Detail
-
getCursorLocation
public TerminalPosition getCursorLocation(MenuItem component)
-
getPreferredSize
public TerminalSize getPreferredSize(MenuItem 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, MenuItem menuItem)
Description copied from interface:ComponentRenderer
Using the supplied graphics object, draws the component passed in.- Parameters:
graphics
- Graphics object to use for drawingmenuItem
- Component to draw
-
-