Package crackers.kobots.parts.app.io
Class SmallMenuDisplay
-
- All Implemented Interfaces:
-
crackers.kobots.parts.app.io.NeoKeyMenu.MenuDisplay
public abstract class SmallMenuDisplay implements NeoKeyMenu.MenuDisplay
An abstract class that creates screen graphics for the NeoKeyMenu display. This is primarily intended for use with a small OLED display (e.g. 128x32). This class only creates the image: the displayFun receiver function is responsible for displaying the image. It also
If the mode is DisplayMode.TEXT, the image is constructed with two items on two rows.
The assumption for sizing is that the number of items given to display (4) should fit (128/32).
Note: text is NOT truncated, so if the text is "too long", it may overwrite other text.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
SmallMenuDisplay.DisplayMode
-
Field Summary
Fields Modifier and Type Field Description public final static Integer
DEFAULT_WIDTH
public final static Integer
DEFAULT_HEIGHT
-
Constructor Summary
Constructors Constructor Description SmallMenuDisplay(SmallMenuDisplay.DisplayMode mode, Integer displayWidth, Integer displayHeight)
-
Method Summary
Modifier and Type Method Description final Unit
setForeground(Color color)
final Unit
setBackground(Color color)
Unit
displayItems(List<NeoKeyMenu.MenuItem> items)
Display the menu items. -
-
Constructor Detail
-
SmallMenuDisplay
SmallMenuDisplay(SmallMenuDisplay.DisplayMode mode, Integer displayWidth, Integer displayHeight)
- Parameters:
mode
- the display mode (defaults to DisplayMode.TEXT)TODO "vertical" menu display TODO make it fit other things (multi-line?
-
-
Method Detail
-
setForeground
final Unit setForeground(Color color)
-
setBackground
final Unit setBackground(Color color)
-
displayItems
Unit displayItems(List<NeoKeyMenu.MenuItem> items)
Display the menu items.
-
-
-
-