Package crackers.kobots.graphics.widgets
Class SimpleMenuWidget
-
- All Implemented Interfaces:
-
crackers.kobots.graphics.widgets.KobotsWidget
public final class SimpleMenuWidget implements KobotsWidget<SimpleMenuWidget.MenuAction>
A simple "selectable" vertical menu of selections. If the number of items exceeds the number of lines to display, the menu will scroll so that the next
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
SimpleMenuWidget.MenuAction
public interface
SimpleMenuWidget.MenuItem
-
Field Summary
Fields Modifier and Type Field Description private final Rectangle
bounds
private final SimpleMenuWidget.MenuItem
currentItem
private final Graphics2D
graphics
private final List<SimpleMenuWidget.MenuItem>
menuItems
private final Integer
width
private final Integer
height
private final Font
itemFont
private final Integer
x
private final Integer
y
private final String
label
private final Font
labelFont
private final Integer
lineWidth
-
Constructor Summary
Constructors Constructor Description SimpleMenuWidget(Graphics2D graphics, List<SimpleMenuWidget.MenuItem> menuItems, Integer width, Integer height, Font itemFont, Integer x, Integer y, String label, Font labelFont, Integer lineWidth)
-
Method Summary
Modifier and Type Method Description Rectangle
getBounds()
How much space this occupies. final SimpleMenuWidget.MenuItem
getCurrentItem()
Graphics2D
getGraphics()
final List<SimpleMenuWidget.MenuItem>
getMenuItems()
final Integer
getWidth()
final Integer
getHeight()
final Font
getItemFont()
Integer
getX()
Integer
getY()
String
getLabel()
Font
getLabelFont()
Integer
getLineWidth()
<Error class: unknown class>
drawStatic()
Draw any "static" parts that don't get updated. <Error class: unknown class>
updateValue(SimpleMenuWidget.MenuAction currentValue)
Update the display to the current value. -
-
Method Detail
-
getCurrentItem
final SimpleMenuWidget.MenuItem getCurrentItem()
-
getGraphics
Graphics2D getGraphics()
-
getMenuItems
final List<SimpleMenuWidget.MenuItem> getMenuItems()
-
getItemFont
final Font getItemFont()
-
getLabelFont
Font getLabelFont()
-
getLineWidth
Integer getLineWidth()
-
drawStatic
<Error class: unknown class> drawStatic()
Draw any "static" parts that don't get updated.
-
updateValue
<Error class: unknown class> updateValue(SimpleMenuWidget.MenuAction currentValue)
Update the display to the current value. THIS IS NOT GUARANTEED TO BE THREAD-SAFE!!!
-
-
-
-