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 enumSimpleMenuWidget.MenuActionpublic interfaceSimpleMenuWidget.MenuItem
-
Field Summary
Fields Modifier and Type Field Description private final Rectangleboundsprivate final SimpleMenuWidget.MenuItemcurrentItemprivate final Graphics2Dgraphicsprivate final List<SimpleMenuWidget.MenuItem>menuItemsprivate final Integerwidthprivate final Integerheightprivate final FontitemFontprivate final Integerxprivate final Integeryprivate final Stringlabelprivate final FontlabelFontprivate final IntegerlineWidth
-
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 RectanglegetBounds()How much space this occupies. final SimpleMenuWidget.MenuItemgetCurrentItem()Graphics2DgetGraphics()final List<SimpleMenuWidget.MenuItem>getMenuItems()final IntegergetWidth()final IntegergetHeight()final FontgetItemFont()IntegergetX()IntegergetY()StringgetLabel()FontgetLabelFont()IntegergetLineWidth()<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!!!
-
-
-
-